1. 程式人生 > >Docker學習筆記:Docker 基礎用法和命令幫助

Docker學習筆記:Docker 基礎用法和命令幫助

Usage of docker:
  --api-enable-cors=false                Enable CORS headers in the remote API                      # 遠端 API 中開啟 CORS 頭
  -b, --bridge=""                        Attach containers to a pre-existing network bridge         # 橋接網路
                                           use 'none' to disable container networking
  --bip=""                               Use this CIDR notation address for the network bridge's IP, not compatible with -b
                                         # 和 -b 選項不相容,具體沒有測試過
  -d, --daemon=false                     Enable daemon mode                                         # daemon 模式
  -D, --debug=false                      Enable debug mode                                          # debug 模式
  --dns=[]                               Force docker to use specific DNS servers                   # 強制 docker 使用指定 dns 伺服器
  --dns-search=[]                        Force Docker to use specific DNS search domains            # 強制 docker 使用指定 dns 搜尋域
  -e, --exec-driver="native"             Force the docker runtime to use a specific exec driver     # 強制 docker 執行時使用指定執行驅動器
  --fixed-cidr=""                        IPv4 subnet for fixed IPs (ex: 10.20.0.0/16)
                                           this subnet must be nested in the bridge subnet (which is defined by -b or --bip)
  -G, --group="docker"                   Group to assign the unix socket specified by -H when running in daemon mode
                                           use '' (the empty string) to disable setting of a group
  -g, --graph="/var/lib/docker"          Path to use as the root of the docker runtime              # 容器執行的根目錄路徑
  -H, --host=[]                          The socket(s) to bind to in daemon mode                    # daemon 模式下 docker 指定繫結方式[tcp or 本地 socket]
                                           specified using one or more tcp://host:port, unix:///path/to/socket, fd://* or fd://socketfd.
  --icc=true                             Enable inter-container communication                       # 跨容器通訊
  --insecure-registry=[]                 Enable insecure communication with specified registries (no certificate verification for HTTPS and enable HTTP fallback) (e.g., localhost:5000 or 10.20.0.0/16)
  --ip="0.0.0.0"                         Default IP address to use when binding container ports     # 指定監聽地址,預設所有 ip
  --ip-forward=true                      Enable net.ipv4.ip_forward                                 # 開啟轉發
  --ip-masq=true                         Enable IP masquerading for bridge's IP range
  --iptables=true                        Enable Docker's addition of iptables rules                 # 新增對應 iptables 規則
  --mtu=0                                Set the containers network MTU                             # 設定網路 mtu
                                           if no value is provided: default to the default route MTU or 1500 if no default route is available
  -p, --pidfile="/var/run/docker.pid"    Path to use for daemon PID file                            # 指定 pid 檔案位置
  --registry-mirror=[]                   Specify a preferred Docker registry mirror                  
  -s, --storage-driver=""                Force the docker runtime to use a specific storage driver  # 強制 docker 執行時使用指定儲存驅動
  --selinux-enabled=false                Enable selinux support                                     # 開啟 selinux 支援
  --storage-opt=[]                       Set storage driver options                                 # 設定儲存驅動選項
  --tls=false                            Use TLS; implied by tls-verify flags                       # 開啟 tls
  --tlscacert="/root/.docker/ca.pem"     Trust only remotes providing a certificate signed by the CA given here
  --tlscert="/root/.docker/cert.pem"     Path to TLS certificate file                               # tls 證書檔案位置
  --tlskey="/root/.docker/key.pem"       Path to TLS key file                                       # tls key 檔案位置
  --tlsverify=false                      Use TLS and verify the remote (daemon: verify client, client: verify daemon) # 使用 tls 並確認遠端控制主機
  -v, --version=false                    Print version information and quit                         # 輸出 docker 版本資訊