Docker InspectEstimated reading Time:2 minutes
Description
Return low-level information on Docker objects Usage
Docker inspect [OPTIONS] name|id [name|id ...]
Options
Name, Shorthand
Default
Description
--format, F
Format the output using the given go template
--size, S
False
Display Total Fil
If you are familiar with Git and GitHub, you can make an analogy with Docker, making it easier to understand Docker and Docker Hub and the relationship between crossing.1. Docker versionDisplays the Docker version information.2. Docker
)Displays the history of an image.
Docker-images (1)List existing images
Docker-import (1)Import a tar package to create an image
Docker-info (1)Displays related system information.
Docker-inspect (1)Displays the underlying details of a container.
installation and basic commands for Docker
first, the installation of Docker
Here only the CentOS system installation docker, operating system kernel version requirements above 3.10 and must be 64 bits, generally centos 6.5 or above, if not sure, you can view the kernel version, typing command
Uname-r
Yum installat
Docker Command QueryBasic syntaxDocker [OPTIONS] COMMAND [arg ...]In general, Docker commands can be used to manage daemon, or to manage images and containers through CLI commands. You can man docker view these commands by.Options
(LI NK is external) Docker logs command-gets the container's log (link is external) Docker Pause command-suspends all processes in the container (link is external) Docker Port command Port forwarding ( Link is external)
Docker official to provide users with a quick understanding of Docker provides an interactive tutorial designed to help users learn how to use the Docker command line. Docker command line
The following is a brief introduction to t
-time
Example: ctop -- columns = name, owner, type, memory
'Ctop -- column 'output
-Sort-col =-sort by specified column. Cpu-user sorting by default
Example: ctop -- sort-col = blkio
If there are additional containers supported by Docker and LXC, the tracking options are also available:
Press 'a'-connect to terminal output
Press 'e'-open a shell in the container
Press's-Stop container (SIGTERM)
Press
package docker-history (1) display the history of an image docker-images (1) list existing imagedocker-import (1) import a tar package to create an imagedocker-info (1). Some Related System Information docker-inspect (1) is displayed. Docker-kill (1) close a running contain
true; do Echo Docker,hello world; Sleep 2;
This long string is called the container ID. It is the unique identifier of the container, so we can use it to manipulate containers, such as viewing logs, stopping or deleting containers, and so on.
Dock Logs 179fc7f17c358834364d
And why use a dead loop to output it?
Because if it's not a dead loop,
运行hello world!
Docker run learn/tutorial apt-get install-y ping# Installing a new program in a container
Save Image
First use the Docker ps-l command to obtain the ID of the container after the ping command is installed. Then save this image as learn/ping.Tips:1. Run Docker
mirrors
Docker Pull Learn/tutorial #下载镜像
Docker run learn/tutorial echo "Hello word" #在docker容器中运行hello world!
Docker run learn/tutorial apt-get install-y ping# Install a new program in the container
Save Mirror
First use the Docker ps-l
中运行hello world!Docker run learn/tutorial apt-get install-y ping# Installing a new program in a containerSave ImageFirst use the Docker ps-l command to obtain the ID of the container after the ping command is installed. Then save this image as learn/ping.Tips:1. Run Docker co
).
The Docker Daemon provides the REST API. Many tools (Docker command line, Docker compose, etc.) can interact with the Docker daemon through the REST API , such as creating containers, building mirrors, and so on.
The
container3失败docker attach container2ping contianer3 # 访问失败 In a multi-host network environment, an error occurs when a container is connected to the network with the removed container name. container already connected to networkThe new container needs to be forcibly removed docker rm -f , rerun, and connected to the network.Removing a network requires that all container
The Docker Run command is used to run a new container, and starting a container requires a lot of information, so there are a lot of parameters to this command, and the parameters supported by the command are analyzed in detail today.
First look at the format of the command:
currently running containers $ Docker PS # List all containers $ Docker ps-a # list the last boot container $ docker ps-l # View container information $
-i BusyBox Cat
Container identification
Name (--name)
You can name the container in three ways:
1. Use the UUID name ("f78375b1c487e03c9438c729345e54db9d20cfa2ac1fc3494b6eb60872e74778")
2. Use the UUID Short command ("f78375b1c487")
3. Use name ("Evil_ptolemy")
This UUID indicator is generated by Docker Deamon. If you do not specify--name when you execute
DockerDocker containers can be run multiple times after a buildDcoker vs. virtual machines: Usually we are running Linux on the system, Linux virtualization on the systems, running various applications in the virtual host, and the virtual machines are completely isolated, while Docker is running Linux on the hardware level and doing Docker on the system. Engine,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.