The method of renaming the docker container
What is the method of renaming the docker container? When you create a docker container, each container is automatically assigned a universal unique identifier (UUID) number to avoid naming conflicts. We can also name the container ourselves.
If no name is specified, by default, the Docker daemon assigns a UUID long identifier to the container, which generates a random string as the name.
Name the Docker container
When using the-name flag, you can assign unforgettable names to the docker container when you run them. The-d flag tells docker to run the container in detached mode in the background and print the new container ID.
$sudo docker run-d-name discourse_app local_discourse/app
To view a list of all docker containers, run the following command.
$sudo docker ps
From now on, every command that uses container_id can now be used with the name you specify.
$sudo docker restart discourse_app$ sudo docker stop discourse_app$ sudo docker start discourse_app
If you want to rename the docker container, use the name subcommand.
Container cloud products are implemented by deploying container services on cluster servers through docker technology. They are powerful and easy to use, and can be used as cluster services. Private networks can be built freely and service clusters can be built easily.