使用docker-compose在Bluemix中部署2个服务时出错:
Creating xxx
ERROR: for xxx-service 'message'
Traceback (most recent call last):
File "bin/docker-compose", line 3, in <module>
File "compose/cli/main.py", line 64, in main
File "compose/cli/main.py", line 116, in perform_command
File "compose/cli/main.py", line 876, in up
File "compose/project.py", line 416, in up
File "compose/parallel.py", line 66, in parallel_execute
KeyError: 'message'
Failed to execute script docker-compose
我的docker-compose文件(完全在本地运行)是:
yyy-service:
image: yyy
container_name: wp-docker
hostname: wp-docker
ports:
- 8080:80
environment:
WORDPRESS_DB_PASSWORD: whatever
volumes:
- "~/whatever/:/var/www/html/wp-content"
links:
- xxx-service
xxx-service:
image: xxx
container_name: wp-mysql
hostname: wp-mysql
environment:
MYSQL_ROOT_PASSWORD: whatever
MYSQL_DATABASE: whatever
MYSQL_USER: root
MYSQL_PASSWORD: whatever
volumes:
- /var/data/whatever:/var/lib/mysql
问题与this one非常相似,但除了尝试
外,我看不到任何解决方案export COMPOSE_HTTP_TIMEOUT=300
这对我没用。
答案 0 :(得分:1)
不幸的是,docker-compose吃掉了返回的实际错误消息,并为您提供了有关其python脚本的有用堆栈跟踪,但没有关于根本原因的信息。
从您的撰写文件中,我的猜测是问题与您的卷有关。您已经指出它将计算主机上的目录直接挂载到容器中。这在Bluemix中不起作用 - 相反,你需要指定卷是外部的(并首先创建它们),然后指向它们。
例如:
version: '2'
services:
test:
image: registry.ng.bluemix.net/ibmliberty
volumes:
- test:/tmp/data:rw
volumes:
test:
external: true
首先使用cf ic volume create test