Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of renaming the docker container

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report