I created a local docker registry and then pull some of my docker images from docker hub and then push them to the local registry. Now I want to remove my local images. But the
You can use the command docker rmi IMAGE_NAME:TAG_NAME and it will work.
I just checked in the Docker docs and i think this is something also can be done
rmi
You can remove an image using its short or long ID, its tag, or its digest. If an image has one or more tag or digest reference, you must remove all of them before the image is removed.
so rather than using ID u can do something like this ---
$ docker rmi test1
Untagged: test1:latest
$ docker rmi test2
Untagged: test2:latest
Here is a way you could do this. Run the command:
docker images | grep 810001cb03af | awk '{print $1 ":" $2}' | xargs docker rmi
where 810001cb03af
is your image id.
There are multiple ways you can delete.
a) delete only one:
$ sudo docker rmi login(REPOSITORY NAME):latest(TAG NAME)
b) delete all with matching id with -f
command:
$ sudo docker rmi -f 91dfd8adbf04(IMAGE ID)
You should try removing images using digest,
$ docker images --digests
REPOSITORY TAG DIGEST IMAGE ID CREATED SIZE
localhost:5000/test/busybox <none> sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf 4986bf8c1536
$ docker rmi localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf
Untagged: localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf
Deleted: 4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125
Deleted: ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2
Deleted: df7546f9f060a2268024c8a230d8639878585defcc1bc6f79d2728a13957871b
Run the following command to remove multiple docker images with the same IMAGE ID.
sudo docker rmi -f **IMAGE ID**