亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

directory search
Compose About versions and upgrading (Compose) ASP.NET Core + SQL Server on Linux (Compose) CLI environment variables (Compose) Command-line completion (Compose) Compose(組成) Compose command-line reference(組合命令行參考) Control startup order (Compose) Django and PostgreSQL (Compose) Docker stacks and distributed application bundles (Compose) docker-compose build(docker-compose構(gòu)建) docker-compose bundle docker-compose config docker-compose create docker-compose down docker-compose events docker-compose exec docker-compose help docker-compose images docker-compose kill docker-compose logs docker-compose pause docker-compose port docker-compose ps docker-compose pull docker-compose push docker-compose restart docker-compose rm docker-compose run docker-compose scale docker-compose start docker-compose stop docker-compose top docker-compose unpause docker-compose up Environment file (Compose) Environment variables in Compose Extend services in Compose Frequently asked questions (Compose) Getting started (Compose) Install Compose Link environment variables (deprecated) (Compose) Networking in Compose Overview of Docker Compose Overview of docker-compose CLI Quickstart: Compose and WordPress Rails and PostgreSQL (Compose) Sample apps with Compose Using Compose in production Using Compose with Swarm Engine .NET Core application (Engine) About images, containers, and storage drivers (Engine) Add nodes to the swarm (Engine) Apply custom metadata (Engine) Apply rolling updates (Engine) apt-cacher-ng Best practices for writing Dockerfiles (Engine) Binaries (Engine) Bind container ports to the host (Engine) Breaking changes (Engine) Build your own bridge (Engine) Configure container DNS (Engine) Configure container DNS in user-defined networks (Engine) CouchDB (Engine) Create a base image (Engine) Create a swarm (Engine) Customize the docker0 bridge (Engine) Debian (Engine) Default bridge network Delete the service (Engine) Deploy a service (Engine) Deploy services to a swarm (Engine) Deprecated Engine features Docker container networking (Engine) Docker overview (Engine) Docker run reference (Engine) Dockerfile reference (Engine) Dockerize an application Drain a node (Engine) Engine FAQ (Engine) Fedora (Engine) Get started (Engine) Get started with macvlan network driver (Engine) Get started with multi-host networking (Engine) How nodes work (Engine) How services work (Engine) Image management (Engine) Inspect the service (Engine) Install Docker (Engine) IPv6 with Docker (Engine) Join nodes to a swarm (Engine) Legacy container links (Engine) Lock your swarm (Engine) Manage nodes in a swarm (Engine) Manage sensitive data with Docker secrets (Engine) Manage swarm security with PKI (Engine) Manage swarm service networks (Engine) Migrate to Engine 1.10 Optional Linux post-installation steps (Engine) Overview (Engine) PostgreSQL (Engine) Raft consensus in swarm mode (Engine) Riak (Engine) Run Docker Engine in swarm mode Scale the service (Engine) SDKs (Engine) Select a storage driver (Engine) Set up for the tutorial (Engine) SSHd (Engine) Storage driver overview (Engine) Store service configuration data (Engine) Swarm administration guide (Engine) Swarm mode key concepts (Engine) Swarm mode overlay network security model (Engine) Swarm mode overview (Engine) Understand container communication (Engine) Use multi-stage builds (Engine) Use swarm mode routing mesh (Engine) Use the AUFS storage driver (Engine) Use the Btrfs storage driver (Engine) Use the Device mapper storage driver (Engine) Use the OverlayFS storage driver (Engine) Use the VFS storage driver (Engine) Use the ZFS storage driver (Engine) Engine: Admin Guide Amazon CloudWatch logs logging driver (Engine) Bind mounts (Engine) Collect Docker metrics with Prometheus (Engine) Configuring and running Docker (Engine) Configuring logging drivers (Engine) Control and configure Docker with systemd (Engine) ETW logging driver (Engine) Fluentd logging driver (Engine) Format command and log output (Engine) Google Cloud logging driver (Engine) Graylog Extended Format (GELF) logging driver (Engine) Journald logging driver (Engine) JSON File logging driver (Engine) Keep containers alive during daemon downtime (Engine) Limit a container's resources (Engine) Link via an ambassador container (Engine) Log tags for logging driver (Engine) Logentries logging driver (Engine) PowerShell DSC usage (Engine) Prune unused Docker objects (Engine) Run multiple services in a container (Engine) Runtime metrics (Engine) Splunk logging driver (Engine) Start containers automatically (Engine) Storage overview (Engine) Syslog logging driver (Engine) tmpfs mounts Troubleshoot volume problems (Engine) Use a logging driver plugin (Engine) Using Ansible (Engine) Using Chef (Engine) Using Puppet (Engine) View a container's logs (Engine) Volumes (Engine) Engine: CLI Daemon CLI reference (dockerd) (Engine) docker docker attach docker build docker checkpoint docker checkpoint create docker checkpoint ls docker checkpoint rm docker commit docker config docker config create docker config inspect docker config ls docker config rm docker container docker container attach docker container commit docker container cp docker container create docker container diff docker container exec docker container export docker container inspect docker container kill docker container logs docker container ls docker container pause docker container port docker container prune docker container rename docker container restart docker container rm docker container run docker container start docker container stats docker container stop docker container top docker container unpause docker container update docker container wait docker cp docker create docker deploy docker diff docker events docker exec docker export docker history docker image docker image build docker image history docker image import docker image inspect docker image load docker image ls docker image prune docker image pull docker image push docker image rm docker image save docker image tag docker images docker import docker info docker inspect docker kill docker load docker login docker logout docker logs docker network docker network connect docker network create docker network disconnect docker network inspect docker network ls docker network prune docker network rm docker node docker node demote docker node inspect docker node ls docker node promote docker node ps docker node rm docker node update docker pause docker plugin docker plugin create docker plugin disable docker plugin enable docker plugin inspect docker plugin install docker plugin ls docker plugin push docker plugin rm docker plugin set docker plugin upgrade docker port docker ps docker pull docker push docker rename docker restart docker rm docker rmi docker run docker save docker search docker secret docker secret create docker secret inspect docker secret ls docker secret rm docker service docker service create docker service inspect docker service logs docker service ls docker service ps docker service rm docker service scale docker service update docker stack docker stack deploy docker stack ls docker stack ps docker stack rm docker stack services docker start docker stats docker stop docker swarm docker swarm ca docker swarm init docker swarm join docker swarm join-token docker swarm leave docker swarm unlock docker swarm unlock-key docker swarm update docker system docker system df docker system events docker system info docker system prune docker tag docker top docker unpause docker update docker version docker volume docker volume create docker volume inspect docker volume ls docker volume prune docker volume rm docker wait Use the Docker command line (Engine) Engine: Extend Access authorization plugin (Engine) Docker log driver plugins Docker network driver plugins (Engine) Extending Engine with plugins Managed plugin system (Engine) Plugin configuration (Engine) Plugins API (Engine) Volume plugins (Engine) Engine: Security AppArmor security profiles for Docker (Engine) Automation with content trust (Engine) Content trust in Docker (Engine) Delegations for content trust (Engine) Deploying Notary (Engine) Docker security (Engine) Docker security non-events (Engine) Isolate containers with a user namespace (Engine) Manage keys for content trust (Engine) Play in a content trust sandbox (Engine) Protect the Docker daemon socket (Engine) Seccomp security profiles for Docker (Engine) Secure Engine Use trusted images Using certificates for repository client verification (Engine) Engine: Tutorials Engine tutorials Network containers (Engine) Get Started Part 1: Orientation Part 2: Containers Part 3: Services Part 4: Swarms Part 5: Stacks Part 6: Deploy your app Machine Amazon Web Services (Machine) Digital Ocean (Machine) docker-machine active docker-machine config docker-machine create docker-machine env docker-machine help docker-machine inspect docker-machine ip docker-machine kill docker-machine ls docker-machine provision docker-machine regenerate-certs docker-machine restart docker-machine rm docker-machine scp docker-machine ssh docker-machine start docker-machine status docker-machine stop docker-machine upgrade docker-machine url Driver options and operating system defaults (Machine) Drivers overview (Machine) Exoscale (Machine) Generic (Machine) Get started with a local VM (Machine) Google Compute Engine (Machine) IBM Softlayer (Machine) Install Machine Machine Machine CLI overview Machine command-line completion Machine concepts and help Machine overview Microsoft Azure (Machine) Microsoft Hyper-V (Machine) Migrate from Boot2Docker to Machine OpenStack (Machine) Oracle VirtualBox (Machine) Provision AWS EC2 instances (Machine) Provision Digital Ocean Droplets (Machine) Provision hosts in the cloud (Machine) Rackspace (Machine) VMware Fusion (Machine) VMware vCloud Air (Machine) VMware vSphere (Machine) Notary Client configuration (Notary) Common Server and signer configurations (Notary) Getting started with Notary Notary changelog Notary configuration files Running a Notary service Server configuration (Notary) Signer configuration (Notary) Understand the service architecture (Notary) Use the Notary client
characters

docker

若要列出可用命令,請運行docker沒有參數(shù)或執(zhí)行docker help*

$ docker
Usage: docker [OPTIONS] COMMAND [ARG...]
       docker [ --help | -v | --version ]
A self-sufficient runtime for containers.
Options:      
    --config string      Location of client config files (default "/root/.docker")  
    -D, --debug              Enable debug mode      
    --help               Print usage  
    -H, --host value         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
    # […]

描述

根據(jù)您的Docker系統(tǒng)配置,可能需要使用前面的每個docker命令sudo。為了避免必須使用sudodocker命令,系統(tǒng)管理員可以創(chuàng)建一個名為的Unix組docker并向其添加用戶。

有關(guān)安裝Docker或sudo配置的更多信息,請參閱適用于您的操作系統(tǒng)的安裝說明。

環(huán)境變量

為了便于參考,docker命令行支持以下環(huán)境變量列表:

  • DOCKER_API_VERSION要使用的API版本 (例如 1.19)。

  • DOCKER_CONFIG客戶端配置文件的位置。

  • DOCKER_CERT_PATH身份驗證密鑰的位置。

  • DOCKER_DRIVER要使用的圖形驅(qū)動程序。

  • DOCKER_HOST要連接到的守護進程套接字。

  • DOCKER_NOWARN_KERNEL_VERSION防止您的Linux內(nèi)核不適合Docker的警告。

  • DOCKER_RAMDISK 如果設(shè)置這將禁用'pivot_root'。

  • DOCKER_TLS_VERIFY 當設(shè)置Docker使用TLS并驗證遠程。

  • DOCKER_CONTENT_TRUST設(shè)置Docker時使用公證人簽名和驗證圖像。等于--disable-content-trust=false構(gòu)建,創(chuàng)建,拉,推,run。

  • DOCKER_CONTENT_TRUST_SERVER要使用的公證服務(wù)器的URL。這默認為與注冊表相同的URL。

  • DOCKER_HIDE_LEGACY_COMMANDS設(shè)置后,Docker會在輸出中隱藏“l(fā)egacy”頂級命令(如docker rm,和docker pulldocker help,并且僅打印Management commands每個對象類型(例如,docker container)。這可能會成為未來版本中的默認值,此時會刪除此環(huán)境變量。

  • DOCKER_TMPDIR臨時碼頭文件的位置。

因為Docker是使用GO開發(fā)的,所以您也可以使用GO運行時使用的任何環(huán)境變量。特別是,你可能會發(fā)現(xiàn)這些有用的:

  • HTTP_PROXY

  • HTTPS_PROXY

  • NO_PROXY

這些Go環(huán)境變量不區(qū)分大小寫。見GO規(guī)格有關(guān)這些變量的詳細信息。

配置文件

默認情況下,Docker命令行將其配置文件存儲在目錄中調(diào)用.docker$HOME目錄中。但是,您可以通過DOCKER_CONFIG環(huán)境變量或--config命令行選項指定不同的位置。如果兩者都指定,則該--config選項將覆蓋DOCKER_CONFIG環(huán)境變量。例如:

docker --config ~/testconfigs/ ps

指示Docker ~/testconfigs/在運行該ps命令時使用目錄中的配置文件。

Docker管理配置目錄中的大部分文件,不應(yīng)修改它們。但是,您可以修改config.json文件以控制docker命令行為的某些方面。

當前,您可以修改docker使用環(huán)境變量或命令行選項的命令行為。您還可以在config.json來修改一些相同的行為。在使用這些機制時,您必須記住它們之間的優(yōu)先級順序。命令行選項覆蓋環(huán)境變量和環(huán)境變量,覆蓋您在config.json檔案。

config.json文件存儲了幾個屬性的JSON編碼:

HttpHeaders屬性指定一組標題,以包含從Docker客戶端發(fā)送到守護程序的所有消息。Docker不會試圖解釋或理解這些頭文件; 它只是將它們放入消息中。Docker不允許這些頭文件改變它自己設(shè)置的頭文件。

該屬性psFormat指定docker ps輸出的默認格式。當這個--format標志沒有被提供時docker ps,Docker的客戶端使用這個屬性。如果未設(shè)置此屬性,則客戶端將回到默認表格格式。有關(guān)支持的格式化指令的列表,請參閱文檔中的格式部分docker ps

imagesFormat的特性是默認格式。docker images輸出。當--format標志沒有提供docker images命令,Docker的客戶端使用此屬性。如果未設(shè)置此屬性,則客戶端將返回到默認表格式。有關(guān)受支持的格式化指令的列表,請參見格式化部分docker images文獻資料

pluginsFormat的特性是指定默認格式。docker plugin ls輸出。當--format標志沒有提供docker plugin ls命令,Docker的客戶端使用此屬性。如果未設(shè)置此屬性,則客戶端將返回到默認表格式。有關(guān)受支持的格式化指令的列表,請參見格式化部分docker plugin ls文獻資料

servicesFormat的特性是指定默認格式。docker service ls輸出。當--format標志沒有提供docker service ls命令,Docker的客戶端使用此屬性。如果未設(shè)置此屬性,則客戶端將返回到默認的json格式。有關(guān)受支持的格式化指令的列表,請參見格式化部分docker service ls文獻資料

serviceInspectFormat的特性是指定默認格式。docker service inspect輸出。當--format標志沒有提供docker service inspect命令,Docker的客戶端使用此屬性。如果未設(shè)置此屬性,則客戶端將返回到默認的json格式。有關(guān)受支持的格式化指令的列表,請參見格式化部分docker service inspect文獻資料

statsFormat的特性是指定默認格式。docker stats輸出。當--format標志沒有提供docker stats命令,Docker的客戶端使用此屬性。如果未設(shè)置此屬性,則客戶端將返回到默認表格式。有關(guān)支持的格式指令列表,請參見格式化部分docker stats文獻資料

secretFormat的特性是指定默認格式。docker secret ls輸出。當--format標志沒有提供docker secret ls命令,Docker的客戶端使用此屬性。如果未設(shè)置此屬性,則客戶端將返回到默認表格式。有關(guān)支持的格式指令列表,請參見格式化部分docker secret ls文獻資料

nodesFormat的特性是指定默認格式。docker node ls輸出。當--format標志沒有提供docker node ls命令,Docker的客戶端使用nodesFormat.如果nodesFormat未設(shè)置時,客戶端將使用默認表格式。有關(guān)受支持的格式化指令的列表,請參見格式化部分docker node ls文獻資料

configFormat的特性是指定默認格式。docker config ls輸出。當--format標志沒有提供docker config ls命令,Docker的客戶端使用此屬性。如果未設(shè)置此屬性,則客戶端將返回到默認表格式。有關(guān)支持的格式指令列表,請參見格式化部分docker config ls文獻資料

credsStore的特性是指定外部二進制文件作為默認憑據(jù)存儲。設(shè)置此屬性時,docker login指定的二進制文件中存儲憑據(jù)。docker-credential-<value>$PATH如果未設(shè)置此屬性,則憑據(jù)將存儲在auths屬性的配置。有關(guān)更多信息,請參見憑證存儲部分docker login文獻資料

credHelpers的特性是指定一組要優(yōu)先使用的憑據(jù)助手。credsStoreauths存儲和檢索特定注冊表的憑據(jù)時。如果設(shè)置了此屬性,則二進制docker-credential-<value>將用于存儲或檢索特定注冊表的憑據(jù)。有關(guān)更多信息,請參見資信助理員部分docker login文獻資料

一旦連接到容器上,用戶就會從容器中分離出來,并使用CTRL-p CTRL-q鍵序列。此分離鍵序列可使用detachKeys特性。指定<sequence>屬性的值。的格式<sequence>是以逗號分隔的字母列表。-Z,或ctrl-與下列任何一項相結(jié)合:

  • a-z(單個小寫字母字母)

  • @(at標志)

  • [(左括號)

  • \\(2個反斜杠)

  • _(下劃線)

  • ^(插入符號)

您的自定義適用于與您的Docker客戶端一起啟動的所有容器。用戶可以根據(jù)每個容器覆蓋您的自定義或默認密鑰序列。為此,用戶指定--detach-keysdocker attach,,,docker exec,,,docker rundocker start命令。

以下是一個示例config.json檔案:

{  "HttpHeaders": {    "MyHeader": "MyValue"  },  "psFormat": "table {{.ID}}\\t{{.Image}}\\t{{.Command}}\\t{{.Labels}}",  "imagesFormat": "table {{.ID}}\\t{{.Repository}}\\t{{.Tag}}\\t{{.CreatedAt}}",  "pluginsFormat": "table {{.ID}}\t{{.Name}}\t{{.Enabled}}",  "statsFormat": "table {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}",  "servicesFormat": "table {{.ID}}\t{{.Name}}\t{{.Mode}}",  "secretFormat": "table {{.ID}}\t{{.Name}}\t{{.CreatedAt}}\t{{.UpdatedAt}}",  "configFormat": "table {{.ID}}\t{{.Name}}\t{{.CreatedAt}}\t{{.UpdatedAt}}",  "serviceInspectFormat": "pretty",  "nodesFormat": "table {{.ID}}\t{{.Hostname}}\t{{.Availability}}",  "detachKeys": "ctrl-e,e",  "credsStore": "secretservice",  "credHelpers": {    "awesomereg.example.org": "hip-star",    "unicorn.example.com": "vcbait"  }}

公證

如果使用自己的公證服務(wù)器和自簽名證書或內(nèi)部證書頒發(fā)機構(gòu),則需要將證書放在tls/<registry_url>/ca.crtdocker config目錄中。

或者,您可以通過將證書添加到系統(tǒng)的根證書頒發(fā)機構(gòu)列表中來全局信任該證書。

實例

顯示幫助文本

要列出任何命令的幫助,只需執(zhí)行該命令,然后是--help選擇。

$ docker run --help

Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]Run a command in a new containerOptions:      --add-host value             Add a custom host-to-IP mapping (host:ip) (default [])  -a, --attach value               Attach to STDIN, STDOUT or STDERR (default [])...

選項類型

單字符命令行選項可以組合,所以不需要輸入docker run -i -t --name test busybox sh,您可以編寫docker run -it --name test busybox sh

布爾型

布爾選項采取的形式-d=false。如果您指定該標志,則在幫助文本中看到的值是設(shè)置的默認值。如果您指定一個沒有值的布爾標志,則會將該標志設(shè)置為true,而不考慮默認值。

例如,運行docker run -d會將值設(shè)置為true,所以您的容器將以 “分離”模式在后臺運行。

默認為true(例如docker build --rm=true)的選項只能通過明確設(shè)置為非默認值來設(shè)置false

$ docker build --rm=false .

您可以-a=[]在單個命令行中多次指定選項,例如在以下命令中:

$ docker run -a stdin -a stdout -i -t ubuntu /bin/bash

$ docker run -a stdin -a stdout -a stderr ubuntu /bin/ls

有時,多個選項可以調(diào)用更復雜的值字符串,如下所示-v

$ docker run -v /host:/container example/mysql

注意:由于實施中的限制,不要一起使用-t-a stderr選項pty。所有stderrpty模式都是簡單的stdout。

字符串和整數(shù)

--name=""期望一個字符串等選項,并且它們只能被指定一次。-c=0期望一個整數(shù)等選項,并且它們只能被指定一次。

Docker,Docker文件,CIL,命令行

Previous article: Next article: