How To Change Docker Container Name Using Command 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

How To Change Docker Container Name In Linux:

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

Now there are only 2 containers 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

Share on:

I'm the founder of Curious Viral. I hope this blog will provide you complete information about Linux Technology & I would like to share my technical knowledge with you which I have learned during this period.

Other Posts You May Like...

Leave a comment