Docker Community Forums

Share and learn in the Docker community.

Docker images list 2 images with identical REPOSITORY, TAG, IMAGE ID, CREATED, SIZE- why?

Hi All:

Newish to Docker.
CentOS Linux release 7.7.1908 (Core)
Docker version 19.03.8, build afacb8b

Running a Snipe-IT container.

Whenever i run:
docker images

I get 2 identical results:
[root@hostname]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
snipe/snipe-it latest 81cfb0c6e2ae 3 months ago 645MB
snipe/snipe-it latest 81cfb0c6e2ae 3 months ago 645MB
hello-world latest bf756fb1ae65 6 months ago 13.3kB
centos latest 0f3e07c0138f 9 months ago 220MB

Why are the first two images entirely identical in every category? Are they different? Same? How can I determine this? Which one is my active container using? How can I determine that?

[root@hostname]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b7a84163b51e snipe/snipe-it “/startup.sh” 7 weeks ago Up 47 minutes 443/tcp, 0.0.0.0:8082->80/tcp snipeit

Thanks!
-lerroot

well i ran
docker images prune -a
after firing up all my containers.

this worked:
[root@hostname/]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
snipe/snipe-it latest 81cfb0c6e2ae 3 months ago 645MB
centos latest 0f3e07c0138f 9 months ago 220MB

***BUT isn’t there a better way? Thanks for any input.

Yours,
lerroot

In your Dockefile, you used FROM ubuntu, so you just inherited the image and did nothing out of it. So the new image is nothing but the same as ubuntu image. And that is why you are seeing the same id

REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest ccc7a11d65b1 9 days ago 120 MB
ubuntu_ubuntu latest ccc7a11d65b1 9 days ago 120 MB
It doesn’t mean you have 240MB occupied from same two images. It just means that ubuntu and ubuntu_ubuntu point to the same image and that image size is 120 MB.

You can do below

docker tag ubuntu ubuntu_my
And it will create another entry with that name and same ID and Size. Name and Tag are just reference to the ID. Multiple names can point to Same ID.