RabbitMQ Docker容器错误:读取/var/lib/rabbitmq/.erlang.cookie时出错:eacces

时间:2018-01-05 13:50:06

标签: docker docker-compose rabbitmq docker-for-windows docker-desktop

我在Windows Server 1709(Windows Server核心版)上从Docker中运行rabbitmq时遇到问题。

我正在使用docker-compose来创建rabbitmq服务。如果我在本地计算机上运行docker-compose,一切正常。当我在Windows服务器上运行docker-compose时(其中docker已设置为windows上的docker lcow支持)我在日志中多次出现上述错误。即此错误是:

  

阅读/var/lib/rabbitmq/.erlang.cookie时出错:eacces

值得注意的是,即使我只是手动拉动rabbitmq并手动运行docker run -itd --rm --name rabbitmq rabbitmq:3-management

,我也会收到此错误

我能够在崩溃和退出之前冲入容器一段时间,我看到以下内容:

root@localhost:~# ls -la
---------- 2 root root   20 Jan  5 12:18 .erlang.cookie

在我的localhost上,权限看起来像这样(这是正确的):

root@localhost:~# ls -la 
-r-------- 1 rabbitmq rabbitmq   20 Dec 28 00:00 .erlang.cookie

我无法理解为什么服务器上的权限结构被破坏了。

对于使用Docker for Windows的Windows Server 1709上的LCOW支持,这是否可能存在问题?或者是rabbitmq的问题?

此处参考的是使用的docker撰写文件:

version: "3.3"
services:

  rabbitmq:
    image: rabbitmq:3-management
    container_name: rabbitmq
    hostname: localhost
    ports: 
      - "1001:5672"
      - "1002:15672"
    environment:
      - "RABBITMQ_DEFAULT_USER=user"
      - "RABBITMQ_DEFAULT_PASS=password"
    volumes:
      - d:/docker_data/rabbitmq:/var/lib/rabbitmq/mnesia
    restart: always

此处参考的是泊坞信息,其中发生了错误。

docker info

Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 1
Server Version: 17.10.0-ee-preview-3
Storage Driver: windowsfilter (windows) lcow (linux)
 LCOW:
Logging Driver: json-file
Plugins:
 Volume: local
 Network: ics l2bridge l2tunnel nat null overlay transparent
 Log: awslogs etwlogs fluentd json-file logentries splunk syslog
Swarm: inactive
Default Isolation: process
Kernel Version: 10.0 16299 (16299.15.amd64fre.rs3_release.170928-1534)
Operating System: Windows Server Datacenter
OSType: windows
Architecture: x86_64
CPUs: 4
Total Memory: 7.905GiB
Name: ServerName
Docker Root Dir: D:\docker-root
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

docker version

Client:
 Version:      17.10.0-ee-preview-3
 API version:  1.33
 Go version:   go1.8.4
 Git commit:   1649af8
 Built:        Fri Oct  6 17:52:28 2017
 OS/Arch:      windows/amd64

Server:
 Version:      17.10.0-ee-preview-3
 API version:  1.34 (minimum version 1.24)
 Go version:   go1.8.4
 Git commit:   b8571fd
 Built:        Fri Oct  6 18:01:48 2017
 OS/Arch:      windows/amd64
 Experimental: true

0 个答案:

没有答案