用法:docker [OPTIONS] 命令容器的自给自足运行时选项: --config string 客户端配置文件的位置(默认为“/root/.docker”)-c,——context string 用于连接守护进程的上下文名称 (覆盖DOCKER_HOST环境变量和默认上下文设置docker上下文使用)-D,——debug 开启调试模式-H,——host list 要连接的Daemon套接字-l,——log-level string 设置日志级别 ("debug"|"info"|"warn"|"error"|"fatal") (default "info") ——tls 使用TLS;暗示了——tlsverify ——tlscacert string 仅由该CA签名的信任证书(默认"/ 根/ .docker / ca.pem”) ——tlscert string TLS证书文件路径(默认"/ 根/ .docker / cert.pem”)TLS密钥文件路径(默认为“/root/.docker/key.pem”) ——tlsverify 使用TLS协议并验证远端-v,——version 打印版本信息并退出管理命令:app* Docker app (Docker Inc., v0.9.1-beta3)builder 施工管理buildx* Docker (Docker Inc., v0.7.1-docker)config 管理Docker配置container 容器管理的容器context 环境管理环境mage 镜像管理manifest 管理Docker图像清单和清单列表network 网络管理网络node 节点管理集群节点plugin 插件管理插件scan* Docker扫描(Docker Inc., v0.12.0)secret Docker的秘密service 管理服务stack 管理Docker栈swarm 群管理群system 系统管理码头工人trust 管理Docker映像的信任volume 卷管理卷命令:attach 将本地标准输入、输出和错误流附加到一个正在运行的容器build 从Dockerfile中构建一个映像commit 从容器的更改中创建一个新的映像cp 在容器和本地文件系统之间复制文件/文件夹create 创建一个新的容器diff 检查容器文件系统中文件或目录的更改events 从服务器获取实时事件exec 在正在运行的容器中运行命令export 将容器的文件系统导出为tar存档文件history 显示图像的历史images 镜像列表import 从tarball文件中导入内容以创建文件系统映像info 显示系统信息inspect 返回Docker对象的底层信息kill 杀死一个或多个正在运行的容器load 从tar文件或STDIN中加载图像login 登录Docker注册表logout 退出Docker注册表logs 获取容器的日志pause 暂停一个或多个容器中的所有进程port 列出端口映射或容器的特定映射ps 列表容器pull 从注册表中拉出一个图像或一个存储库push 镜像或存储库到注册表rename 重命名容器restart 重启一个或多个容器rm 删除一个或多个容器rmi 删除一个或多个镜像run 在新容器中运行命令save 保存一个或多个图像到tar存档文件(默认流到STDOUT)search 搜索Docker Hub的图片start 启动一个或多个已停止的容器stats 显示容器资源使用统计的实时流stop 停止一个或多个正在运行的容器tag 创建一个指向SOURCE_IMAGE的TARGET_IMAGE标签top 显示容器的运行进程unpause 取消暂停一个或多个容器中的所有进程update 更新一个或多个容器的配置version 显示Docker版本信息
Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]Run a command in a new containerOptions: --add-host list Add a custom host-to-IP mapping (host:ip) -a, --attach list Attach to STDIN, STDOUT or STDERR --blkio-weight uint16 Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0) --blkio-weight-device list Block IO weight (relative device weight) (default []) --cap-add list Add Linux capabilities --cap-drop list Drop Linux capabilities --cgroup-parent string Optional parent cgroup for the container --cgroupns string Cgroup namespace to use (host|private) 'host': Run the container in the Docker host's cgroup namespace 'private': Run the container in its own private cgroup namespace '': Use the cgroup namespace as configured by the default-cgroupns-mode option on the daemon (default) --cidfile string Write the container ID to the file --cpu-period int Limit CPU CFS (Completely Fair Scheduler) period --cpu-quota int Limit CPU CFS (Completely Fair Scheduler) quota --cpu-rt-period int Limit CPU real-time period in microseconds --cpu-rt-runtime int Limit CPU real-time runtime in microseconds -c, --cpu-shares int CPU shares (relative weight) --cpus decimal Number of CPUs --cpuset-cpus string CPUs in which to allow execution (0-3, 0,1) --cpuset-mems string MEMs in which to allow execution (0-3, 0,1) -d, --detach Run container in background and print container ID --detach-keys string Override the key sequence for detaching a container --device list Add a host device to the container --device-cgroup-rule list Add a rule to the cgroup allowed devices list --device-read-bps list Limit read rate (bytes per second) from a device (default []) --device-read-iops list Limit read rate (IO per second) from a device (default []) --device-write-bps list Limit write rate (bytes per second) to a device (default []) --device-write-iops list Limit write rate (IO per second) to a device (default []) --disable-content-trust Skip image verification (default true) --dns list Set custom DNS servers --dns-option list Set DNS options --dns-search list Set custom DNS search domains --domainname string Container NIS domain name --entrypoint string Overwrite the default ENTRYPOINT of the image -e, --env list Set environment variables --env-file list Read in a file of environment variables --expose list Expose a port or a range of ports --gpus gpu-request GPU devices to add to the container ('all' to pass all GPUs) --group-add list Add additional groups to join --health-cmd string Command to run to check health --health-interval duration Time between running the check (ms|s|m|h) (default 0s) --health-retries int Consecutive failures needed to report unhealthy --health-start-period duration Start period for the container to initialize before starting health-retries countdown (ms|s|m|h) (default 0s) --health-timeout duration Maximum time to allow one check to run (ms|s|m|h) (default 0s) --help Print usage -h, --hostname string Container host name --init Run an init inside the container that forwards signals and reaps processes -i, --interactive Keep STDIN open even if not attached --ip string IPv4 address (e.g., 172.30.100.104) --ip6 string IPv6 address (e.g., 2001:db8::33) --ipc string IPC mode to use --isolation string Container isolation technology --kernel-memory bytes Kernel memory limit -l, --label list Set meta data on a container --label-file list Read in a line delimited file of labels --link list Add link to another container --link-local-ip list Container IPv4/IPv6 link-local addresses --log-driver string Logging driver for the container --log-opt list Log driver options --mac-address string Container MAC address (e.g., 92:d0:c6:0a:29:33) -m, --memory bytes Memory limit --memory-reservation bytes Memory soft limit --memory-swap bytes Swap limit equal to memory plus swap: '-1' to enable unlimited swap --memory-swappiness int Tune container memory swappiness (0 to 100) (default -1) --mount mount Attach a filesystem mount to the container --name string Assign a name to the container --network network Connect a container to a network --network-alias list Add network-scoped alias for the container --no-healthcheck Disable any container-specified HEALTHCHECK --oom-kill-disable Disable OOM Killer --oom-score-adj int Tune host's OOM preferences (-1000 to 1000) --pid string PID namespace to use --pids-limit int Tune container pids limit (set -1 for unlimited) --platform string Set platform if server is multi-platform capable --privileged Give extended privileges to this container -p, --publish list Publish a container's port(s) to the host -P, --publish-all Publish all exposed ports to random ports --pull string Pull image before running ("always"|"missing"|"never") (default "missing") --read-only Mount the container's root filesystem as read only --restart string Restart policy to apply when a container exits (default "no") --rm Automatically remove the container when it exits --runtime string Runtime to use for this container --security-opt list Security Options --shm-size bytes Size of /dev/shm --sig-proxy Proxy received signals to the process (default true) --stop-signal string Signal to stop a container (default "SIGTERM") --stop-timeout int Timeout (in seconds) to stop a container --storage-opt list Storage driver options for the container --sysctl map Sysctl options (default map[]) --tmpfs list Mount a tmpfs directory -t, --tty Allocate a pseudo-TTY --ulimit ulimit Ulimit options (default []) -u, --user string Username or UID (format: <name|uid>[:<group|gid>]) --userns string User namespace to use --uts string UTS namespace to use -v, --volume list Bind mount a volume --volume-driver string Optional volume driver for the container --volumes-from list Mount volumes from the specified container(s) -w, --workdir string Working directory inside the container