In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "what are the common commands in the Docker container". In the daily operation, I believe many people have doubts about the common commands in the Docker container. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts about "what are the common commands in the Docker container?" Next, please follow the editor to study!
Introduction to Docker
Docker is software that runs on Linux and Windows to create, manage, and orchestrate containers. It is part of the Moby open source project developed on GitHub.
Command introduction 1) docker container run
The command to start the new container. The minimalist form of this command accepts mirrors and commands as parameters. The image is used to create the container, and the command is the application that you want the container to run.
The docker container run-it ubuntu / bin/bash command starts a Ubuntu container in the foreground and runs Bash Shell.
Ctrl-PQ breaks the link between the Shell and the container terminal and keeps the container running (UP) in the background after exiting.
2) docker container ls
Used to list all containers in the UP state. If you use the-a flag, you can also see the container in the Exited state.
3) docker container exec
Used to start a new process in a running container. This command is useful when connecting the Docker host Shell to a running container terminal.
The docker container exec-it bash command starts a Bash Shell process inside the container and connects to the Shell.
For this command to take effect, the image used to create the container must contain a Bash Shell.
4) docker container stop
This command stops the running container and sets the state to Exited (0).
This command does this by sending SIGTERM signals to processes in the container with a PID of 1.
If the process is not cleaned and stopped within 10 seconds, a SIGKILL signal is then sent to force the container to stop.
Docker container stop can take the container ID and the container name as parameters.
5) docker container start
Restart the container in the Exited state. You can specify the name of the container or ID in the docker container start command.
6) docker container rm
Delete containers that are not running. You can specify the container to be deleted by the container name or ID. It is recommended that you first use the docker container stop command to stop the container, and then use docker container rm to complete the deletion.
7) docker container inspect
Displays configuration details and runtime information for the container. This command takes the container name and container ID as the main parameters.
At this point, the study on "what commands are commonly used in Docker containers" 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.