프로세스 확인
root@coforward:/home/coforward# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3ba9c2cde7fb hello-world "/hello" 15 seconds ago Exited (0) 13 seconds ago happy_khayyam
0b508f68aea2 ubuntu "/bin/bash" 44 minutes ago Up 30 minutes youthful_tharp
docker 이미지 삭제
root@coforward:/home/coforward# docker rmi hello-world
Error response from daemon: conflict: unable to remove repository reference "hello-world" (must force) - container 3ba9c2cde7fb is using its referenced image 9c7a54a9a43c
컨테이너ID 3ba9c2cde7fb 가, 이미지ID 9c7a54a9a43c 을 참조중이어서 삭제가 불가능
docker 이미지 강제 삭제
docker rmi -f [IMAGE]
root@coforward:/home/coforward# docker rmi -f hello-world
Untagged: hello-world:latest
Untagged: hello-world@sha256:926fac19d22aa2d60f1a276b66a20eb765fbeea2db5dbdaafeb456ad8ce81598
Deleted: sha256:9c7a54a9a43cca047013b82af109fe963fde787f63f9e016fdc3384500c2823d
root@coforward:/home/coforward#
또는 이미지명 삭제
docker container rm [NAMES]
root@coforward:/home/coforward# docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3ba9c2cde7fb 9c7a54a9a43c "/hello" 3 minutes ago Exited (0) 3 minutes ago happy_khayyam
0b508f68aea2 ubuntu "/bin/bash" 47 minutes ago Up 33 minutes youthful_tharp
root@coforward:/home/coforward# docker container rm happy_khayyam
happy_khayyam
root@coforward:/home/coforward# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0b508f68aea2 ubuntu "/bin/bash" 50 minutes ago Up 36 minutes youthful_tharp
'Docker' 카테고리의 다른 글
docker image를 tar 파일 save / load(화일 다운로드) (0) | 2023.10.05 |
---|---|
Docker 이미지 생성후 컨테이너 생성 (0) | 2023.08.07 |
Docker Pull을 이용해 도커 이미지 갖고 오기 (0) | 2023.08.07 |
Docker 사용법 (0) | 2021.11.04 |