docker : name is already in use by container

1. 运行 sudo docker run -d –name jenkins -p 8080:8080 jenkins
2. 电脑重新
3. 想重新开启docker jenkins
再次调用 sudo docker run -d –name jenkins -p 8080:8080 jenkins
提示:docker: Error response from daemon: Conflict. The container name “/jenkins” is already in use by container “eb4bca936d0c0047f1ac4ba0cfe3d97cad1d61575dc0697f6498d6ce38721e6d”. You have to remove (or rename) that container to be able to reuse that name.

4. 使用 sudo docker start eb4bca936d0c0047f1ac4ba0cfe3d97cad1d61575dc0697f6498d6ce38721e6d
就可以重新启动先前那个容器了
5. 同时可以 使用 sudo docker ps -a
see all containers in this case

参考:
1. https://stackoverflow.com/questions/31697828/docker-run-name-is-already-in-use-by-container [有用]

发表评论

电子邮件地址不会被公开。 必填项已用*标注