Preface
This is zero basics Docker The second article in the series , In the last article This article takes you to quickly understand and start Docker I've explained to you what is Docker, How to install and use Docker The content of , And right Docker A simple comparison with virtual machine technology is given . In this article, we will strike while the iron is hot , The tasks to be completed are as follows :
- master Docker Common commands , Contains but is not limited to mirror commands , Container order , And some other commands that are commonly used
- Learn to use official documents to find the corresponding command instructions
- Learn to use the help command to find the corresponding command description
Affirming
Part of the content comes from online resources , If it infringes upon your rights and interests , Please contact the author to delete
Docker Common commands
Docker The official documents are very detailed , About all the command line instructions / standard , You can refer to https://docs.docker.com/reference/
We use docker images
Command as an example , It can be found that there are very detailed instructions in the official documents , For each command Introduction , usage , Expand the use of , Parameter options , Example … They are very complete .
In addition, we can also use the help command in the command line to let us know how to use different commands .
1、 Help order
docker version # Show docker Version information for .
docker info # Show docker System information , Including the number of mirrors and containers
docker command --help # Help order
2、 Mirror command
docker images # View images on all local hosts have access to docker image ls Instead of
docker search # Search mirroring
docker pull # Download mirroring docker image pull
docker rmi # delete mirror docker image rm
docker images View images on all local hosts
[[email protected] ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
portainer/portainer latest 62771b0b9b09 3 months ago 79.1MB
hello-world latest bf756fb1ae65 10 months ago 13.3kB
# explain
#REPOSITORY # The warehouse source of the mirror image
#TAG # Mirrored label ( edition ) ---lastest It means the latest version of
#IMAGE ID # mirrored id
#CREATED # Image creation time
#SIZE # Size of the image
# optional
Options:
-a, --all Show all images (default hides intermediate images) # List all images
-q, --quiet Only show numeric IDs # Show only the mirror image of id
[[email protected] ~]# docker images -a # List all mirror details
REPOSITORY TAG IMAGE ID CREATED SIZE
portainer/portainer latest 62771b0b9b09 3 months ago 79.1MB
hello-world latest bf756fb1ae65 10 months ago 13.3kB
[[email protected] ~]# docker images -aq # List all Mirrored id
62771b0b9b09
bf756fb1ae65
docker search Search mirroring
[[email protected] ~]# docker search mysql
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
mysql MySQL is a widely used, open-source relation… 10136 [OK]
mariadb MariaDB is a community-developed fork of MyS… 3733 [OK]
mysql/mysql-server Optimized MySQL Server Docker images. Create… 741 [OK]
percona Percona Server is a fork of the MySQL relati… 511 [OK]
centos/mysql-57-centos7 MySQL 5.7 SQL database server 84
mysql/mysql-cluster Experimental MySQL Cluster Docker images. Cr… 78
centurylink/mysql Image containing mysql. Optimized to be link… 60 [OK]
bitnami/mysql Bitnami MySQL Docker Image 46 [OK]
deitch/mysql-backup REPLACED! Please use http://hub.docker.com/r… 41 [OK]
tutum/mysql Base docker image to run a MySQL database se… 35
prom/mysqld-exporter 31 [OK]
databack/mysql-backup Back up mysql databases to... anywhere! 31
schickling/mysql-backup-s3 Backup MySQL to S3 (supports periodic backup… 29 [OK]
linuxserver/mysql A Mysql container, brought to you by LinuxSe… 26
centos/mysql-56-centos7 MySQL 5.6 SQL database server 20
circleci/mysql MySQL is a widely used, open-source relation… 19
mysql/mysql-router MySQL Router provides transparent routing be… 17
arey/mysql-client Run a MySQL client from a docker container 15 [OK]
fradelg/mysql-cron-backup MySQL/MariaDB database backup using cron tas… 10 [OK]
yloeffler/mysql-backup This image runs mysqldump to backup data usi… 7 [OK]
openshift/mysql-55-centos7 DEPRECATED: A Centos7 based MySQL v5.5 image… 6
devilbox/mysql Retagged MySQL, MariaDB and PerconaDB offici… 3
ansibleplaybookbundle/mysql-apb An APB which deploys RHSCL MySQL 2 [OK]
jelastic/mysql An image of the MySQL database server mainta… 1
widdpim/mysql-client Dockerized MySQL Client (5.7) including Curl… 1 [OK]
# optional , Filter through search , For example, if you want to search out the image collection STARS The number is larger than 3000 Of
# --filter=STARS=3000
Options:
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print search using a Go template
--limit int Max number of search results (default 25)
--no-trunc Don't truncate output
[[email protected] ~]# docker search mysql --filter=STARS=5000
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
mysql MySQL is a widely used, open-source relation… 10136 [OK]
docker pull Download mirroring
After being able to search , We can download the image .
# Download mirroring docker pull Mirror name [:tag]
[[email protected] ~]# docker pull mysql
Using default tag: latest # If you don't write tag, The default is latest
latest: Pulling from library/mysql # Layered download : docker image At the heart of Federated file system
bb79b6b2107f: Pull complete
49e22f6fb9f7: Pull complete
842b1255668c: Pull complete
9f48d1f43000: Pull complete
c693f0615bce: Pull complete
8a621b9dbed2: Pull complete
0807d32aef13: Pull complete
a56aca0feb17: Pull complete
de9d45fd0f07: Pull complete
1d68a49161cc: Pull complete
d16d318b774e: Pull complete
49e112c55976: Pull complete
Digest: sha256:8c17271df53ee3b843d6e16d46cff13f22c9c04d6982eb15a9a47bd5c9ac7e2d # Signature security
Status: Downloaded newer image for mysql:latest
docker.io/library/mysql:latest # Real address
# Equivalent to
docker pull mysql
docker pull docker.io/library/mysql:latest
# Specify the version to download
[[email protected] ~]# docker pull mysql:5.7
5.7: Pulling from library/mysql
bb79b6b2107f: Already exists
49e22f6fb9f7: Already exists
842b1255668c: Already exists
9f48d1f43000: Already exists
c693f0615bce: Already exists
8a621b9dbed2: Already exists
0807d32aef13: Already exists
f15d42f48bd9: Pull complete
098ceecc0c8d: Pull complete
b6fead9737bc: Pull complete
351d223d3d76: Pull complete
Digest: sha256:4d2b34e99c14edb99cdd95ddad4d9aa7ea3f2c4405ff0c3509a29dc40bcb10ef
Status: Downloaded newer image for mysql:5.7
docker.io/library/mysql:5.7
You can see that when there is a shared image ,docker You don't have to download it repeatedly , Great memory savings .
Waiting for download to complete , Let's check the host computer again docker The image file of .
You can find that the downloaded images are quite large , At this time, we can consider deleting some images .
docker rmi delete mirror
docker rmi -f Mirror image id # Delete the specified image
docker rmi -f Mirror image id Mirror image id Mirror image id # Delete multiple images
docker rmi -f $(docker images -aq) # Operation : Delete all mirrors , Recursive delete
[[email protected] ~]# docker rmi -f 1b12f2e9257b
Untagged: mysql:5.7
Untagged: [email protected]:4d2b34e99c14edb99cdd95ddad4d9aa7ea3f2c4405ff0c3509a29dc40bcb10ef
Deleted: sha256:1b12f2e9257be96da5c075f186dc371b18442b0f9281728ac64c9a69c6e0e264
Deleted: sha256:b21d85dcc43f7db4e532c3ca07e5adbc1e02beb37646b7079217ea2b1922af91
Deleted: sha256:603c9faa831d58a3f60eb377cd6246a281a97b906406a92bf3452726a6f15b69
Deleted: sha256:2d927a6eb4cc26ba5454193a3f4abf503b6cea710293d4f0e6d061c08578b687
Deleted: sha256:b96c2c2176ca7b5223469ad39c9e17509505233dd81030878bc12b03074baef4
...
3、 Container order
explain : We have a mirror image , To create a container . Next , We're going to download a centos Mirror to test learning .
[[email protected] ~]# docker pull centos
Using default tag: latest
latest: Pulling from library/centos
3c72a8ed6814: Pull complete
Digest: sha256:76d24f3ba3317fa945743bb3746fbaf3a0b752f10b10376960de01da70685fbd
Status: Downloaded newer image for centos:latest
docker.io/library/centos:latest
Create a new container and start
docker run [ Optional parameters ] image
# Parameter description
--name = “Name” Container name tomcat01 tomcat02, Used to distinguish containers
-d Running in background mode
-it Use interactive running , Enter the container to view the contents
-p Specify the port of the container -p 8080:8080
-p ip: Host port : Container port
-p Host port : Container port ( Commonly used )
-p Container port
( No addition -p, You can also add the container port directly )
-P( Capitalization ) Randomly assign ports
# test , Start and enter the container
[[email protected] /]# docker run -it centos /bin/bash
[[email protected] /]# ls # Check... In the container centos: Basic version , Many commands are incomplete !
bin etc lib lost+found mnt proc run srv tmp var
dev home lib64 media opt root sbin sys usr
# Return the host from the container
[[email protected] /]# exit
exit
[[email protected] /]# ls
bin dev home lib64 mnt proc run srv tmp var
boot etc lib media opt root sbin sys usr
List all running containers
# docker ps command List currently running containers
-a ,--all # List currently running containers + Bring out the container that history has run through
-n=?, --last int # List recently created ? A container ? by 1 Only the recently created container is listed , by 2 Then list 2 individual
-q, --quiet # List only the container number
[[email protected] /]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
fd5ea781f128 portainer/portainer "/portainer" 14 hours ago Up 14 hours 0.0.0.0:8088->9000/tcp charming_volhard
[[email protected] /]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e1ac54cd636a centos "/bin/bash" 5 minutes ago Exited (0) 4 minutes ago epic_engelbart
fd5ea781f128 portainer/portainer "/portainer" 14 hours ago Up 14 hours 0.0.0.0:8088->9000/tcp charming_volhard
ec6397ed87c8 bf756fb1ae65 "/hello" 17 hours ago Exited (0) 17 hours ago ecstatic_mestorf
1db69ebb5c34 bf756fb1ae65 "/hello" 17 hours ago Exited (0) 17 hours ago eager_lamport
a40257529012 bf756fb1ae65 "/hello" 22 hours ago Exited (0) 22 hours ago crazy_greider
Exit the container
exit # The container exits directly
ctrl +P +Q # The container does not stop exiting -- Be careful : This is a very useful operation
Delete container
docker rm Containers id # Delete the specified container , Cannot delete a running container , If you want to force deletion rm -rf
docker rm -f $(docker ps -aq) # Delete all containers
docker ps -a -q|xargs docker rm # Delete all containers
Start and stop the operation of the container
docker start Containers id # Start the container
docker restart Containers id # Restart container
docker stop Containers id # Stop the currently running container
docker kill Containers id # Force the current container to stop
4、 Other common commands
Background start container
# command docker run -d Mirror name
[[email protected] /]# docker run -d centos
c792b680e6250ba7c3892de771a7328baa936518cc35cd47eda0634419228dba
[[email protected] /]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
fd5ea781f128 portainer/portainer "/portainer" 15 hours ago Up 15 hours 0.0.0.0:8088->9000/tcp charming_volhard
# problem :docker ps: Find out centos Stopped.
# Common pit :docker The container runs in the background , There must be a foreground process ,docker Found no application , It will automatically stop
Check the log
docker logs --help
Options:
--details Show extra details provided to logs
* -f, --follow Follow log output
--since string Show logs since timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes)
* --tail string Number of lines to show from the end of the logs (default "all")
* -t, --timestamps Show timestamps
--until string Show logs before a timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes)
* ~ docker run -d centos /bin/sh -c "while true;do echo 6666;sleep 1;done" # Simulation log
# Show log
-tf # Display log information ( Keep updating )
--tail number # You need to display the number of log entries
docker logs -t --tail n Containers id # see n Line logs
docker logs -ft Containers id # Show all log logs
# function centos Containers
[[email protected] /]# docker run -it centos /bin/bash
# View all container operations
[[email protected] /]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
529d488fbb4b centos "/bin/bash" 50 seconds ago Up 50 seconds gracious_blackburn
4a0ba742b224 centos "/bin/bash" 20 minutes ago Exited (130) 19 minutes ago exciting_perlman
c792b680e625 centos "/bin/bash" 26 minutes ago Exited (0) 26 minutes ago nice_pike
# According to the container id, Check the latest 10 Logs
[[email protected] /]# docker logs -f -t --tail 10 529d488fbb4b
# Because we centos The container has not been operated yet , So maybe the log is empty
# We can write our own paragraph shell Script
[[email protected] /]# docker run -d centos /bin/sh -c "while true;do echo 6666;sleep 1;done"
# Check the log again
[[email protected] /]# docker logs -f -t --tail 10 492b2410a53f
2020-11-08T05:54:01.436376750Z 6666
2020-11-08T05:54:02.438071320Z 6666
2020-11-08T05:54:03.440787888Z 6666
2020-11-08T05:54:04.443239744Z 6666
...
# There will be a continuous stream of observations
View the process information in the container
# command docker top Containers id
[[email protected] /]# docker top 9a1f7b30a10a
UID PID PPID C STIME TTY TIME CMD
root 45074 45058 0 14:03 ? 00:00:00 /bin/bash
View the metadata information of the image
# command
docker inspect Containers id
# test
[[email protected] /]# docker inspect 9a1f7b30a10a
[
{
"Id": "9a1f7b30a10a33a36b7649e8f0992247c7767fccc2d253dfdf7a42b0c4cb1220",
"Created": "2020-11-08T06:03:48.598473909Z",
"Path": "/bin/bash",
"Args": [],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 45074,
"ExitCode": 0,
"Error": "",
"StartedAt": "2020-11-08T06:03:48.796392054Z",
"FinishedAt": "0001-01-01T00:00:00Z"
},
"Image": "sha256:0d120b6ccaa8c5e149176798b3501d4dd1885f961922497cd0abef155c869566",
"ResolvConfPath": "/var/lib/docker/containers/9a1f7b30a10a33a36b7649e8f0992247c7767fccc2d253dfdf7a42b0c4cb1220/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/9a1f7b30a10a33a36b7649e8f0992247c7767fccc2d253dfdf7a42b0c4cb1220/hostname",
"HostsPath": "/var/lib/docker/containers/9a1f7b30a10a33a36b7649e8f0992247c7767fccc2d253dfdf7a42b0c4cb1220/hosts",
"LogPath": "/var/lib/docker/containers/9a1f7b30a10a33a36b7649e8f0992247c7767fccc2d253dfdf7a42b0c4cb1220/9a1f7b30a10a33a36b7649e8f0992247c7767fccc2d253dfdf7a42b0c4cb1220-json.log",
"Name": "/jolly_mayer",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": null,
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {
}
},
"NetworkMode": "default",
"PortBindings": {
},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": null,
"CapDrop": null,
"Capabilities": null,
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "private",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"ConsoleSize": [
0,
0
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": [],
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": [],
"DeviceCgroupRules": null,
"DeviceRequests": null,
"KernelMemory": 0,
"KernelMemoryTCP": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": null,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": [
"/proc/asound",
"/proc/acpi",
"/proc/kcore",
"/proc/keys",
"/proc/latency_stats",
"/proc/timer_list",
"/proc/timer_stats",
"/proc/sched_debug",
"/proc/scsi",
"/sys/firmware"
],
"ReadonlyPaths": [
"/proc/bus",
"/proc/fs",
"/proc/irq",
"/proc/sys",
"/proc/sysrq-trigger"
]
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/e9101448258930021351001b2ad30349f485f11800752a56c174cbf7ca0e0057-init/diff:/var/lib/docker/overlay2/2ffe0b620bf852329f5b2c405efb84cd6bbb1abbd75879276b4bed0e1962effc/diff",
"MergedDir": "/var/lib/docker/overlay2/e9101448258930021351001b2ad30349f485f11800752a56c174cbf7ca0e0057/merged",
"UpperDir": "/var/lib/docker/overlay2/e9101448258930021351001b2ad30349f485f11800752a56c174cbf7ca0e0057/diff",
"WorkDir": "/var/lib/docker/overlay2/e9101448258930021351001b2ad30349f485f11800752a56c174cbf7ca0e0057/work"
},
"Name": "overlay2"
},
"Mounts": [],
"Config": {
"Hostname": "9a1f7b30a10a",
"Domainname": "",
"User": "",
"AttachStdin": true,
"AttachStdout": true,
"AttachStderr": true,
"Tty": true,
"OpenStdin": true,
"StdinOnce": true,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Cmd": [
"/bin/bash"
],
"Image": "centos",
"Volumes": null,
"WorkingDir": "",
"Entrypoint": null,
"OnBuild": null,
"Labels": {
"org.label-schema.build-date": "20200809",
"org.label-schema.license": "GPLv2",
"org.label-schema.name": "CentOS Base Image",
"org.label-schema.schema-version": "1.0",
"org.label-schema.vendor": "CentOS"
}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "f125e682faaca30a5ff2ea78298b6a63aa4b416de1a4150dc2271de55bb2bec5",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
},
"SandboxKey": "/var/run/docker/netns/f125e682faac",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "d49e14b7c195c2bb3d2ccad715cec0410d6b47e81fdec609296ac6ee84a47fb5",
"Gateway": "172.17.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:11:00:02",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "97d11e1f759394b549127015587527c5590965c6a66d0b1a5314dcf3b2ba626a",
"EndpointID": "d49e14b7c195c2bb3d2ccad715cec0410d6b47e81fdec609296ac6ee84a47fb5",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:00:02",
"DriverOpts": null
}
}
}
}
]
Enter the currently running container
# Mode one :
docker exec -it Containers id bashshell
# test
[[email protected] /]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9a1f7b30a10a centos "/bin/bash" 16 minutes ago Up 15 minutes jolly_mayer
[[email protected] /]# docker exec -it 9a1f7b30a10a /bin/bash
[[email protected] /]# ps -df
UID PID PPID C STIME TTY TIME CMD
root 32 19 0 06:19 pts/1 00:00:00 ps -df
[[email protected] /]# ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 06:03 pts/0 00:00:00 /bin/bash
root 19 0 0 06:18 pts/1 00:00:00 /bin/bash
root 33 19 0 06:19 pts/1 00:00:00 ps -ef
# Mode two :
docker attach Containers id
# test
[[email protected] /]# docker attach 9a1f7b30a10a
Executing code ....
# Command comparison
# docker exec # After entering the container, open a new terminal , It can be operated inside ( Commonly used )
# docker attach # Enter the terminal where the container is executing , No new process will be started
Copy from the container to the host
docker cp Containers id: Container path Host destination path
# Enter the running centos Inside of container
[[email protected] /]# docker attach 9a1f7b30a10a
# Create a new file , And exit the end container
[[email protected] /]# touch test.java
[[email protected] /]# exit
exit
# Look at the container that is running at this time
[[email protected] /]# docker ps
CONTAINER ID IMAGE COMMAND CREATED S
# See all container lists , As long as the container is still there , The data in the container can't be lost TATUS PORTS NAMES
[[email protected] /]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9a1f7b30a10a centos "/bin/bash" 46 minutes ago
# Execute the copy command , Copy the files in the container to the local machine
[[email protected] /]# docker cp 9a1f7b30a10a:/test.java /home
# You can view it locally from docker Files copied in the container
[[email protected] /]# ls /home
test.java
The copy here is actually a copy process , In the future we will use -v Volume technology , Can achieve , Automatic synchronization of local files within the container .
Summary
Docker There are actually a lot of orders from , We'd better put together a complete command line , If you need to query in the future , You can quickly get .
attach Attach local standard input, output, and error streams to a running container
# At present shell Next attach Connect the specified running image
build Build an image from a Dockerfile # adopt Dockerfile Custom image
commit Create a new image from a container's changes # Commit the current container as a new image
cp Copy files/folders between a container and the local filesystem # Copy files
create Create a new container # Create a new container
diff Inspect changes to files or directories on a container's filesystem # see docker Changes in containers
events Get real time events from the server # Get container real time from service
exec Run a command in a running container # Run the command on an existing container
export Export a container's filesystem as a tar archive # Export container file system as a tar The archive [ Corresponding import]
history Show the history of an image # Show a mirror formation history
images List images # List the current image of the system
import Import the contents from a tarball to create a filesystem image # from tar Package imports create a file system image
info Display system-wide information # Display system related information
inspect Return low-level information on Docker objects # View the container details
kill Kill one or more running containers # kill Appoint docker Containers
load Load an image from a tar archive or STDIN # From a tar Load a mirror image into a package or standard input [ Corresponding save]
login Log in to a Docker registry # Sign up or log in docker The source server
logout Log out from a Docker registry # From the current Docker registry sign out
logs Fetch the logs of a container # Output the current container log information
pause Pause all processes within one or more containers # Output the current container log information
port List port mappings or a specific mapping for the container # View the container internal source ports corresponding to the mapped ports
ps List containers # Make a list of containers
pull Pull an image or a repository from a registry # from docker The image source server extracts the specified image or image library
push Push an image or a repository to a registry # Pushes the specified image or library image to docker The source server
rename Rename a container # Rename the container
restart Restart one or more containers # Restart the running container
rm Remove one or more containers # Remove one or more containers
rmi Remove one or more images # Remove one or more mirrors [ No container can use this image to delete , Otherwise you need to delete the container to continue or -f Mandatory deletion ]
run Run a command in a new container # Create a new container and run a command
save Save one or more images to a tar archive (streamed to STDOUT by default) # Save a mirror image as one tar package [ Corresponding load]
search Search the Docker Hub for images # stay docker hub Search for images in
start Start one or more stopped containers # Start the container
stop Stop one or more running containers # Stop container
tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE # Label the image in the source
top Display the running processes of a container # View the process information running in the container
unpause Unpause all processes within one or more containers # Cancel pause container
update Update configuration of one or more containers # Update the configuration of one or more containers
version Show the Docker version information # see docker Version number
wait Block until one or more containers stop, then print their exit codes # Intercepts the exit status value when the container stops
Colored eggs
Fortunately, I have collected a copy made by Mr. Zhou Yang of Shangsi valley Docker Mind mapping , Friends who want to get source files , It can be in the official account 【 Ape man fungus 】 The background to reply “Docker Mind mapping ” Get it ~
Next up
The next article will bring you some information about Docker Deployment in China Nginx,Tomcat,ES+Kibana A tutorial for … Coming soon !
One key, three links , Develop habits ~
Articles are constantly updated , You can search through wechat 「 Ape man fungus 」 First time reading , Mind mapping , Big data books , Big data high frequency interview questions , A large number of first-line and large-scale factories face to face … Looking forward to your attention !