In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how docker runs the container". In the daily operation, I believe many people have doubts about how docker runs the container. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how docker runs the container". Next, please follow the editor to study!
There is more than one way to run a docker container. You usually use the docker run command to create a container. Here are two examples.
1. Run the container command:
Docker run-- name container-name:tag-d image-name
-name: custom container name. If not specified, docker will automatically generate a name.
-d: indicates that the container is running in the background
Image-name: specify the name of the running image and Tag
If the docker.io/tomcat image is started successfully, the prefix docker.io can be left unwritten, and the following tag version number should be specified. You can use the docker ps command to view the container
2. The most basic running format of the command: sudo docker run-I-t image name command code
Sudo docker run-I-t ubuntu / bin/bash
Analyze this command:
First, we execute the docker run command for Docker. In addition, we specify two parameters,-I and-t.
The-I parameter is enabled by setting the STDIN in the container.
The-t parameter indicates that a pseudo tty terminal is assigned to the created container.
Usually the-I and-t parameters are used together, or you can write-it.
Next, we can see that ubuntu is entered on the command line. It tells Docker which image to use to create the container. After we specify an image, Docker will first check whether the image exists locally. If the image is not found, it will first connect to the officially maintained Docker Hub Registry to find and download it.
The final / bin/bash specifies the commands that the container needs to run. After the command completes, you will see that the shell in the container has been performed:
Root@41225bc38698:/#
At this point, the study on "how docker runs the container" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.