Commit Graph

70 Commits

Author SHA1 Message Date
Vincent Demeester 1318c8dcb4 Merge pull request #28445 from cpuguy83/28439_fix_client_rm_on_old_daemons
Handle `run --rm` against older daemons on the cli
2016-11-22 14:25:03 +01:00
Reficul 14770269e8 fix incorrect ErrConnectFailed comparison
Signed-off-by: Reficul <xuzhenglun@gmail.com>
2016-11-22 10:42:55 +08:00
Brian Goff 4632a029d9 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>
2016-11-21 20:39:04 -05:00
Michael Crosby e59facceb7 Merge pull request #28347 from yongtang/28339-ignore-unkwnon-field-template
Use `map[string]bool` for `preProcessor` to ignore unknown fields
2016-11-17 15:13:02 -08:00
Victor Vieux 55908f8a82 refactor help func in CLI
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-17 10:54:10 -08:00
Yong Tang 3c56459801 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>
2016-11-16 13:23:47 -08:00
Brian Goff d3169abc3b Fix issue with missing fields for `ps` template
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-11-12 11:23:21 -05:00
yupeng 0f6af2074c context.Context should be the first parameter of a function
Signed-off-by: yupeng <yu.peng36@zte.com.cn>
2016-11-12 14:14:34 +08:00
Lei Jitang 005a3037de Merge pull request #28231 from yuexiao-wang/container-exec
Remove redundant parameter and fix typos
2016-11-11 09:55:42 +08:00
Michael Crosby 6bf79deab5 Merge pull request #27797 from vdemeester/stats-format-names-support
Add support for Names and ID in stats format
2016-11-10 13:26:00 -08:00
yuexiao-wang b6fe99530c Remove redundant parameter and fix typos
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-11-10 11:05:31 +08:00
Vincent Demeester 2332454882 Merge pull request #27947 from milindchawre/fix_27798
Fixes #27798 : Update help for --blkio-weight parameter
2016-11-09 15:35:38 +01:00
yuexiao-wang 18caa28b66 Update function name for TestCalculBlockIO
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-11-09 17:43:10 +08:00
Victor Vieux 4ae7176ffb 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>
2016-11-08 04:55:27 -08:00
yupeng 7113bbf2c6 context.Context should be the first parameter of a function
Signed-off-by: yupeng <yu.peng36@zte.com.cn>
2016-11-08 14:51:17 +08:00
Victor Vieux 1e10649f55 update cobra and use Tags
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-11-04 12:04:14 -07:00
Victor Vieux eb522dac24 always add but hide experimental cmds and flags
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-11-03 17:31:12 -07:00
Victor Vieux 3014d36cd9 fix double [y/N] in container prune
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-11-03 10:33:17 -07:00
milindchawre ec7d9291b8 Fixes #27798 : Update help for --blkio-weight parameter
Signed-off-by: milindchawre <milindchawre@gmail.com>
2016-11-03 06:42:15 +00:00
Vincent Demeester 07f77b78ea 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>
2016-11-03 07:20:46 +01:00
Sebastiaan van Stijn 81e6e5e36d Merge pull request #27948 from WeiZhang555/consistent-filters
Replace all "Filter" field with "Filters" for consistency
2016-11-02 00:53:15 -07:00
Sebastiaan van Stijn 63719e1a24 Merge pull request #27864 from vdemeester/add-statsformat-to-configfile
Add StatsFormat to the config.json file
2016-11-01 20:32:13 -07:00
Zhang Wei 9eceaa926f 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>
2016-11-01 23:09:30 +08:00
Daniel Nephin e7e0837702 Generate container create response from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-10-31 11:16:02 -04:00
Vincent Demeester 908aa5b408 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>
2016-10-28 11:48:25 -07:00
boucher 5ddcbc3c00 Allow providing a custom storage directory for docker checkpoints
Signed-off-by: boucher <rboucher@gmail.com>
2016-10-28 07:56:05 -04:00
Sebastiaan van Stijn 3b4084cb50 Merge pull request #27759 from Microsoft/jjh/fixstats
Windows: Fix stats CLI
2016-10-26 18:17:18 -07:00
Erik St. Martin 4f320d7c2a 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>
2016-10-26 11:33:06 -04:00
John Howard dff7842790 Windows: Fix stats CLI
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-10-25 19:57:47 -07:00
Kenfe-Mickael Laventure 66bd963b76 Make experimental a runtime flag
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-10-24 15:20:01 -07:00
Victor Vieux 85a65c7536 Merge pull request #27564 from mlaventure/add-networks-format-to-ps
Add Networks placeholder to ps --format
2016-10-20 18:43:46 -07:00
Kenfe-Mickael Laventure 08ac5a3039 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>
2016-10-20 07:41:56 -07:00
Jonh Wendell a528b05dab 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>
2016-10-19 12:39:25 -02:00
Justin Cormack 879b4d1fba Merge pull request #27476 from yuexiao-wang/fix-typos-volume
Fix some typos
2016-10-18 13:50:20 +01:00
Justin Cormack d52f04b7c1 Merge pull request #27478 from allencloud/wrap-line-in-deleted-containers
wrap line in deleted containers when pruning
2016-10-18 13:48:44 +01:00
yuexiao-wang 24d0191a3a Fix typs from go to Go
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-10-18 19:40:16 +08:00
allencloud 093072cc18 wrap line in deleted containers when pruning
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-10-18 14:20:12 +08:00
Yong Tang c424fb0e3d 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>
2016-10-17 12:53:35 -07:00
Sebastiaan van Stijn bfe16dcfe2 Merge pull request #26819 from ripcurld00d/fix_stats_mutex
Hide the mutex lock in formatter.ContainerStats
2016-10-13 17:38:22 -07:00
Boaz Shuster 3bc50c45ba 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>
2016-10-10 21:52:53 +03:00
allencloud 871b692833 better prune and system df
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-10-11 00:42:21 +08:00
Sebastiaan van Stijn 0c6d66b89a Merge pull request #26778 from WeiZhang555/parallel-operations
Support parallel kill,rm
2016-10-10 18:31:10 +02:00
yuexiao-wang 80bc917226 Add the OPTIONS and Fix the links for contain prune
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-10-11 00:13:33 +08:00
Kenfe-Mickael Laventure 6f8bb41ecb Add subcommand prune to the container, volume, image and system commands
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-09-29 07:42:53 -07:00
Zhang Wei 5c1362ce59 Support parallel rm
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-09-28 12:07:18 +08:00
Zhang Wei f612b93d33 Support parallel kill
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-09-28 12:03:19 +08:00
Josh Horwitz d700b90576 Refactor to new events api
Signed-off-by: Josh Horwitz <horwitzja@gmail.com>
2016-09-22 14:42:06 -04:00
Daniel Nephin 685613f6c9 Merge pull request #24987 from ripcurld00d/stats_format_prod
Add format to stats
2016-09-21 10:38:21 -04:00
John Howard 1385ad8b00 Revert Box from HostConfig
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-20 12:01:04 -07:00
Sebastiaan van Stijn 889980d6e3 Merge pull request #26579 from Microsoft/jjh/ociprocess
Windows: OCI `process` struct and console size to uint
2016-09-19 22:52:16 +02:00