Options: --config string Location of client config files (default "/root/.docker") -D, --debug Enable debug mode --help Print usage -H, --host list Daemon socket(s) to connect to (default []) -l, --log-level string Set the logging level ("debug", "info", "warn", "error", "fatal") (default "info") --tls Use TLS; implied by --tlsverify --tlscacert string Trust certs signed only by this CA (default "/root/.docker/ca.pem") --tlscert string Path to TLS certificate file (default "/root/.docker/cert.pem") --tlskey string Path to TLS key file (default "/root/.docker/key.pem") --tlsverify Use TLS and verify the remote -v, --version Print version information and quit
Commands: attach Attach to a running container build Build an image from a Dockerfile # 从Dockerfile构建镜像 commit Create a new image from a container's changes cp Copy files/folders between a container and the local filesystem create Create a new container # 创建一个新的容器 diff Inspect changes on a container's filesystem events Get real time events from the server exec Run a command in a running container export Export a container's filesystem as a tar archive history Show the history of an image images List images # 列出所有镜像 import Import the contents from a tarball to create a filesystem image info Display system-wide information inspect Return low-level information on Docker objects kill Kill one or more running containers # 杀死一个或多个正在运行的容器 load Load an image from a tar archive or STDIN login Log in to a Docker registry logout Log out from a Docker registry logs Fetch the logs of a container # 获取容器的日志 pause Pause all processes within one or more containers # 暂停一个或多个容器中的所有进程 port List port mappings or a specific mapping for the container ps List containers # 列出所有容器 pull Pull an image or a repository from a registry push Push an image or a repository to a registry rename Rename a container # 重命名容器 restart Restart one or more containers # 重启一个或多个容器 rm Remove one or more containers # 删除一个或多个容器 rmi Remove one or more images # 删除一个或多个镜像 run Run a command in a new container # 在新容器中运行命令 save Save one or more images to a tar archive (streamed to STDOUT by default) search Search the Docker Hub for images start Start one or more stopped containers # 启动一个或多个停止的容器 stats Display a live stream of container(s) resource usage statistics stop Stop one or more running containers # 停止一个或多个正在运行的容器 tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE top Display the running processes of a container # 显示容器正在运行的进程 unpause Unpause all processes within one or more containers update Update configuration of one or more containers version Show the Docker version information wait Block until one or more containers stop, then print their exit codes
Run 'docker COMMAND --help' for more information on a command.
Options: -a, --all Show all images (default hides intermediate images) --digests Show digests -f, --filter filter Filter output based on conditions provided --format string Pretty-print images using a Go template --help Print usage --no-trunc Don't truncate output -q, --quiet Only show numeric IDs
[root@1674615372401 ~]# docker search hello INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED docker.io docker.io/hello-world Hello World! (an example of minimal Docker... 1962 [OK] docker.io docker.io/hello-seattle Hello from DockerCon 2016 (Seattle)! 13 [OK] docker.io docker.io/rancher/hello-world 4 docker.io docker.io/ibmcom/helloworld A sample used by IBM Cloud Code Engine 2 ...
Hello from Docker! This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.
To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/
For more examples and ideas, visit: https://docs.docker.com/get-started/
[root@1674615372401 ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 2b237156961b mysql "docker-entrypoint..." 2 minutes ago Up 2 minutes 0.0.0.0:3306->3306/tcp, 33060/tcp mysql-test a41e7e889a1a test:1.0 "java -Djava.secur..." 35 minutes ago Up 35 minutes 0.0.0.0:8080->8081/tcp springboot