DockerCLI/command/container
Sebastiaan van Stijn 35de37289b Don't use AutoRemove on older daemons
Docker 1.13 moves the `--rm` flag to the daemon,
through an AutoRemove option in HostConfig.

When using API 1.24 and under, AutoRemove should not be
used, even if the daemon is version 1.13 or above and
"supports" this feature.

This patch fixes a situation where an 1.13 client,
talking to an 1.13 daemon, but using the 1.24 API
version, still set the AutoRemove property.

As a result, both the client _and_ the daemon
were attempting to remove the container, resulting
in an error:

    ERRO[0000] error removing container: Error response from daemon:
    removal of container ce0976ad22495c7cbe9487752ea32721a282164862db036b2f3377bd07461c3a
    is already in progress

In addition, the validation of conflicting options
is moved from `docker run` to `opts.parse()`, so
that conflicting options are also detected when
running `docker create` and `docker start` separately.

To resolve the issue, the `AutoRemove` option is now
always set to `false` both by the client and the
daemon, if API version 1.24 or under is used.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-01-15 01:59:57 +01:00
..
testdata Clean some stuff from runconfig that are cli only… 2016-12-24 13:16:00 +01:00
attach.go Minor cleanups in cli/command/container 2016-12-26 01:33:25 +01:00
cmd.go Minor cleanups in cli/command/container 2016-12-26 01:33:25 +01:00
commit.go Minor cleanups in cli/command/container 2016-12-26 01:33:25 +01:00
cp.go Minor cleanups in cli/command/container 2016-12-26 01:33:25 +01:00
create.go Merge pull request #29683 from vdemeester/runconfig-clean 2016-12-29 17:42:08 +01:00
diff.go Minor cleanups in cli/command/container 2016-12-26 01:33:25 +01:00
exec.go Merge pull request #29683 from vdemeester/runconfig-clean 2016-12-29 17:42:08 +01:00
exec_test.go Remove redundant parameter and fix typos 2016-11-10 11:05:31 +08:00
export.go Minor cleanups in cli/command/container 2016-12-26 01:33:25 +01:00
hijack.go Move image trust related cli methods into the image package. 2016-09-09 10:50:16 -04:00
inspect.go Minor cleanups in cli/command/container 2016-12-26 01:33:25 +01:00
kill.go Minor cleanups in cli/command/container 2016-12-26 01:33:25 +01:00
list.go Minor cleanups in cli/command/container 2016-12-26 01:33:25 +01:00
logs.go Merge pull request #29688 from tronicum/since-flag 2017-01-09 09:27:30 -05:00
opts.go Don't use AutoRemove on older daemons 2017-01-15 01:59:57 +01:00
opts_test.go Don't use AutoRemove on older daemons 2017-01-15 01:59:57 +01:00
pause.go Minor cleanups in cli/command/container 2016-12-26 01:33:25 +01:00
port.go Minor cleanups in cli/command/container 2016-12-26 01:33:25 +01:00
prune.go Add `--filter until=<timestamp>` for `docker container/image prune` 2017-01-04 14:16:42 -08:00
ps_test.go Use `map[string]bool` for `preProcessor` to ignore unknwon field 2016-11-16 13:23:47 -08:00
rename.go Minor cleanups in cli/command/container 2016-12-26 01:33:25 +01:00
restart.go Minor cleanups in cli/command/container 2016-12-26 01:33:25 +01:00
rm.go Minor cleanups in cli/command/container 2016-12-26 01:33:25 +01:00
run.go Don't use AutoRemove on older daemons 2017-01-15 01:59:57 +01:00
start.go Minor cleanups in cli/command/container 2016-12-26 01:33:25 +01:00
stats.go Minor cleanups in cli/command/container 2016-12-26 01:33:25 +01:00
stats_helpers.go context.Context should be the first parameter of a function 2016-11-12 14:14:34 +08:00
stats_unit_test.go Update function name for TestCalculBlockIO 2016-11-09 17:43:10 +08:00
stop.go Minor cleanups in cli/command/container 2016-12-26 01:33:25 +01:00
top.go Minor cleanups in cli/command/container 2016-12-26 01:33:25 +01:00
tty.go Windows: OCI process struct convergence 2016-09-19 10:34:31 -07:00
unpause.go Minor cleanups in cli/command/container 2016-12-26 01:33:25 +01:00
update.go Minor cleanups in cli/command/container 2016-12-26 01:33:25 +01:00
utils.go Minor cleanups in cli/command/container 2016-12-26 01:33:25 +01:00
wait.go Minor cleanups in cli/command/container 2016-12-26 01:33:25 +01:00