docker问题解决:WARNING: Found orphan containers ** command with the --remove-orphans flag to clean it up.

问题:WARNING: Found orphan containers (image_zookeeper_1, image_kafka_1, image_jhipster-registry_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.

产生原因:

如果将docker-compose的镜像的配置放在同一个目录下时,docker运行时生成的镜像实例会有相同的前缀,就是当前的目录名,也就是说默认相同前缀的是同一组实例,当你在当前目录下还有别的镜像的配置文件,在运行时就会出现以下警告

解决:

1.在启动时重命名实例

docker-compose -p mysql -f /opt/docker/image/mysql-compose.yml up -d

2.将文件放在不同的目录下运行

 

posted @ 2020-08-06 10:58  雷诺2016  阅读(9828)  评论(0编辑  收藏  举报