当运行docker-compose up -d
一个之前已经运行了数周的项目时,我在构建容器时收到以下错误web
:
» |root| ‡ master * docker-compose up -d
Starting gateway_web_1
ERROR: for web Cannot start service web: updating the store state of sandbox failed: failed to update store for object type *libnetwork.sbState: json: cannot unmarshal string into Go struct field sbState.ExtDNS of type libnetwork.extDNSEntry
ERROR: Encountered errors while bringing up the project.
我已经重新启动了 Docker 服务,也重新安装了 Docker,但是仍然无法解决该错误,而且我已经没有地方可以查看了。
这是我的docker-compose.yml
version: '2'
services:
web:
build: ./docker-lemp
ports:
- 8080
networks:
- front-tier
- back-tier
volumes:
- ./public:/var/www
- ./default:/etc/nginx/sites-enabled/default
redis:
image: redis
ports:
- <public IP>:6379:6379
links:
- web
networks:
- back-tier
- front-tier
lb:
image: dockercloud/haproxy
ports:
- <public IP>:443:443
- <public IP>:80:80
links:
- web
networks:
- front-tier
- back-tier
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./haproxy/haproxy.cfg:/etc/haproxy/haproxy.cfg
environment:
<SSL stuff>
networks:
front-tier:
driver: bridge
back-tier:
driver: bridge
谢谢!
答案1
通过删除 Docker 数据存储区解决了这个问题,使用rm -rf /var/lib/docker
。然后重新启动 Docker(重新创建数据存储)后,问题得到解决,Docker 再次能够创建和启动容器。