Commit Graph

70 Commits

Author SHA1 Message Date
2b3cea2450 Merge pull request #28445 from cpuguy83/28439_fix_client_rm_on_old_daemons
Handle `run --rm` against older daemons on the cli
Upstream-commit: 1318c8dcb4
Component: cli
2016-11-22 14:25:03 +01:00
a08156a072 fix incorrect ErrConnectFailed comparison
Signed-off-by: Reficul <xuzhenglun@gmail.com>
Upstream-commit: 14770269e8
Component: cli
2016-11-22 10:42:55 +08:00
e727185cfe Handle run --rm against older daemons on the cli
For previous versions of Docker, `--rm` was handled client side, as such
there was no support in the daemon for it.
Now it is handled daemon side, but we still need to handle the case of a
newer client talking to an older daemon.

Falls back to client-side removal when the daemon does not support it.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 4632a029d9
Component: cli
2016-11-21 20:39:04 -05:00
c539a33a54 Merge pull request #28347 from yongtang/28339-ignore-unkwnon-field-template
Use `map[string]bool` for `preProcessor` to ignore unknown fields
Upstream-commit: e59facceb7
Component: cli
2016-11-17 15:13:02 -08:00
7487e32054 refactor help func in CLI
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: 55908f8a82
Component: cli
2016-11-17 10:54:10 -08:00
75b9b9e6bd Use map[string]bool for preProcessor to ignore unknwon field
This fix is an attempt to address the issue raised in 28339. In
`docker ps`, the formatter needs to expose all fields of `types.Container`
to `preProcessor` so that template could be executed.

This direct exposing is unreliable and could cause issues as user may incorrectly
assume all fields in `types.Container` will be available for templating.

However, the purpose of `preProcessor` is to only find out if `.Size`
is defined (so that opts.size could be set accordingly).

This fix defines `preProcessor` as `map[string]bool` with a func `Size()`.
In this way, any unknown fields will be ignored.

This fix adds several test cases to the existing `TestBuildContainerListOptions`.

This fix fixes 28339.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 3c56459801
Component: cli
2016-11-16 13:23:47 -08:00
2036ffc43b Fix issue with missing fields for ps template
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: d3169abc3b
Component: cli
2016-11-12 11:23:21 -05:00
f1ed942575 context.Context should be the first parameter of a function
Signed-off-by: yupeng <yu.peng36@zte.com.cn>
Upstream-commit: 0f6af2074c
Component: cli
2016-11-12 14:14:34 +08:00
a99e0f963e Merge pull request #28231 from yuexiao-wang/container-exec
Remove redundant parameter and fix typos
Upstream-commit: 005a3037de
Component: cli
2016-11-11 09:55:42 +08:00
16caab97a6 Merge pull request #27797 from vdemeester/stats-format-names-support
Add support for Names and ID in stats format
Upstream-commit: 6bf79deab5
Component: cli
2016-11-10 13:26:00 -08:00
31f3e07b0b Remove redundant parameter and fix typos
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: b6fe99530c
Component: cli
2016-11-10 11:05:31 +08:00
d1e699cd15 Merge pull request #27947 from milindchawre/fix_27798
Fixes #27798 : Update help for --blkio-weight parameter
Upstream-commit: 2332454882
Component: cli
2016-11-09 15:35:38 +01:00
cc55a23f4c Update function name for TestCalculBlockIO
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: 18caa28b66
Component: cli
2016-11-09 17:43:10 +08:00
307edac963 always add but hide experimental cmds and flags
Signed-off-by: Victor Vieux <vieux@docker.com>

update cobra and use Tags

Signed-off-by: Victor Vieux <vieux@docker.com>

allow client to talk to an older server

Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 4ae7176ffb
Component: cli
2016-11-08 04:55:27 -08:00
4cd3911d13 context.Context should be the first parameter of a function
Signed-off-by: yupeng <yu.peng36@zte.com.cn>
Upstream-commit: 7113bbf2c6
Component: cli
2016-11-08 14:51:17 +08:00
75f0b0b043 update cobra and use Tags
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 1e10649f55
Component: cli
2016-11-04 12:04:14 -07:00
25608ce8d4 always add but hide experimental cmds and flags
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: eb522dac24
Component: cli
2016-11-03 17:31:12 -07:00
a3d3423005 fix double [y/N] in container prune
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 3014d36cd9
Component: cli
2016-11-03 10:33:17 -07:00
1e7ea7f047 Fixes #27798 : Update help for --blkio-weight parameter
Signed-off-by: milindchawre <milindchawre@gmail.com>
Upstream-commit: ec7d9291b8
Component: cli
2016-11-03 06:42:15 +00:00
b5f18791bf Add support for Names and ID in stats format
This adds support to display names or id of container instead of what
was provided in the request.

This keeps the default behavior (`docker stats byname` will display
`byname` in the `CONTAINER` colmun and `docker stats byid` will display
the id in the `CONTAINER` column) but adds two new format directive.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 07f77b78ea
Component: cli
2016-11-03 07:20:46 +01:00
7caa97e5c7 Merge pull request #27948 from WeiZhang555/consistent-filters
Replace all "Filter" field with "Filters" for consistency
Upstream-commit: 81e6e5e36d
Component: cli
2016-11-02 00:53:15 -07:00
bee99c14d9 Merge pull request #27864 from vdemeester/add-statsformat-to-configfile
Add StatsFormat to the config.json file
Upstream-commit: 63719e1a24
Component: cli
2016-11-01 20:32:13 -07:00
ca8b6d0b28 Replace all "Filter" field with "Filters" for consistency
In file `api/types/client.go`, some of the "*Options{}" structs own a
`Filters` field while some else have the name of `Filter`, this commit
will rename all `Filter` to `Filters` for consistency. Also `Filters`
is consistent with API with format `/xxx?filters=xxx`, that's why
`Filters` is the right name.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 9eceaa926f
Component: cli
2016-11-01 23:09:30 +08:00
5175d100a2 Generate container create response from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: e7e0837702
Component: cli
2016-10-31 11:16:02 -04:00
e527c56131 Add StatsFormat to the config.json file
As for `ps`, `images`, `network ls` and `volume ls`, this makes it
possible to define a custom default format.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 908aa5b408
Component: cli
2016-10-28 11:48:25 -07:00
5099913cf9 Allow providing a custom storage directory for docker checkpoints
Signed-off-by: boucher <rboucher@gmail.com>
Upstream-commit: 5ddcbc3c00
Component: cli
2016-10-28 07:56:05 -04:00
38aff80fff Merge pull request #27759 from Microsoft/jjh/fixstats
Windows: Fix stats CLI
Upstream-commit: 3b4084cb50
Component: cli
2016-10-26 18:17:18 -07:00
46742b9fba Implementing support for --cpu-rt-period and --cpu-rt-runtime so that
containers may specify these cgroup values at runtime. This will allow
processes to change their priority to real-time within the container
when CONFIG_RT_GROUP_SCHED is enabled in the kernel. See #22380.

Also added sanity checks for the new --cpu-rt-runtime and --cpu-rt-period
flags to ensure that that the kernel supports these features and that
runtime is not greater than period.

Daemon will support a --cpu-rt-runtime flag to initialize the parent
cgroup on startup, this prevents the administrator from alotting runtime
to docker after each restart.

There are additional checks that could be added but maybe too far? Check
parent cgroups to ensure values are <= parent, inspecting rtprio ulimit
and issuing a warning.

Signed-off-by: Erik St. Martin <alakriti@gmail.com>
Upstream-commit: 4f320d7c2a
Component: cli
2016-10-26 11:33:06 -04:00
84e8a755f4 Windows: Fix stats CLI
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: dff7842790
Component: cli
2016-10-25 19:57:47 -07:00
2451915c27 Make experimental a runtime flag
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 66bd963b76
Component: cli
2016-10-24 15:20:01 -07:00
fe241a941a Merge pull request #27564 from mlaventure/add-networks-format-to-ps
Add Networks placeholder to ps --format
Upstream-commit: 85a65c7536
Component: cli
2016-10-20 18:43:46 -07:00
b2507ea973 Add Networks placeholder to ps --format
Passing {{.Networks}} to the format parameter will prompt ps to
display all the networks the container is connected to.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 08ac5a3039
Component: cli
2016-10-20 07:41:56 -07:00
3a00f9dfc7 Exec: Add ability to set environment variables
Keeping the current behavior for exec, i.e., inheriting
variables from main process. New variables will be added
to current ones. If there's already a variable with that
name it will be overwritten.

Example of usage: docker exec -it -e TERM=vt100 <container> top

Closes #24355.

Signed-off-by: Jonh Wendell <jonh.wendell@redhat.com>
Upstream-commit: a528b05dab
Component: cli
2016-10-19 12:39:25 -02:00
cb9c9cdbfa Merge pull request #27476 from yuexiao-wang/fix-typos-volume
Fix some typos
Upstream-commit: 879b4d1fba
Component: cli
2016-10-18 13:50:20 +01:00
1f163ad243 Merge pull request #27478 from allencloud/wrap-line-in-deleted-containers
wrap line in deleted containers when pruning
Upstream-commit: d52f04b7c1
Component: cli
2016-10-18 13:48:44 +01:00
655c82e562 Fix typs from go to Go
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: 24d0191a3a
Component: cli
2016-10-18 19:40:16 +08:00
52dbab66cb wrap line in deleted containers when pruning
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 093072cc18
Component: cli
2016-10-18 14:20:12 +08:00
a195f2d433 Update docker stop and docker restart to allow not specifying timeout and use the one specified at container creation time.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: c424fb0e3d
Component: cli
2016-10-17 12:53:35 -07:00
17ee92cc91 Merge pull request #26819 from ripcurld00d/fix_stats_mutex
Hide the mutex lock in formatter.ContainerStats
Upstream-commit: bfe16dcfe2
Component: cli
2016-10-13 17:38:22 -07:00
1c68035702 Hide the mutex in formatter.ContainerStats
The formatter.ContainerStats struct exposes its Mutex.
This is a bad design and should be fixed.

To fix that, I separated the statistics
attributes from ContainerStats to StatsEntry and
hid the mutex. Notice that the mutex protects both
the `err` field and the statistics attributes.

Then, implemented SetStatistics, SetError, GetStatistics
and GetError to avoid races.

Moreover, to make this less granular, I decided to
replace the read-write mutex with the regular mutex and
to pass a StatsEntry slice to formatter.ContainerStatsWrite

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: 3bc50c45ba
Component: cli
2016-10-10 21:52:53 +03:00
b9c5442c91 better prune and system df
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 871b692833
Component: cli
2016-10-11 00:42:21 +08:00
879f289e5a Merge pull request #26778 from WeiZhang555/parallel-operations
Support parallel kill,rm
Upstream-commit: 0c6d66b89a
Component: cli
2016-10-10 18:31:10 +02:00
7f7622756e Add the OPTIONS and Fix the links for contain prune
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: 80bc917226
Component: cli
2016-10-11 00:13:33 +08:00
c80b266f91 Add subcommand prune to the container, volume, image and system commands
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 6f8bb41ecb
Component: cli
2016-09-29 07:42:53 -07:00
cf39dde222 Support parallel rm
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 5c1362ce59
Component: cli
2016-09-28 12:07:18 +08:00
03427eb002 Support parallel kill
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: f612b93d33
Component: cli
2016-09-28 12:03:19 +08:00
37441dedaa Refactor to new events api
Signed-off-by: Josh Horwitz <horwitzja@gmail.com>
Upstream-commit: d700b90576
Component: cli
2016-09-22 14:42:06 -04:00
79df3ddbda Merge pull request #24987 from ripcurld00d/stats_format_prod
Add format to stats
Upstream-commit: 685613f6c9
Component: cli
2016-09-21 10:38:21 -04:00
e5fc4c58fb Revert Box from HostConfig
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 1385ad8b00
Component: cli
2016-09-20 12:01:04 -07:00
3deff1380d Merge pull request #26579 from Microsoft/jjh/ociprocess
Windows: OCI `process` struct and console size to uint
Upstream-commit: 889980d6e3
Component: cli
2016-09-19 22:52:16 +02:00