티스토리 뷰

728x90
반응형

발생 시점 : 도커 컨테이너를 실행하기 위해 docker run 수행 시 발생

Error Case : The container name "/kuardtest" is already in use by container "8cc59b5bed38c16136334fbc4d23d.."
[root@kmkang ~]# docker run -d --name kuardtest --publish 8080:8880 nara0617/kuardnrson:20180910
docker: Error response from daemon: Conflict. The container name "/kuardtest" is already in use by container "8cc59b5bed38c16136334fbc4d23d..". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
[root@kmkang ~]#

문제 원인 : 이미 생성된 docker container name과 중복된 이름을 요청하였을 경우 발생

먼저 생성된 docker container를 확인합니다.
[root@kmkang ~]# docker  ps -a
CONTAINER ID        IMAGE                                COMMAND                  CREATED             STATUS                    PORTS                    NAMES
8cc59b5bed38        nara0617/kuardnrson:20180910         "/kuard"                 21 hours ago        Created                   0.0.0.0:8080->8880/tcp   kuardtest
543d8151f4c2        nara0617/kuardnrson:20180910         "/kuard"                 21 hours ago        Created                   0.0.0.0:8080->8080/tcp   kuard-amd64
3e2ffb87ad3b        nara0617/kuardnrson:20180910         "/kuard"                 21 hours ago        Created                   0.0.0.0:8080->8080/tcp   kuardnrson
92313fdaa3fc        nara0617/kuardnrson:20180910         "/kuard"                 21 hours ago        Created                   0.0.0.0:8080->8080/tcp   kuard
a6c748a863f0        kkm0716/wildfly:12.0.0.Final_First   "/opt/jboss/wildfly/…"   5 months ago        Exited (0) 5 months ago                            determined_pare
[root@kmkang ~]#
위에 볼딩 처리된 구문을 보면 추가하고자 했던 CONTAINER kuardtest가 이미 기동되어 있는것을 확인할 수 있습니다.

해결 방안 : docker container를 다시 생성하기 원할 경우 docker rm으로 제거합니다.

형식은 다음과 같습니다.
docker rm [docker container ID]
[root@kmkang ~]# docker rm 8cc59b5bed38
8cc59b5bed38
[root@kmkang ~]# docker  ps -a
CONTAINER ID        IMAGE                                COMMAND                  CREATED             STATUS                    PORTS                    NAMES
543d8151f4c2        nara0617/kuardnrson:20180910         "/kuard"                 21 hours ago        Created                   0.0.0.0:8080->8080/tcp   kuard-amd64
3e2ffb87ad3b        nara0617/kuardnrson:20180910         "/kuard"                 21 hours ago        Created                   0.0.0.0:8080->8080/tcp   kuardnrson
92313fdaa3fc        nara0617/kuardnrson:20180910         "/kuard"                 21 hours ago        Created                   0.0.0.0:8080->8080/tcp   kuard
a6c748a863f0        kkm0716/wildfly:12.0.0.Final_First   "/opt/jboss/wildfly/…"   5 months ago        Exited (0) 5 months ago                            determined_pare
[root@kmkang ~]#
이후 다시 docker run을 수행하면 정상적으로 기동됩니다.

728x90
반응형