我有两个Docker镜像作为链接对开始。现在尝试使用Compose来自动化启动过程。我的撰写文件:
apacheserver:
image: 172.17.81.99:5000/apache-http-server-fedora
links:
- libertyserver:liberty
ports:
- 9081:9080
- 3023:22
volumes:
- /var/docker_data_repository:/var/hostfiles
libertyserver:
image: 172.17.81.99:5000/liberty-server-fedora
ports:
- 9080:9080
- 3022:22
volumes:
- /var/docker_data_repository:/var/hostfiles
这样会失败:
...
docker inspect_container -> {u'AppArmorProfile': u'',
u'Args': [u'-c', u'/startup/docker-liberty-startup.sh'],
u'Config': {u'AttachStderr': True,
u'AttachStdin': False,
u'AttachStdout': True,
u'Cmd': [u'/bin/sh',
u'-c',
u'/startup/docker-liberty-startup.sh'],
u'CpuShares': 0,
u'Cpuset': u'',
...
docker start <- (u'77a19fb191637f6b969cd6315acfd7965319c8a2f6caa3d19055855936ae56aa')
Cannot start container 77a19fb191637f6b969cd6315acfd7965319c8a2f6caa3d19055855936ae56aa: (exit status 2)
如果我查看生成的容器,它会说:
...
"State": {
"Error": " (exit status 2)",
"ExitCode": 128,
"FinishedAt": "0001-01-01T00:00:00Z",
除了实例详细信息之外,检查日志的内容与成功启动的容器明显不同。我还没有找到这些退出代码的任何解释似乎适用于这种情况。有没有办法从Docker获取有关失败原因的更详细信息?