How to rename Docker images without rebuilding them
I created a Docker image, but I forgot to name something, by default it has taken an unnamed name. Can anyone tell me how I can change the name of the Docker image?
You can rename your docker image by docker tag command. Use the below given command to do that.
$ docker tag OldName:tag NewName:tag
Or another way to rename docker container
To rename docker container, use the rename sub-command as shown, in the following example, we renaming the container discourse_app to a new name disc_app.
$ sudo docker rename discourse_app disc_app
After renaming a containers, confirm that it is now using the new name.
$ sudo docker ps