change container name

How To Change Docker Container Name In Linux

If you want to know how to change the docker container So it can be possible with a single command. It’s always a good idea of giving a name to a container it helps you to remember for what you have created the image. we can change and rename the docker container name.

I have already created a container in the previous article you may find here Create Container

Check Out: How To Create Swap file Without Disk Partition On Linux

Most the companies are moving on Docker Technologies to reduce the IT infrastructure cost and applications running on small containers.

Now there are only 2 container running I’m going to use the “con“ container to rename it with “centosimage

docker ps

how to change docker

Check Out:  Monitor Health of a Container

Run a below command with container id and a new name

docker rename df9aa4c8a099 centosimage

docker container name

Verify here  

docker ps

You may also go inside the container using attach and check the version of Centos image.

Check Out: Create Apache Image Using Dockerfile

docker attach df9aa4c8a099

cat /etc/redhat-release

YouTube Link: Rename Docker Container

You’re done change container name docker rename change

Rate this article

Leave a Reply

Notify of