点击(此处)折叠或打开
- Usage: docker COMMAND
- docker命令用法
- A self-sufficient runtime for containers
- Options:
- --config string Location of client config files (default "/root/.docker")
- 客户端配置文件位置(默认"/root/.docker");
- -D, --debug Enable debug mode
- 启动调试模式;
- --help Print usage
- 使用帮助
- -H, --host list Daemon socket(s) to connect to
- 列出要连接到的守护进程sockets;
- -l, --log-level string Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info")
- 设置日志级别("调试"|"信息"|"警告"|"错误"|"致命"),默认为info;
- --tls Use TLS; implied by --tlsverify
- 使用TLS(Transport Layer Security,安全传输层协议);
- --tlscacert string Trust certs signed only by this CA (default "/root/.docker/ca.pem")
- 指定CA签署的信任证书;
- --tlscert string Path to TLS certificate file (default "/root/.docker/cert.pem")
- 指定TLS证书文件路径;
- --tlskey string Path to TLS key file (default "/root/.docker/key.pem")
- 指定TLS密钥文件路径;
- --tlsverify Use TLS and verify the remote
- 使用TLS并且远程认证;
- -v, --version Print version information and quit
- 打印版本信息;
- Management Commands:
- container Manage containers
- 容器管理
- image Manage images
- 镜像管理
- network Manage networks
- 网络管理
- node Manage Swarm nodes
- 集群节点管理
- plugin Manage plugins
- 插件管理
- secret Manage Docker secrets
- Docker敏感信息管理
- service Manage services
- 服务管理
- stack Manage Docker stacks
- Docker栈管理
- swarm Manage Swarm
- 集群管理
- system Manage Docker
- Docker管理
- volume Manage volumes
- 卷管理
- Commands:
- attach Attach local standard input, output, and error streams to a running container
- 连接本地一个正在运行的容器;
- *attach命令有时候并不方便。当多个窗口同时attach到同一个容器的时候,所有的窗口都会同步显示。当某个窗口因命令阻塞时,其它窗口也无法执行操作了。
- 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 to files or directories 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
- 导出一个容器
- history Show the history of an image
- 查看一个镜像的历史
- images List images
- 列出本地镜像
- import Import the contents from a tarball to create a filesystem image
- 从一个tar包中导入一个容器;
- info Display system-wide information
- 显示系统信息;
- inspect Return low-level information on Docker objects
- 查看Docker容器的详细信息;
- kill Kill one or more running containers
- Kill掉一个或者多个运行中的容器;
- load Load an image from a tar archive or STDIN
- 从tar包或者标准输入载入镜像;
- login Log in to a Docker registry
- 登录到Docker仓库;
- logout Log out from a Docker registry
- 登出Docker仓库;
- 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)
- 保存一个或多个镜像到tar包;
- search Search the Docker Hub for images
- 搜索Docker 公共仓库(Hub)中的镜像;
- 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
- 查看Docker版本信息;
- wait Block until one or more containers stop, then print their exit codes
- 阻塞运行直到容器停止,然后打印出它的退出代码。