我在Windows Server 2019中使用DockerProvider
安装了docker
我正在使用此代码
Install-Module DockerProvider
Install-Package Docker -ProviderName DockerProvider -RequiredVersion preview
[Environment]::SetEnvironmentVariable("LCOW_SUPPORTED", "1", "Machine")
之后,我使用此代码安装Docker-Compose
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-Windows-x86_64.exe" -UseBasicParsing -OutFile $Env:ProgramFiles\Docker\docker-compose.exe
之后,我使用docker compose文件
version: "3.5"
services:
rabbitmq:
# restart: always
image: rabbitmq:3-management
container_name: rabbitmq
ports:
- 5672:5672
- 15672:15672
networks:
- myname
# network_mode: host
volumes:
- rabbitmq:/var/lib/rabbitmq
networks:
myname:
name: myname-network
volumes:
rabbitmq:
driver: local
一切正常
但是在浏览器中调用http://localhost:15672/
网址后
rabbitmq崩溃,我在docker logs <container-id>
Cookie file /var/lib/rabbitmq/.erlang.cookie must be accessible by owner only
此.yml
文件在docker for windows
中正常工作
但是在Windows Server中运行文件后,我看到此错误
答案 0 :(得分:0)
解决方案是映射将在其中创建Cookie文件的其他卷;
因此,在您的示例中,不是;
- rabbitmq:/var/lib/rabbitmq
但是;
- rabbitmq:/var/lib/rabbitmq/mnesia