diff --git a/docs/misc/deprecated.md b/docs/misc/deprecated.md index 622f77a27c..018787bf0a 100644 --- a/docs/misc/deprecated.md +++ b/docs/misc/deprecated.md @@ -12,6 +12,16 @@ parent = "mn_use_docker" The following list of features are deprecated. +### Command line short variant options +**Deprecated In Release: v1.9** + +**Target For Removal In Release: v1.11** + +The following short variant options are deprecated in favor of their long +variants: + + docker run -c (--cpu-shares) + ### Driver Specific Log Tags **Deprecated In Release: v1.9** @@ -23,8 +33,6 @@ Because of which, the driver specific log tag options `syslog-tag`, `gelf-tag` a docker --log-driver=syslog --log-opt tag="{{.ImageName}}/{{.Name}}/{{.ID}}" - - ### LXC built-in exec driver **Deprecated In Release: v1.8** diff --git a/integration-cli/docker_cli_run_unix_test.go b/integration-cli/docker_cli_run_unix_test.go index 71ceb525f5..3b228d31a5 100644 --- a/integration-cli/docker_cli_run_unix_test.go +++ b/integration-cli/docker_cli_run_unix_test.go @@ -217,9 +217,9 @@ func (s *DockerSuite) TestRunWithKernelMemory(c *check.C) { // "test" should be printed func (s *DockerSuite) TestRunEchoStdoutWitCPUShares(c *check.C) { testRequires(c, cpuShare) - out, _ := dockerCmd(c, "run", "-c", "1000", "busybox", "echo", "test") + out, _ := dockerCmd(c, "run", "--cpu-shares", "1000", "busybox", "echo", "test") if out != "test\n" { - c.Errorf("container should've printed 'test'") + c.Errorf("container should've printed 'test', got %q instead", out) } } @@ -227,7 +227,7 @@ func (s *DockerSuite) TestRunEchoStdoutWitCPUShares(c *check.C) { func (s *DockerSuite) TestRunEchoStdoutWithCPUSharesAndMemoryLimit(c *check.C) { testRequires(c, cpuShare) testRequires(c, memoryLimitSupport) - out, _, _ := dockerCmdWithStdoutStderr(c, "run", "-c", "1000", "-m", "16m", "busybox", "echo", "test") + out, _ := dockerCmd(c, "run", "--cpu-shares", "1000", "-m", "16m", "busybox", "echo", "test") if out != "test\n" { c.Errorf("container should've printed 'test', got %q instead", out) } @@ -291,7 +291,7 @@ func (s *DockerSuite) TestRunOOMExitCode(c *check.C) { // "test" should be printed func (s *DockerSuite) TestRunEchoStdoutWithMemoryLimit(c *check.C) { testRequires(c, memoryLimitSupport) - out, _, _ := dockerCmdWithStdoutStderr(c, "run", "-m", "16m", "busybox", "echo", "test") + out, _ := dockerCmd(c, "run", "-m", "16m", "busybox", "echo", "test") out = strings.Trim(out, "\r\n") if expected := "test"; out != expected { diff --git a/runconfig/parse.go b/runconfig/parse.go index e3c17bca70..3fff16ad76 100644 --- a/runconfig/parse.go +++ b/runconfig/parse.go @@ -80,7 +80,7 @@ func Parse(cmd *flag.FlagSet, args []string) (*Config, *HostConfig, *flag.FlagSe flKernelMemory = cmd.String([]string{"-kernel-memory"}, "", "Kernel memory limit") flUser = cmd.String([]string{"u", "-user"}, "", "Username or UID (format: [:])") flWorkingDir = cmd.String([]string{"w", "-workdir"}, "", "Working directory inside the container") - 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 CPU CFS (Completely Fair Scheduler) period") flCPUQuota = cmd.Int64([]string{"-cpu-quota"}, 0, "Limit CPU CFS (Completely Fair Scheduler) quota") flCpusetCpus = cmd.String([]string{"#-cpuset", "-cpuset-cpus"}, "", "CPUs in which to allow execution (0-3, 0,1)")