docker-compose build失败
来源:6-5 部署一个复杂的投票应用
掣风悬武
2020-03-27
报错截图如下:
我的docker-compose.yml文件如下:
version: "3"
services:
voting-app:
build: ./voting-app/.
volumes:
- ./voting-app:/app
ports:
- "5000:80"
links:
- redis
networks:
- front-tier
- back-tier
result-app:
build: ./result-app/.
volumes:
- ./result-app:/app
ports:
- "5001:80"
links:
- db
networks:
- front-tier
- back-tier
worker:
build: ./worker
links:
- db
- redis
networks:
- back-tier
redis:
image: redis
ports: ["6379"]
networks:
- back-tier
db:
image: postgres:9.4
volumes:
- "db-data:/var/lib/postgresql/data"
networks:
- back-tier
volumes:
db-data:
networks:
front-tier:
back-tier:
环境是vmware funsion搭建的centos7虚拟机,之前的demo项目都能跑成功。老师这是什么问题导致的build失败?
写回答
1回答
-
掣风悬武
提问者
2020-03-31
找到了,是网络的问题环境不好导致mvn verify报错了,但是后面service构建好之后启动,报
result-app_1 | Failed to connect to db
的错误
012020-07-29
相似问题