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
This article example shares the specific code of ...
background A specific device is used to perform i...
In the case of complete separation of the front-e...
1. Software Download MySQL download and installat...
Table of contents Preface Front-end structure Bac...
Front-end is a tough job, not only because techno...
Table of contents 1. Create objects by literal va...
Table of contents 2. Tried methods 2.1 keep-alive...
clear:both is used to清除浮動This is the impression I...
Table of contents Preface Solution Tool Introduct...
1Several common character sets In MySQL, the most...
Front-end project packaging Find .env.production ...
1. Introduction Are you still leaving your websit...
Collapsed headers are a great solution for displa...
This article example shares the specific code of ...