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
Background: During the development process, we of...
During the work development process, a requiremen...
When developing a website, you often need to use ...
Table of contents 1. Preparation 2. Deployment Pr...
During the project optimization today, MySQL had ...
Table of contents 01 Common Faults 1 02 Common Fa...
Linux is generally used as a server, and the serv...
Lottie is an open source animation library for iO...
mysql set to case insensitive Windows Go to the d...
Preface When it comes to database transactions, a...
Method 1: Use table attributes: header-cell-class...
Table of contents Tutorial Series 1. Backup strat...
Table of contents background Implementation ideas...
For work needs, I need to make a mobile phone adap...
First of all, we need to make it clear why we use...