解决错误:Error response from daemon: Conflict. The container name “***” is already in use

在使用docker出现 Error response from daemon: Conflict. The container name “” is already in use。*

How to solve?

Method 1: Change the name of the container

For example, if your original container name is blog, you can replace it with demo-blog.

#docker run --name 容器名字 -d -p 端口映射 容器

docker run --name demo-blog -d -p 80:8080 blog:1.0

Method 2: Delete the original container

#查看正在运行的容器
docker ps -s

#删除指定的容器
docker rm 容器号

Either way, try it yourself.

Guess you like

Origin blog.csdn.net/hello_cmy/article/details/106322299