0

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?

Community
  • 1
  • 1
tk_
  • 16,415
  • 8
  • 80
  • 90

3 Answers3

3

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
Andy Shinn
  • 26,561
  • 8
  • 75
  • 93
1

On official docoments removing-tagged-images description:

If an image has more than one name, each of them needs to be removed before the image is removed.

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

docker images
docker rmi couchdb-cartridge:latset
eshizhan
  • 4,235
  • 2
  • 23
  • 23
0

All containers referencing that image must be stopped and removed.

docker ps -a

Will show all containers, running or stopped. Remove them first then the images should be able to be purged.

user2105103
  • 11,599
  • 2
  • 18
  • 11