docker-compose 常见问题

WARNING: Found orphan containers (toolbox-web) 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.

描述

多个yml文件在一个文件夹下,默认认为是一个项目,使用docker-compose -f movie-web.yml up --force-recreate --build -d 命令报出

目录
  • movie-web.yml
  • toolbox-web.yml

https://docs.docker.com/compose/reference/overview/

# 指定文件更新容器是
docker-compose -f movie-web.yml up --force-recreate --build -d
# 多个yml文件在一个文件夹下  默认认为是一个项目  警告报出
WARNING: Found orphan containers (toolbox-web) 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.

Recreating movie-web ... done
# 解决方法 -p movie 设置项目名 
docker-compose -f movie-web.yml -p movie up --force-recreate --build -d

Creating movie-web ... done
posted @ 2021-04-05 14:48  林一怂儿  阅读(384)  评论(0编辑  收藏  举报