docker命令

asn@asn-vm:~/Desktop$ sudo docker images -h

Usage: docker images [OPTIONS] [REPOSITORY]

List images

docker images -a 显示所有镜像,包括中间镜像

-a, --all=false Show all images (default hides intermediate images)

docker images --digests 显示摘要

--digests=false Show digests

-f, --filter=[] Filter output based on conditions provided 基于提供的条件过滤输出结果

--help=false Print usage

--no-trunc=false Don't truncate output

-q, --quiet=false Only show numeric IDs

asn@asn-vm:~/Desktop$ sudo docker -h

Usage: docker [OPTIONS] COMMAND [arg...]

A self-sufficient runtime for linux containers.

Options:

--api-cors-header= Set CORS headers in the remote API

-b, --bridge= Attach containers to a network bridge

--bip= Specify network bridge IP

-D, --debug=false Enable debug mode

-d, --daemon=false Enable daemon mode

--default-gateway= Container default gateway IPv4 address

--default-gateway-v6= Container default gateway IPv6 address

--default-ulimit=[] Set default ulimits for containers

--dns=[] DNS server to use

--dns-search=[] DNS search domains to use

-e, --exec-driver=native Exec driver to use

--exec-opt=[] Set exec driver options

--exec-root=/var/run/docker Root of the Docker execdriver

--fixed-cidr= IPv4 subnet for fixed IPs

--fixed-cidr-v6= IPv6 subnet for fixed IPs

-G, --group=docker Group for the unix socket

-g, --graph=/var/lib/docker Root of the Docker runtime

-H, --host=[] Daemon socket(s) to connect to

-h, --help=false Print usage

--icc=true Enable inter-container communication

--insecure-registry=[] Enable insecure registry communication

--ip=0.0.0.0 Default IP when binding container ports

--ip-forward=true Enable net.ipv4.ip_forward

--ip-masq=true Enable IP masquerading

--iptables=true Enable addition of iptables rules

--ipv6=false Enable IPv6 networking

-l, --log-level=info Set the logging level

--label=[] Set key=value labels to the daemon

--log-driver=json-file Default driver for container logs

--log-opt=map[] Set log driver options

--mtu=0 Set the containers network MTU

-p, --pidfile=/var/run/docker.pid Path to use for daemon PID file

--registry-mirror=[] Preferred Docker registry mirror

-s, --storage-driver= Storage driver to use

--selinux-enabled=false Enable selinux support

--storage-opt=[] Set storage driver options

--tls=false Use TLS; implied by --tlsverify

--tlscacert=~/.docker/ca.pem Trust certs signed only by this CA

--tlscert=~/.docker/cert.pem Path to TLS certificate file

--tlskey=~/.docker/key.pem Path to TLS key file

--tlsverify=false Use TLS and verify the remote

--userland-proxy=true Use userland proxy for loopback traffic

-v, --version=false Print version information and quit

Commands:

attach Attach to a running container

build Build an image from a Dockerfile --- 从dockfile构建一个镜像

commit Create a new image from a container's changes --- 从容器的更改中创建一个新的镜像

cp Copy files/folders from a container's filesystem to the host path 从容器的文件系统中拷贝文件、文件夹到主机路径

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 Stream the contents of a container as a tar archive --- 把一个容器的内容作为一个tar包导出

history Show the history of an image

images List images --- 列出镜像

import Create a new filesystem image from the contents of a tarball

info Display system-wide information

inspect Return low-level information on a container or image

kill Kill a running container -- kill掉一个正在运行的容器

load Load an image from a tar archive -- 从tar包中加载一个镜像

login Register or log in to a Docker registry server -- 登录Docker注册表服务器

logout Log out from a Docker registry server --- 从Docker注册表服务器中注销

logs Fetch the logs of a container --- 获取一个容器的日志

pause Pause all processes within a container 在一个容器中,停掉所有的线程

port Lookup the public-facing port that is NAT-ed to PRIVATE_PORT 查询一个面向公众的端口(对应一个私有的端口)

ps List containers

pull Pull an image or a repository from a Docker registry server 从Docker注册服务器中拉取一个镜像

push Push an image or a repository to a Docker registry server -- 把一个镜像推送到Docker注册服务器中

rename Rename an existing container -- 重命名一个已有的容器

restart Restart a running container

rm Remove one or more containers -- 移除一个或多个容器

rmi Remove one or more images     -- 移除一个或多个镜像

run Run a command in a new container -- 在一个新容器中,运行一个命令

save Save an image to a tar archive -- 把镜像保持到一个tar文件包

search Search for an image on the Docker Hub --- 在DockerHub上搜索某个镜像

start Start a stopped container

stats Display a stream of a containers' resource usage statistics -- 显示一个容器资源的使用统计信息

stop Stop a running container

tag Tag an image into a repository --- 给一个镜像打标签,并放到库中

top Lookup the running processes of a container -- 查看一个容器正在运行的线程

unpause Unpause a paused container 对一个已暂停的容器解除暂停

version Show the Docker version information -- 显示Docker软件的版本

wait Block until a container stops, then print its exit code

Run 'docker COMMAND --help' for more information on a command.

原文地址:https://www.cnblogs.com/asnjudy/p/4636111.html