问题:
docker: Error response from daemon: Conflict. The container name "/tomcat" is already in use by container "c83a06737e0213c8f29b209b0e107a72885fbf4ed77c0d4048b946c661d498b0". You have to remove (or rename) that container to be able to reuse that name.
解决办法:
docker ps -l
docker rm 镜像id
[root@localhost ~]# docker run -d -p 8080:8080 --name tomcat b8
docker: Error response from daemon: Conflict. The container name "/tomcat" is already in use by container "c83a06737e0213c8f29b209b0e107a72885fbf4ed77c0d4048b946c661d498b0". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
[root@localhost ~]# docker ps -l
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c83a06737e02 b8 "catalina.sh run" 11 minutes ago Created tomcat
[root@localhost ~]# docker rm c83a06737e02
c83a06737e02
[root@localhost ~]# docker ps -l
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
861655aef988 hello-world "/hello" 2 hours ago Exited (0) 2 hours ago confident_morse
[root@localhost ~]# docker rm 861655aef988
861655aef988
[root@localhost ~]# docker ps -l
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[root@localhost ~]#