1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #17119 from vdemeester/17117-deprecate-c-cli-opts

Deprecate -c cli short variant flag in docker cli build & create
This commit is contained in:
Antonio Murdaca 2015-10-17 10:22:46 +02:00
commit ab1f03397e
11 changed files with 18 additions and 16 deletions

View file

@ -58,7 +58,7 @@ func (cli *DockerCli) CmdBuild(args ...string) error {
dockerfileName := cmd.String([]string{"f", "-file"}, "", "Name of the Dockerfile (Default is 'PATH/Dockerfile')") dockerfileName := cmd.String([]string{"f", "-file"}, "", "Name of the Dockerfile (Default is 'PATH/Dockerfile')")
flMemoryString := cmd.String([]string{"m", "-memory"}, "", "Memory limit") flMemoryString := cmd.String([]string{"m", "-memory"}, "", "Memory limit")
flMemorySwap := cmd.String([]string{"-memory-swap"}, "", "Total memory (memory + swap), '-1' to disable swap") flMemorySwap := cmd.String([]string{"-memory-swap"}, "", "Total memory (memory + swap), '-1' to disable swap")
flCPUShares := cmd.Int64([]string{"c", "-cpu-shares"}, 0, "CPU shares (relative weight)") flCPUShares := cmd.Int64([]string{"#c", "-cpu-shares"}, 0, "CPU shares (relative weight)")
flCPUPeriod := cmd.Int64([]string{"-cpu-period"}, 0, "Limit the CPU CFS (Completely Fair Scheduler) period") flCPUPeriod := cmd.Int64([]string{"-cpu-period"}, 0, "Limit the CPU CFS (Completely Fair Scheduler) period")
flCPUQuota := cmd.Int64([]string{"-cpu-quota"}, 0, "Limit the CPU CFS (Completely Fair Scheduler) quota") flCPUQuota := cmd.Int64([]string{"-cpu-quota"}, 0, "Limit the CPU CFS (Completely Fair Scheduler) quota")
flCPUSetCpus := cmd.String([]string{"-cpuset-cpus"}, "", "CPUs in which to allow execution (0-3, 0,1)") flCPUSetCpus := cmd.String([]string{"-cpuset-cpus"}, "", "CPUs in which to allow execution (0-3, 0,1)")

View file

@ -466,7 +466,7 @@ _docker_build() {
--cgroup-parent --cgroup-parent
--cpuset-cpus --cpuset-cpus
--cpuset-mems --cpuset-mems
--cpu-shares -c --cpu-shares
--cpu-period --cpu-period
--cpu-quota --cpu-quota
--file -f --file -f
@ -1310,7 +1310,7 @@ _docker_run() {
--cpu-quota --cpu-quota
--cpuset-cpus --cpuset-cpus
--cpuset-mems --cpuset-mems
--cpu-shares -c --cpu-shares
--device --device
--dns --dns
--dns-opt --dns-opt

View file

@ -116,7 +116,7 @@ complete -c docker -A -f -n '__fish_seen_subcommand_from cp' -l help -d 'Print u
complete -c docker -f -n '__fish_docker_no_subcommand' -a create -d 'Create a new container' complete -c docker -f -n '__fish_docker_no_subcommand' -a create -d 'Create a new container'
complete -c docker -A -f -n '__fish_seen_subcommand_from create' -s a -l attach -d 'Attach to STDIN, STDOUT or STDERR.' complete -c docker -A -f -n '__fish_seen_subcommand_from create' -s a -l attach -d 'Attach to STDIN, STDOUT or STDERR.'
complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l add-host -d 'Add a custom host-to-IP mapping (host:ip)' complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l add-host -d 'Add a custom host-to-IP mapping (host:ip)'
complete -c docker -A -f -n '__fish_seen_subcommand_from create' -s c -l cpu-shares -d 'CPU shares (relative weight)' complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cpu-shares -d 'CPU shares (relative weight)'
complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cap-add -d 'Add Linux capabilities' complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cap-add -d 'Add Linux capabilities'
complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cap-drop -d 'Drop Linux capabilities' complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cap-drop -d 'Drop Linux capabilities'
complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cidfile -d 'Write the container ID to the file' complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cidfile -d 'Write the container ID to the file'

View file

@ -21,6 +21,8 @@ The following short variant options are deprecated in favor of their long
variants: variants:
docker run -c (--cpu-shares) docker run -c (--cpu-shares)
docker build -c (--cpu-shares)
docker create -c (--cpu-shares)
### Driver Specific Log Tags ### Driver Specific Log Tags
**Deprecated In Release: v1.9** **Deprecated In Release: v1.9**

View file

@ -15,7 +15,7 @@ parent = "smn_cli"
Build a new image from the source code at PATH Build a new image from the source code at PATH
--build-arg=[] Set build-time variables --build-arg=[] Set build-time variables
-c, --cpu-shares CPU Shares (relative weight) --cpu-shares CPU Shares (relative weight)
--cgroup-parent="" Optional parent cgroup for the container --cgroup-parent="" Optional parent cgroup for the container
--cpu-period=0 Limit the CPU CFS (Completely Fair Scheduler) period --cpu-period=0 Limit the CPU CFS (Completely Fair Scheduler) period
--cpu-quota=0 Limit the CPU CFS (Completely Fair Scheduler) quota --cpu-quota=0 Limit the CPU CFS (Completely Fair Scheduler) quota

View file

@ -121,7 +121,7 @@ To list the help on any command just execute the command, followed by the
Run a command in a new container Run a command in a new container
-a, --attach=[] Attach to STDIN, STDOUT or STDERR -a, --attach=[] Attach to STDIN, STDOUT or STDERR
-c, --cpu-shares=0 CPU shares (relative weight) --cpu-shares=0 CPU shares (relative weight)
... ...
## Option types ## Option types

View file

@ -19,7 +19,7 @@ Creates a new container.
-a, --attach=[] Attach to STDIN, STDOUT or STDERR -a, --attach=[] Attach to STDIN, STDOUT or STDERR
--add-host=[] Add a custom host-to-IP mapping (host:ip) --add-host=[] Add a custom host-to-IP mapping (host:ip)
--blkio-weight=0 Block IO weight (relative weight) --blkio-weight=0 Block IO weight (relative weight)
-c, --cpu-shares=0 CPU shares (relative weight) --cpu-shares=0 CPU shares (relative weight)
--cap-add=[] Add Linux capabilities --cap-add=[] Add Linux capabilities
--cap-drop=[] Drop Linux capabilities --cap-drop=[] Drop Linux capabilities
--cgroup-parent="" Optional parent cgroup for the container --cgroup-parent="" Optional parent cgroup for the container

View file

@ -17,7 +17,7 @@ parent = "smn_cli"
-a, --attach=[] Attach to STDIN, STDOUT or STDERR -a, --attach=[] Attach to STDIN, STDOUT or STDERR
--add-host=[] Add a custom host-to-IP mapping (host:ip) --add-host=[] Add a custom host-to-IP mapping (host:ip)
--blkio-weight=0 Block IO weight (relative weight) --blkio-weight=0 Block IO weight (relative weight)
-c, --cpu-shares=0 CPU shares (relative weight) --cpu-shares=0 CPU shares (relative weight)
--cap-add=[] Add Linux capabilities --cap-add=[] Add Linux capabilities
--cap-drop=[] Drop Linux capabilities --cap-drop=[] Drop Linux capabilities
--cgroup-parent="" Optional parent cgroup for the container --cgroup-parent="" Optional parent cgroup for the container
@ -562,4 +562,4 @@ application change:
5. Finally, we create a container that runs `tail -f access.log` using the logs 5. Finally, we create a container that runs `tail -f access.log` using the logs
volume from the `web` container, setting the workdir to `/var/log/httpd`. The volume from the `web` container, setting the workdir to `/var/log/httpd`. The
`--rm` option means that when the container exits, the container's layer is `--rm` option means that when the container exits, the container's layer is
removed. removed.

View file

@ -7,7 +7,7 @@ docker-build - Build a new image from the source code at PATH
# SYNOPSIS # SYNOPSIS
**docker build** **docker build**
[**--build-arg**[=*[]*]] [**--build-arg**[=*[]*]]
[**-c**|**--cpu-shares**[=*0*]] [**--cpu-shares**[=*0*]]
[**--cgroup-parent**[=*CGROUP-PARENT*]] [**--cgroup-parent**[=*CGROUP-PARENT*]]
[**--help**] [**--help**]
[**-f**|**--file**[=*PATH/Dockerfile*]] [**-f**|**--file**[=*PATH/Dockerfile*]]
@ -90,7 +90,7 @@ set as the **URL**, the repository is cloned locally and then sent as the contex
**--memory-swap**=*MEMORY-SWAP* **--memory-swap**=*MEMORY-SWAP*
Total memory (memory + swap), '-1' to disable swap. Total memory (memory + swap), '-1' to disable swap.
**-c**, **--cpu-shares**=*0* **--cpu-shares**=*0*
CPU shares (relative weight). CPU shares (relative weight).
By default, all containers get the same proportion of CPU cycles. By default, all containers get the same proportion of CPU cycles.

View file

@ -9,7 +9,7 @@ docker-create - Create a new container
[**-a**|**--attach**[=*[]*]] [**-a**|**--attach**[=*[]*]]
[**--add-host**[=*[]*]] [**--add-host**[=*[]*]]
[**--blkio-weight**[=*[BLKIO-WEIGHT]*]] [**--blkio-weight**[=*[BLKIO-WEIGHT]*]]
[**-c**|**--cpu-shares**[=*0*]] [**--cpu-shares**[=*0*]]
[**--cap-add**[=*[]*]] [**--cap-add**[=*[]*]]
[**--cap-drop**[=*[]*]] [**--cap-drop**[=*[]*]]
[**--cgroup-parent**[=*CGROUP-PATH*]] [**--cgroup-parent**[=*CGROUP-PATH*]]
@ -83,7 +83,7 @@ The initial status of the container created with **docker create** is 'created'.
**--blkio-weight**=0 **--blkio-weight**=0
Block IO weight (relative weight) accepts a weight value between 10 and 1000. Block IO weight (relative weight) accepts a weight value between 10 and 1000.
**-c**, **--cpu-shares**=0 **--cpu-shares**=0
CPU shares (relative weight) CPU shares (relative weight)
**--cap-add**=[] **--cap-add**=[]

View file

@ -9,7 +9,7 @@ docker-run - Run a command in a new container
[**-a**|**--attach**[=*[]*]] [**-a**|**--attach**[=*[]*]]
[**--add-host**[=*[]*]] [**--add-host**[=*[]*]]
[**--blkio-weight**[=*[BLKIO-WEIGHT]*]] [**--blkio-weight**[=*[BLKIO-WEIGHT]*]]
[**-c**|**--cpu-shares**[=*0*]] [**--cpu-shares**[=*0*]]
[**--cap-add**[=*[]*]] [**--cap-add**[=*[]*]]
[**--cap-drop**[=*[]*]] [**--cap-drop**[=*[]*]]
[**--cgroup-parent**[=*CGROUP-PATH*]] [**--cgroup-parent**[=*CGROUP-PATH*]]
@ -100,14 +100,14 @@ option can be set multiple times.
**--blkio-weight**=0 **--blkio-weight**=0
Block IO weight (relative weight) accepts a weight value between 10 and 1000. Block IO weight (relative weight) accepts a weight value between 10 and 1000.
**-c**, **--cpu-shares**=0 **--cpu-shares**=0
CPU shares (relative weight) CPU shares (relative weight)
By default, all containers get the same proportion of CPU cycles. This proportion By default, all containers get the same proportion of CPU cycles. This proportion
can be modified by changing the container's CPU share weighting relative can be modified by changing the container's CPU share weighting relative
to the weighting of all other running containers. to the weighting of all other running containers.
To modify the proportion from the default of 1024, use the **-c** or **--cpu-shares** To modify the proportion from the default of 1024, use the **--cpu-shares**
flag to set the weighting to 2 or higher. flag to set the weighting to 2 or higher.
The proportion will only apply when CPU-intensive processes are running. The proportion will only apply when CPU-intensive processes are running.