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
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”
Check Out: Monitor Health of a Container
Run a below command with container id and a new name
docker rename df9aa4c8a099 centosimage
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