Docker How to Change Repository Name or Rename Image?

Better Stack Team
Updated on August 1, 2022

Docker image

Docker image name and tag are just an alias to a docker image id that looks similar to this d583c3ac45fd. If you want to change the name, run the following command:

 
docker image tag old_name:tag new_name:tag

You can have as many tags to one image, as you want.

if you want to delete one of the names, use the following command:

 
docker rmi new_name

Since the d583c3ac45fd has many names, it will just remove the alias.

Docker container

Renaming the docker container is also very simple. To rename the docker container, run the following command:

 
ocker rename old_container_name new_container_name
Got an article suggestion? Let us know
Explore more
Licensed under CC-BY-NC-SA

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

We are hiring.

Software is our way of making the world a tiny bit better. We build tools for the makers of tomorrow.

Explore all positions →