docker-compose 报错多容器冲突

漏洞复现的时候,想开启漏洞环境,docker-compose结果报错了,了解到是多容器冲突的问题

报错内容如下:

WARNING: Found orphan containers (unacc_slave_1, unacc_master_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.
unacc_web_1 is up-to-date

image-20210918215140426

这里系统给出的解决方案是:–remove-orphans,但是这会把容器直接删除,显然也不太好

了解到:每个配置都有一个项目名称。如果提供 -p 标志,则可以指定项目名称。如果未指定标志,Compose 将使用当前目录名称。

使用如下命令来指定一个容器名

docker-compose -p xxx up -d

image-20210918220700361

打开容器这里指定的8086端口,可以成功打开该镜像环境。

image-20210918221008213

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐