本文主要是介绍Error response from daemon: Conflict. The container name /mysql is already in use by container,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Error response from daemon: Conflict. The container name "/mysql" is already in use by container
执行:
docker run --name mysql -p 3306:3306 -v /root/bo/data/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 -it wzj/mysqldocker: Error response from daemon: Conflict. The container name "/mysql" is already in use by container "3131fbf478c984cf393b65dde14342af4e3331f9f5641a4821b426cdca20abba". You have to remove (or rename) that container to be able to reuse that name.
- 1
- 2
- 3
- 4
- 5
解决办法:
查看 docker ps -a
看到之前运行docker容器还没有退出,导致出现容器重名情况。
使用下面命令,删除容器,
docker rm fb087642b497(镜像ID)
docker rm 7b739cc26085
- 1
- 2
执行: docker restart nginx
重启即可
这篇关于Error response from daemon: Conflict. The container name /mysql is already in use by container的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!