In this tutorial, I show you how to rename a container in Docker.
For example, now, Docker in my machine is running a container as follows:
This is a container that is run from SonarQube’s Docker Image, when I ran it, I forgot to give it a name to make it easy to distinguish if I later run other Docker containers. Currently, its name is recursing_ardinghelli, I will rename it again using the following command:
1 |
docker rename <container_id> <new_name> |
For example, I changed the name of my container using the following command:
1 |
docker rename 45949b2cc114 SonarQube |
Result: