摘要:查看當(dāng)前的版本信息查看幫助信息使用過程中可以使用提供的幫助功能查看命令的用法與相關(guān)信息。舉例說明想要查看命令的使用方法和參數(shù)含義。
查看當(dāng)前Docker的版本信息;
root@willem:~# docker version Client: Version: 1.11.1 API version: 1.23 Go version: go1.5.4 Git commit: 5604cbe Built: Tue Apr 26 23:30:23 2016 OS/Arch: linux/amd64 Server: Version: 1.11.1 API version: 1.23 Go version: go1.5.4 Git commit: 5604cbe Built: Tue Apr 26 23:30:23 2016 OS/Arch: linux/amd64
查看Docker幫助信息;
使用過程中可以使用Docker提供的幫助功能查看命令的用法與相關(guān)信息。
docker --help
Docker基本語法;
Usage: docker [OPTIONS] COMMAND [arg...] docker daemon [ --help | ... ] docker [ --help | -v | --version ] A self-sufficient runtime for containers.
選項(xiàng);
Options: # 指定Docker客戶端配置文件的路徑; --config=~/.docker Location of client config files # 是否使用Debug模式,默認(rèn)為false; -D, --debug Enable debug mode # 在daemon模式下綁定的socket,通過一個(gè)或多個(gè) tcp://host:port, unix:///path/to/socket, fd://* or fd://socketfd來指定; -H, --host=[] Daemon socket(s) to connect to # 查看幫助信息,-h 和 --help 是一樣的; -h, --help Print usage # 設(shè)置日志等級,-l 和 --log-level 是一樣的; -l, --log-level=info Set the logging level # 是否開啟tls,默認(rèn)為false; --tls Use TLS; implied by --tlsverify # 指定CA(Certificate Authority認(rèn)證授權(quán)機(jī)構(gòu))簽名的信任證書的路徑; --tlscacert=~/.docker/ca.pem Trust certs signed only by this CA # 指定TLS證書文件的路徑; --tlscert=~/.docker/cert.pem Path to TLS certificate file # 指定TLS公鑰文件的路徑; --tlskey=~/.docker/key.pem Path to TLS key file # 使用TLS并驗(yàn)證遠(yuǎn)程控制主機(jī); --tlsverify Use TLS and verify the remote # 輸出Docker的版本信息(簡略)并退出 -v, --version Print version information and quit
命令;
Commands: # 依附到一個(gè)正在運(yùn)行的容器中; attach Attach to a running container # 依據(jù)Dockerfile文件構(gòu)建鏡像; build Build an image from a Dockerfile # 在容器中將容器構(gòu)建為一個(gè)新的鏡像; commit Create a new image from a container"s changes # 在容器和宿主機(jī)之間拷貝文件/文件夾; cp Copy files/folders between a container and the local filesystem # 創(chuàng)建容器; create Create a new container # 檢查一個(gè)容器的文件系統(tǒng)的變更; diff Inspect changes on a container"s filesystem # 從服務(wù)端獲取實(shí)時(shí)的事件; events Get real time events from the server # 在運(yùn)行的容器中執(zhí)行命令; exec Run a command in a running container # 將一個(gè)容器的文件系統(tǒng)導(dǎo)出為一個(gè)tar包; export Export a container"s filesystem as a tar archive # 顯示一個(gè)鏡像的構(gòu)建歷史信息(鏡像的構(gòu)建步驟記錄-類似Dockerfile); history Show the history of an image # 查詢鏡像列表; images List images # 從tarball導(dǎo)入內(nèi)容創(chuàng)建一個(gè)文件系統(tǒng)映像; import Import the contents from a tarball to create a filesystem image # 顯示整個(gè)系統(tǒng)的信息; info Display system-wide information # 獲取容器或鏡像的低級信息; inspect Return low-level information on a container or image # 關(guān)閉一個(gè)正在運(yùn)行的容器(包括進(jìn)程和所有相關(guān)資源); kill Kill a running container # 從一個(gè)tar包或STDIN中加載一個(gè)鏡像; load Load an image from a tar archive or STDIN # 登陸Docker注冊服務(wù)器(上傳鏡像需要先登錄); login Log in to a Docker registry # 登出Docker注冊服務(wù)器(注銷); logout Log out from a Docker registry # 獲取一個(gè)容器的日志信息; logs Fetch the logs of a container # 管理容器的網(wǎng)絡(luò)配置; network Manage Docker networks # 暫停一個(gè)容器內(nèi)的所有進(jìn)程; pause Pause all processes within a container # 列出一個(gè)容器的端口映射或一個(gè)特定映射的信息; port List port mappings or a specific mapping for the CONTAINER # 列出所有的容器; ps List containers # 從注冊服務(wù)器的倉庫中拉取一個(gè)鏡像; pull Pull an image or a repository from a registry # 向注冊服務(wù)器的倉庫中上傳一個(gè)鏡像; push Push an image or a repository to a registry # 將一個(gè)容器重命名; rename Rename a container # 重啟一個(gè)容器; restart Restart a container # 刪除一個(gè)或多個(gè)容器; rm Remove one or more containers # 刪除一個(gè)或多個(gè)鏡像; rmi Remove one or more images # 在一個(gè)新的容器中運(yùn)行一個(gè)命令; run Run a command in a new container # 將一個(gè)或多個(gè)鏡像保存為一個(gè)tar包; save Save one or more images to a tar archive # 在Docker Hub中搜索鏡像; search Search the Docker Hub for images # 啟動(dòng)一個(gè)或多個(gè)暫停的容器; start Start one or more stopped containers # 動(dòng)態(tài)顯示容器資源的使用情況;例如“docker stats 8981”信息如下: # CONTAINER CPU % MEM USAGE/LIMIT MEM % NET I/O BLOCK I/O PIDS # 8981 0.00% 3.551MB/4.145GB 0.09% 509.6kB/14.15MB 2.028MB/0 B 0 stats Display a live stream of container(s) resource usage statistics # 停止一個(gè)正在運(yùn)行的容器; stop Stop a running container # 修改本地倉庫中鏡像的標(biāo)簽; tag Tag an image into a repository # 顯示一個(gè)容器中正在運(yùn)行的進(jìn)程; top Display the running processes of a container # 解除一個(gè)容器中所有進(jìn)程的暫停狀態(tài); unpause Unpause all processes within a container # 更新一個(gè)或多個(gè)容器的配置; update Update configuration of one or more containers # 顯示Docker的版本信息(詳細(xì)) version Show the Docker version information # 管理Docker的數(shù)據(jù)卷; volume Manage Docker volumes # 阻塞,直到一個(gè)容器停止,然后輸出它的退出代碼 wait Block until a container stops, then print its exit code # 運(yùn)行“docker COMMAND --help”獲取更多的指令信息,如指令的用途與參數(shù)的詳細(xì)解釋。 Run "docker COMMAND --help" for more information on a command.
舉例說明;
想要查看run命令的使用方法和參數(shù)含義-“docker run --help”。
docker run --help
返回信息-run命令的用法說明;
Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...] Run a command in a new container
返回信息-run命令的參數(shù)說明;
-a, --attach=[] Attach to STDIN, STDOUT or STDERR --add-host=[] Add a custom host-to-IP mapping (host:ip) --blkio-weight Block IO (relative weight), between 10 and 1000 --blkio-weight-device=[] Block IO weight (relative device weight) --cpu-shares CPU shares (relative weight) --cap-add=[] Add Linux capabilities --cap-drop=[] Drop Linux capabilities --cgroup-parent Optional parent cgroup for the container --cidfile Write the container ID to the file --cpu-period Limit CPU CFS (Completely Fair Scheduler) period --cpu-quota Limit CPU CFS (Completely Fair Scheduler) quota --cpuset-cpus CPUs in which to allow execution (0-3, 0,1) --cpuset-mems MEMs in which to allow execution (0-3, 0,1) -d, --detach Run container in background and print container ID --detach-keys Override the key sequence for detaching a container --device=[] Add a host device to the container --device-read-bps=[] Limit read rate (bytes per second) from a device --device-read-iops=[] Limit read rate (IO per second) from a device --device-write-bps=[] Limit write rate (bytes per second) to a device --device-write-iops=[] Limit write rate (IO per second) to a device --disable-content-trust=true Skip image verification --dns=[] Set custom DNS servers --dns-opt=[] Set DNS options --dns-search=[] Set custom DNS search domains -e, --env=[] Set environment variables --entrypoint Overwrite the default ENTRYPOINT of the image --env-file=[] Read in a file of environment variables --expose=[] Expose a port or a range of ports --group-add=[] Add additional groups to join -h, --hostname Container host name --help Print usage -i, --interactive Keep STDIN open even if not attached --ip Container IPv4 address (e.g. 172.30.100.104) --ip6 Container IPv6 address (e.g. 2001:db8::33) --ipc IPC namespace to use --isolation Container isolation technology --kernel-memory Kernel memory limit -l, --label=[] Set meta data on a container --label-file=[] Read in a line delimited file of labels --link=[] Add link to another container --log-driver Logging driver for container --log-opt=[] Log driver options -m, --memory Memory limit --mac-address Container MAC address (e.g. 92:d0:c6:0a:29:33) --memory-reservation Memory soft limit --memory-swap Swap limit equal to memory plus swap: "-1" to enable unlimited swap --memory-swappiness=-1 Tune container memory swappiness (0 to 100) --name Assign a name to the container --net=default Connect a container to a network --net-alias=[] Add network-scoped alias for the container --oom-kill-disable Disable OOM Killer --oom-score-adj Tune host"s OOM preferences (-1000 to 1000) -P, --publish-all Publish all exposed ports to random ports -p, --publish=[] Publish a container"s port(s) to the host --pid PID namespace to use --pids-limit Tune container pids limit (set -1 for unlimited) --privileged Give extended privileges to this container --read-only Mount the container"s root filesystem as read only --restart=no Restart policy to apply when a container exits --rm Automatically remove the container when it exits --security-opt=[] Security Options --shm-size Size of /dev/shm, default value is 64MB --sig-proxy=true Proxy received signals to the process --stop-signal=SIGTERM Signal to stop a container, SIGTERM by default -t, --tty Allocate a pseudo-TTY --tmpfs=[] Mount a tmpfs directory -u, --user Username or UID (format:[: ]) --ulimit=[] Ulimit options --userns User namespace to use --uts UTS namespace to use -v, --volume=[] Bind mount a volume --volume-driver Optional volume driver for the container --volumes-from=[] Mount volumes from the specified container(s) -w, --workdir Working directory inside the container
查看Docker守護(hù)進(jìn)程的模式配置的幫助信息;
docker daemon --help
用法說明;
Usage: docker daemon [OPTIONS] Enable daemon mode
參數(shù)說明;
--api-cors-header Set CORS headers in the remote API --authorization-plugin=[] List authorization plugins in order from first evaluator to last -b, --bridge Attach containers to a network bridge --bip Specify network bridge IP --cgroup-parent Set parent cgroup for all containers --cluster-advertise Address or interface name to advertise --cluster-store Set the cluster store --cluster-store-opt=map[] Set cluster store options --config-file=/etc/docker/daemon.json Daemon configuration file --containerd Path to containerd socket -D, --debug Enable debug mode --default-gateway Container default gateway IPv4 address --default-gateway-v6 Container default gateway IPv6 address --default-ulimit=[] Set default ulimits for containers --disable-legacy-registry Do not contact legacy registries --dns=[] DNS server to use --dns-opt=[] DNS options to use --dns-search=[] DNS search domains to use --exec-opt=[] Set runtime execution options --exec-root=/var/run/docker Root directory for execution state files --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 --help 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 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 Set the containers network MTU -p, --pidfile=/var/run/docker.pid Path to use for daemon PID file --raw-logs Full timestamps without ANSI coloring --registry-mirror=[] Preferred Docker registry mirror -s, --storage-driver Storage driver to use --selinux-enabled Enable selinux support --storage-opt=[] Set storage driver options --tls 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 Use TLS and verify the remote --userland-proxy=true Use userland proxy for loopback traffic --userns-remap User/Group setting for user namespaces
文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請注明本文地址:http://specialneedsforspecialkids.com/yun/26634.html
摘要:后面會(huì)涉及以配置文件進(jìn)行部署。的調(diào)度完成,被分配到指定上。這是的一種最終狀態(tài)。圖相較而言,除了提供的基本功能,還支持聲明式的更新和回滾。共享數(shù)據(jù)存儲(chǔ)的問題主要分為數(shù)據(jù)臨時(shí)存儲(chǔ)與持久性存儲(chǔ)。 帶著問題學(xué) Kubernetes 基本單元 Pod 摘要:本文屬于原創(chuàng),歡迎轉(zhuǎn)載,轉(zhuǎn)載請保留出處:https://github.com/jasonGeng88/blog 文章一:帶著問題學(xué) Kube...
摘要:后面會(huì)涉及以配置文件進(jìn)行部署。的調(diào)度完成,被分配到指定上。這是的一種最終狀態(tài)。圖相較而言,除了提供的基本功能,還支持聲明式的更新和回滾。共享數(shù)據(jù)存儲(chǔ)的問題主要分為數(shù)據(jù)臨時(shí)存儲(chǔ)與持久性存儲(chǔ)。 帶著問題學(xué) Kubernetes 基本單元 Pod 摘要:本文屬于原創(chuàng),歡迎轉(zhuǎn)載,轉(zhuǎn)載請保留出處:https://github.com/jasonGeng88/blog 文章一:帶著問題學(xué) Kube...
摘要:工資不漲,英偉達(dá)的售價(jià)年年漲。近日,宣布推出適用于的,其中包括。對于正在進(jìn)行的深度學(xué)習(xí)加速工作而言,這是一座重大的里程碑。而實(shí)現(xiàn)則使用了,這是一個(gè)適用于深度學(xué)習(xí)的高度優(yōu)化例程庫。目前已發(fā)布安裝說明及預(yù)構(gòu)建的映像。 工資不漲,英偉達(dá) GPU 的售價(jià)年年漲。因此,多一個(gè)競爭對手,總是好事。近日,Google 宣布推出適用于 ROCm GPU 的 TensorFlow v1.8,其中包括 Rade...
摘要:而前不久推出了和的全新版本,允許以更貼近用戶透明的方式運(yùn)行。在使用命令之前,必須要使用命令初始化各類環(huán)境變量用于告知命令如何與虛擬機(jī)內(nèi)的通信是一個(gè)原生的蘋果應(yīng)用程序,被安裝到目錄。不過現(xiàn)在依舊存在許多問題,比如沒有設(shè)置各項(xiàng)參數(shù)的接口。 Docker 作為一個(gè)集成的、易于部署的環(huán)境,在很多方面都有廣泛的應(yīng)用,但是由于其使用了 Linux 內(nèi)核的容器技術(shù),所以很依賴 Linux 環(huán)境,在其...
摘要:知識點(diǎn)核心組件保存整個(gè)集群的狀態(tài)信息,感覺相當(dāng)于的數(shù)據(jù)庫提供對資源操作的唯一入口,并提供認(rèn)證授權(quán),訪問控制,注冊與發(fā)現(xiàn)等機(jī)制負(fù)責(zé)維護(hù)集群的狀態(tài),故障檢測,自動(dòng)擴(kuò)展,滾動(dòng)更新等負(fù)責(zé)對資源的調(diào)度,按著預(yù)定的調(diào)度策略將調(diào)度到相應(yīng)的集群上負(fù)責(zé)維護(hù)容 kubernetes kubernetes 知識點(diǎn) 1. 核心組件 etcd 保存整個(gè)集群的狀態(tài)信息,感覺相當(dāng)于k8s的數(shù)據(jù)庫 apiserve...
閱讀 3281·2021-11-25 09:43
閱讀 2084·2021-09-22 10:02
閱讀 3311·2021-09-06 15:00
閱讀 2298·2019-08-30 15:56
閱讀 2347·2019-08-30 15:54
閱讀 3224·2019-08-30 14:14
閱讀 2258·2019-08-29 17:25
閱讀 2902·2019-08-29 17:16