1. Help Command1. View the current Docker version docker version 2. Display Docker system information, including images and container numbers docker info 3. View the help document, similar to the Man command of CentOS docker --help 2. Mirror command1. View the image on the local host: #List all local images (including intermediate image layers) docker images -a #Only display the image ID docker images -q #Show complete image information docker images --no-trunc 2. Search for images: https://hub.docker.com docker search [OPTIONS] image nameOPTIONS: --no-trunc: Display the complete image description -s: List images with a collection count not less than the specified value --automated: Only list images of the automated build type; 2. Download the image docker pull image name [:TAG] TAG: The default version is latest. 3. Delete the image #Delete a single docker rmi image name or ID docker rmi -f image ID #Batch delete docker rmi -f image name 1: TAG image name 2: TAG #Delete all images docker rmi -f $(docker images -qa) 3. Container Commands1. Create and start a container docker run [OPTIONS] IMAGE_NAME [COMMAND] [ARG...] OPTIONS Description 2. View all currently running containers docker ps [OPTIONS] OPTIONS Description 3. Exit the container exit The container stops and exits ctrl+P+Q The container does not stop and exits 4. Start the container docker start container ID or container name 5. Restart the container docker restart container ID or container name 6. Stop the container docker stop container ID or container name 7. Force stop the container docker kill container ID or container name 8. Delete the stopped container docker rm container ID #Delete multiple containers at once docker rm -f $(docker ps -a -q) 9. Enter the running container and interact with it from the command line Start a new process in the container and open the terminal docker exec -it container ID /bin/sh Directly enter the terminal of the container startup command, and no new process will be started docker attach container id 10. Copy files from the container to the host docker cp container ID: path in container destination host path 11. Copy files from the host to the container docker cp Host file or directory to be copied Container name: container file or directory 12. View the container mount directory docker inspect container_name docker inspect container_id This directory is the location of your container data volume 13. Related image startup commands RabbitMQ: docker run -d --hostname localhost --name rabbitmq -p 15672:15672 -p 5672:5672 rabbitmq:management This is the end of this article about Docker-Common Commands-Study03. For more information about Docker Common Commands Study03, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Example of implementing the skeleton screen of WeChat applet
Recently, I received a requirement for function ex...
Windows Server 2008 server automatically restarts...
Two methods to implement Mysql remote connection ...
The following three methods are commonly used to d...
This article shares the specific code of js to re...
Vue first screen performance optimization compone...
1. Overview MySQL version: 5.6.21 Download addres...
Current demand: There are two tables, group and f...
Technical Background Latex is an indispensable to...
ab command principle Apache's ab command simu...
Below, we introduce three ways to draw heart shap...
Copy code The code is as follows: <div class=&...
I have read a lot of knowledge and articles about...
Preface Recently, when working on a high-availabi...
Table of contents Overview Functionality and read...