Docker运行参数详解

 

Docker运行参数详解

 

  • docker search 参数:


 
 
  1. MacdeMacBook-Pro:~ mac$ docker network create --help
  2. Usage: docker network create [OPTIONS] NETWORK
  3. Create a network
  4. Options:
  5. --attachable Enable manual container attachment
  6. --aux-address map Auxiliary IPv4 or IPv6 addresses used by Network driver (default map[])
  7. --config-from string The network from which copying the configuration
  8. --config-only Create a configuration only network
  9. -d, --driver string Driver to manage the Network (default "bridge")
  10. --gateway strings IPv4 or IPv6 Gateway for the master subnet
  11. --ingress Create swarm routing-mesh network
  12. --internal Restrict external access to the network
  13. --ip-range strings Allocate container ip from a sub-range
  14. --ipam-driver string IP Address Management Driver (default "default")
  15. --ipam-opt map Set IPAM driver specific options (default map[])
  16. --ipv6 Enable IPv6 networking
  17. --label list Set metadata on a network
  18. -o, --opt map Set driver specific options (default map[])
  19. --scope string Control the network's scope
  20. --subnet strings Subnet in CIDR format that represents a network segment

 

  • docker create network 参数:


 
 
  1. MacdeMacBook-Pro:~ mac$ docker network create --help
  2. Usage: docker network create [OPTIONS] NETWORK
  3. Create a network
  4. Options:
  5. --attachable Enable manual container attachment
  6. --aux-address map Auxiliary IPv4 or IPv6 addresses used by Network driver (default map[])
  7. --config-from string The network from which copying the configuration
  8. --config-only Create a configuration only network
  9. -d, --driver string Driver to manage the Network (default "bridge")
  10. --gateway strings IPv4 or IPv6 Gateway for the master subnet
  11. --ingress Create swarm routing-mesh network
  12. --internal Restrict external access to the network
  13. --ip-range strings Allocate container ip from a sub-range
  14. --ipam-driver string IP Address Management Driver (default "default")
  15. --ipam-opt map Set IPAM driver specific options (default map[])
  16. --ipv6 Enable IPv6 networking
  17. --label list Set metadata on a network
  18. -o, --opt map Set driver specific options (default map[])
  19. --scope string Control the network's scope
  20. --subnet strings Subnet in CIDR format that represents a network segment

 

  • docker run 参数 :


 
 
  1. MacdeMacBook-Pro:~ mac$ docker run --help
  2. Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
  3. Run a command in a new container
  4. Options:
  5. --add-host list Add a custom host- to-IP mapping (host:ip)
  6. -a, --attach list Attach to STDIN, STDOUT or STDERR
  7. --blkio-weight uint16 Block IO (relative weight), between 10 and 1000, or 0 to disable ( default 0)
  8. --blkio-weight-device list Block IO weight (relative device weight) ( default [])
  9. --cap-add list Add Linux capabilities
  10. --cap-drop list Drop Linux capabilities
  11. --cgroup-parent string Optional parent cgroup for the container
  12. --cidfile string Write the container ID to the file
  13. --cpu-period int Limit CPU CFS (Completely Fair Scheduler) period
  14. --cpu-quota int Limit CPU CFS (Completely Fair Scheduler) quota
  15. --cpu-rt-period int Limit CPU real-time period in microseconds
  16. --cpu-rt-runtime int Limit CPU real-time runtime in microseconds
  17. -c, --cpu-shares int CPU shares (relative weight)
  18. --cpus decimal Number of CPUs
  19. --cpuset-cpus string CPUs in which to allow execution ( 0 -3, 0, 1)
  20. --cpuset-mems string MEMs in which to allow execution ( 0 -3, 0, 1)
  21. -d, --detach Run container in background and print container ID
  22. --detach-keys string Override the key sequence for detaching a container
  23. --device list Add a host device to the container
  24. --device-cgroup-rule list Add a rule to the cgroup allowed devices list
  25. --device-read-bps list Limit read rate (bytes per second) from a device ( default [])
  26. --device-read-iops list Limit read rate (IO per second) from a device ( default [])
  27. --device-write-bps list Limit write rate (bytes per second) to a device ( default [])
  28. --device-write-iops list Limit write rate (IO per second) to a device ( default [])
  29. --disable-content-trust Skip image verification ( default true)
  30. --dns list Set custom DNS servers
  31. --dns- option list Set DNS options
  32. --dns-search list Set custom DNS search domains
  33. --entrypoint string Overwrite the default ENTRYPOINT of the image
  34. -e, --env list Set environment variables
  35. --env-file list Read in a file of environment variables
  36. --expose list Expose a port or a range of ports
  37. -- group-add list Add additional groups to join
  38. --health-cmd string Command to run to check health
  39. --health-interval duration Time between running the check (ms|s|m|h) ( default 0s)
  40. --health-retries int Consecutive failures needed to report unhealthy
  41. --health-start-period duration Start period for the container to initialize before starting health-retries countdown (ms|s|m|h) ( default 0s)
  42. --health-timeout duration Maximum time to allow one check to run (ms|s|m|h) ( default 0s)
  43. --help Print usage
  44. -h, --hostname string Container host name
  45. --init Run an init inside the container that forwards signals and reaps processes
  46. -i, --interactive Keep STDIN open even if not attached
  47. --ip string IPv4 address (e.g., 172.30 .100 .104)
  48. --ip6 string IPv6 address (e.g., 2001:db8:: 33)
  49. --ipc string IPC mode to use
  50. --isolation string Container isolation technology
  51. --kernel-memory bytes Kernel memory limit
  52. -l, --label list Set meta data on a container
  53. --label-file list Read in a line delimited file of labels
  54. --link list Add link to another container
  55. --link-local-ip list Container IPv4/IPv6 link-local addresses
  56. --log-driver string Logging driver for the container
  57. --log-opt list Log driver options
  58. --mac-address string Container MAC address (e.g., 92:d0:c6: 0a: 29: 33)
  59. -m, --memory bytes Memory limit
  60. --memory-reservation bytes Memory soft limit
  61. --memory-swap bytes Swap limit equal to memory plus swap: '-1' to enable unlimited swap
  62. --memory-swappiness int Tune container memory swappiness ( 0 to 100) ( default -1)
  63. --mount mount Attach a filesystem mount to the container
  64. --name string Assign a name to the container
  65. --network string Connect a container to a network ( default "default")
  66. --network- alias list Add network-scoped alias for the container
  67. --no-healthcheck Disable any container-specified HEALTHCHECK
  68. --oom-kill-disable Disable OOM Killer
  69. --oom-score-adj int Tune host 's OOM preferences (-1000 to 1000)
  70. --pid string PID namespace to use
  71. --pids-limit int Tune container pids limit ( set -1 for unlimited)
  72. --platform string Set platform if server is multi-platform capable
  73. --privileged Give extended privileges to this container
  74. -p, --publish list Publish a container 's port(s) to the host
  75. -P, --publish-all Publish all exposed ports to random ports
  76. --read-only Mount the container 's root filesystem as read only
  77. --restart string Restart policy to apply when a container exits ( default "no")
  78. --rm Automatically remove the container when it exits
  79. --runtime string Runtime to use for this container
  80. --security-opt list Security Options
  81. --shm-size bytes Size of /dev/shm
  82. --sig-proxy Proxy received signals to the process ( default true)
  83. -- stop-signal string Signal to stop a container ( default "SIGTERM")
  84. -- stop-timeout int Timeout ( in seconds) to stop a container
  85. --storage-opt list Storage driver options for the container
  86. --sysctl map Sysctl options ( default map[])
  87. --tmpfs list Mount a tmpfs directory
  88. -t, --tty Allocate a pseudo-TTY
  89. --ulimit ulimit Ulimit options ( default [])
  90. -u, --user string Username or UID (format: <name|uid>[:< group|gid>])
  91. --userns string User namespace to use
  92. --uts string UTS namespace to use
  93. -v, --volume list Bind mount a volume
  94. --volume-driver string Optional volume driver for the container
  95. --volumes- from list Mount volumes from the specified container(s)
  96. -w, --workdir string Working directory inside the container

 

  • docker ps 参数:


 
 
  1. MacdeMacBook-Pro:~ mac$ docker ps --help
  2. Usage: docker ps [OPTIONS]
  3. List containers
  4. Options:
  5. -a, --all Show all containers (default shows just running)
  6. -f, --filter filter Filter output based on conditions provided
  7. --format string Pretty-print containers using a Go template
  8. -n, --last int Show n last created containers (includes all states) (default -1)
  9. -l, --latest Show the latest created container (includes all states)
  10. --no-trunc Don't truncate output
  11. -q, --quiet Only display numeric IDs
  12. -s, --size Display total file sizes

 

  • docker images 参数:


 
 
  1. MacdeMacBook-Pro:~ mac$ docker images --help
  2. Usage: docker images [OPTIONS] [REPOSITORY[:TAG]]
  3. List images
  4. Options:
  5. -a, --all Show all images (default hides intermediate images)
  6. --digests Show digests
  7. -f, --filter filter Filter output based on conditions provided
  8. --format string Pretty-print images using a Go template
  9. --no-trunc Don't truncate output
  10. -q, --quiet Only show numeric IDs

 

  • docker-compose 参数:


 
 
  1. MacdeMacBook-Pro:~ mac$ docker-compose --help
  2. Define and run multi-container applications with Docker.
  3. Usage:
  4. docker-compose [-f <arg>...] [options] [COMMAND] [ARGS...]
  5. docker-compose -h|--help
  6. Options:
  7. -f, --file FILE Specify an alternate compose file
  8. ( default: docker-compose.yml)
  9. -p, --project-name NAME Specify an alternate project name
  10. ( default: directory name)
  11. --verbose Show more output
  12. --log-level LEVEL Set log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
  13. --no- ansi Do not print ANSI control characters
  14. -v, --version Print version and exit
  15. -H, --host HOST Daemon socket to connect to
  16. --tls Use TLS; implied by --tlsverify
  17. --tlscacert CA_PATH Trust certs signed only by this CA
  18. --tlscert CLIENT_CERT_PATH Path to TLS certificate file
  19. --tlskey TLS_KEY_PATH Path to TLS key file
  20. --tlsverify Use TLS and verify the remote
  21. -- skip-hostname-check Don 't check the daemon's hostname against the
  22. name specified in the client certificate
  23. --project-directory PATH Specify an alternate working directory
  24. ( default: the path of the Compose file)
  25. --compatibility If set, Compose will attempt to convert deploy
  26. keys in v3 files to their non-Swarm equivalent
  27. Commands:
  28. build Build or rebuild services
  29. bundle Generate a Docker bundle from the Compose file
  30. config Validate and view the Compose file
  31. create Create services
  32. down Stop and remove containers, networks, images, and volumes
  33. events Receive real time events from containers
  34. exec Execute a command in a running container
  35. help Get help on a command
  36. images List images
  37. kill Kill containers
  38. logs View output from containers
  39. pause Pause services
  40. port Print the public port for a port binding
  41. ps List containers
  42. pull Pull service images
  43. push Push service images
  44. restart Restart services
  45. rm Remove stopped containers
  46. run Run a one- off command
  47. scale Set number of containers for a service
  48. start Start services
  49. stop Stop services
  50. top Display the running processes
  51. unpause Unpause services
  52. up Create and start containers
  53. version Show the Docker-Compose version information

 

        <div class="person-messagebox">
            <div class="left-message"><a href="https://blog.csdn.net/Aria_Miazzy">
                <img src="https://profile.csdnimg.cn/7/5/5/3_aria_miazzy" class="avatar_pic" username="Aria_Miazzy">
            </a></div>
            <div class="middle-message">
                                    <div class="title"><span class="tit "><a href="https://blog.csdn.net/Aria_Miazzy" data-report-click="{&quot;mod&quot;:&quot;popu_379&quot;,&quot;ab&quot;:&quot;new&quot;}" target="_blank">星河子_YumWisdom</a></span>
                    <!-- 等级,level -->
                                            <img class="identity-icon" src="https://csdnimg.cn/identity/blog7.png">                                            </div>
                <div class="text"><span>原创文章 180</span><span>获赞 972</span><span>访问量 73万+</span></div>
            </div>
                            <div class="right-message">
                                        <a class="btn btn-sm  bt-button personal-watch" data-report-click="{&quot;mod&quot;:&quot;popu_379&quot;,&quot;ab&quot;:&quot;new&quot;}">关注</a>
                                                            <a href="https://bbs.csdn.net/topics/395526323" target="_blank" class="btn btn-sm bt-button personal-messageboard">他的留言板
                    </a>
                                </div>
                        </div>
                    
    </div>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值