Search code examples
ubuntudockerwso2-stratos

Failing to delete Docker's images after terminating the container


Im new to docker. I created a container and deployed some images below.

stratos@Dev-PC:/media/sf_docker_vm/couchdb-cartridge$ docker images
REPOSITORY                             TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
10.0.2.15:5042/couchdb-cartridge       latest              1bbc29d7cf4a        41 hours ago        785.2 MB
couchdb-cartridge                      latest              1bbc29d7cf4a        41 hours ago        785.2 MB
192.168.57.30:5042/couchdb-cartridge   latest              1bbc29d7cf4a        41 hours ago        785.2 MB
192.168.57.30:5042/tomcat-cartridge    latest              a25a79ecc37f        3 weeks ago         463.4 MB
tomcat-cartridge                       latest              a25a79ecc37f        3 weeks ago         463.4 MB
192.168.57.30:5042/mysql-cartridge     latest              ab1dac84c735        3 weeks ago         802 MB
mysql-cartridge                        latest              ab1dac84c735        3 weeks ago         802 MB
192.168.57.30:5042/php-cartridge       latest              809d2a1ebaf0        3 weeks ago         668.3 MB
php-cartridge                          latest              809d2a1ebaf0        3 weeks ago         668.3 MB
docker-registry                        latest              a158e64ae76a        5 weeks ago         596.2 MB
docker-busybox                         latest              2eb418e07fd5        5 weeks ago         4.964 MB
10.0.2.15:5042/docker-busybox          latest              2eb418e07fd5        5 weeks ago         4.964 MB
ubuntu                                 12.04               822a01ae9a15        6 weeks ago         108.1 MB

I wanted to remove 1bbc29d7cf4a image and it want let me to delete it saying:

stratos@Dev-PC:/media/sf_docker_vm/couchdb-cartridge$ docker rmi 1bbc29d7cf4a
Error: Conflict, cannot delete image 1bbc29d7cf4a because it is tagged in multiple repositories
2014/09/26 12:38:50 Error: failed to remove one or more images

Some how i follow this question and still im getting above error. Bellow is the steps i follow.

docker ps
docker stop <containerid>
docker rm <containerid>
docker rmi <imageid>

can someone help me to delete this images?


Solution

  • The reason is right in the error message:

    cannot delete image 1bbc29d7cf4a because it is tagged in multiple repositories
    

    Delete using the tags:

    docker rmi 192.168.57.30:5042/couchdb-cartridge 10.0.2.15:5042/couchdb-cartridge couchdb-cartridge
    

    Or just specify -f in the rmi command:

    docker rmi -f 1bbc29d7cf4a