Docker의 container 및 이미지 관련 명령

1089 단어
There is a difference between docker images and docker containers. Check this SO Question. In short, a container is a running instance of an image. which is why you cannot delete an image if there is a running container from that image. You just need to delete the container first.
Docker ps -a               # Lists containers (and tells you which images they are spun from)
Docker images              # Lists images  
Docker rm    # Removes a container

Docker rmi       # Removes an image 
                           # Will fail if there is a running instance of that image i.e. container

Docker rmi -f    # Forces removal of image even if it is referenced in multiple repositories, 
                           # i.e. same image id given multiple names/tags 
                           # Will still fail if there is a docker container referencing image


상세 정보:https://stackoverflow.com/questions/33907835/docker-error-cannot-delete-docker-container-conflict-unable-to-remove-reposito

좋은 웹페이지 즐겨찾기