Often there are tags with images when they are pulled. If you want to rename that tag, all you need to do is the following steps.
- Pull the image
- Re-tag the image using docker tag imagename:current_tag imagename:new_tag
- docker rmi image:current_tag
When you re-tag, it will leave you with two different images with different tags and we need to get rid of the old one using step3.
An example given below
- Pull the image
[abc@host ~]$ sudo docker pull busybox:old
musl: Pulling from library/busybox
2bafa357a9a5: Pull complete
Digest: sha256:658f4fcf74879ed5a01bf310d018099413f3b2588c1565ac54c85253ba3fc6d4
Status: Downloaded newer image for busybox:old
docker.io/library/busybox:old - Verify the image
[abc@host ~]$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
busybox ...
Recent Comments