Commit graph

938 commits

Author SHA1 Message Date
Vincent Demeester
89011970e0 Merge pull request #27654 from gaocegege/add-quiet-mode-to-service-ps
Add -q option to `docker service ps`
2016-10-28 05:21:03 +02:00
Ce Gao
9efa472bd1 fixes #27643
Signed-off-by: Ce Gao <ce.gao@outlook.com>
2016-10-28 08:02:57 +08:00
Sebastiaan van Stijn
3a3a87bff8 Merge pull request #26988 from thaJeztah/remove-service-update-name-flag
Remove service update name flag
2016-10-27 16:55:47 -07:00
Sebastiaan van Stijn
a3525d6f1f Merge pull request #27701 from ripcurld00d/unit_test_formatter_stats
Add unit tests to cli/command/formatter/stats.go
2016-10-27 15:10:47 -07:00
Yong Tang
ee3105c68a Add --env-file flag to docker create service
This fix tries to address the issue in 24712 and add
`--env-file` file to `docker create service`.

Related documentation has been updated.

An additional integration has been added.

This fix fixes 24712.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-10-27 11:48:32 -07:00
Sebastiaan van Stijn
047e44eeb1 Remove --name flag from service update
The --name flag was inadvertently added to
docker service update, but is not supported,
as it has various side-effects (e.g., existing
tasks are not renamed).

This removes the flag from the service update
command.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-10-27 09:16:29 -07:00
Boaz Shuster
51fb35f0b0 Add unit tests to cli/command/formatter/stats.go
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2016-10-27 18:00:38 +03:00
Sebastiaan van Stijn
2428534998 Merge pull request #27759 from Microsoft/jjh/fixstats
Windows: Fix stats CLI
2016-10-26 18:17:18 -07:00
Erik St. Martin
56f77d5ade 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
Sebastiaan van Stijn
62ff3e9083 Merge pull request #27702 from tonistiigi/net-builder0
add --network option for docker build
2016-10-25 21:50:33 -07:00
John Howard
2894d07696 Windows: Fix stats CLI
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-10-25 19:57:47 -07:00
sandyskies
60813af7ae add --network option for docker build
Signed-off-by: sandyskies <chenmingjie0828@163.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-10-25 10:25:36 -07:00
Akihiro Suda
7e24c16086 add docker network prune
`docker network prune` prunes unused networks, including overlay ones.
`docker system prune` also prunes unused networks.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-10-25 06:43:54 +00:00
Sebastiaan van Stijn
411e7b4416 Merge pull request #24533 from yongtang/24392-docker-info-label-duplicate-keys
Remove duplicate keys in labels of `docker info`
2016-10-24 18:12:28 -07:00
Vincent Demeester
ec30cf4f14 Merge pull request #27697 from amitkris/fix_units_import
Correct go-units import in cli/command/formatter/stats.go
2016-10-24 16:59:15 -07:00
Kenfe-Mickael Laventure
7781a1bf0f Make experimental a runtime flag
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-10-24 15:20:01 -07:00
Amit Krishnan
cf8a667b8d Correct go-units import in cli/command/formatter/stats.go
from src/github.com/docker/go-units -> github.com/docker/go-units

Signed-off-by: Amit Krishnan <krish.amit@gmail.com>
2016-10-24 15:06:58 -07:00
Vincent Demeester
9058ec3be5 Merge pull request #27596 from aaronlehmann/rolling-restart
Add force option to service update
2016-10-22 13:37:12 +02:00
Sebastiaan van Stijn
3c385b9f6b Merge pull request #27117 from dnephin/swagger-gen
Add swagger.yaml and generate a few types from the spec
2016-10-21 18:15:28 -07:00
Aaron Lehmann
c9fdf9abf8 Add force option to service update
Currently, there's no way to restart the tasks of a service without
making an actual change to the service. This leads to us giving awkward
workarounds as in
https://github.com/docker/docker.github.io/pull/178/files, where we tell
people to scale a service up and down to restore balance, or make
unnecessary changes to trigger a restart.

This change adds a --force option to "docker service update", which
forces the service to be updated even if no changes require that.

Since rolling update parameters are respected, the user can use
"docker service --force" to do a rolling restart. For example, the
following is supported:

   docker service update --force --update-parallelism 2 \
   --update-delay 5s myservice

Since the default value of --update-parallelism is 1, the default
behavior is to restart the service one task at a time.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-10-21 17:43:27 -07:00
Victor Vieux
d98f995d7d 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
Tõnis Tiigi
392b816199 Merge pull request #27530 from allencloud/change-join-role-display-judge
change join node role judge
2016-10-20 17:46:08 -07:00
Daniel Nephin
b06c352783 Generate api/types:Image from the swagger spec
and rename it to a more appropriate name ImageSummary.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-10-20 13:24:23 -07:00
Aaron Lehmann
a67a977305 Merge pull request #27516 from allencloud/change-remove-multi-nodes
make every node and plugin removal call api
2016-10-20 10:10:52 -07:00
Kenfe-Mickael Laventure
a43d9bb9c3 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
e03bf1221e 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
allencloud
e41c0370b4 change join node role judge
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-10-19 19:47:42 +08:00
allencloud
c6d57ca076 make every node and plugin removal call api
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-10-19 06:40:30 +08:00
Aaron Lehmann
6d4b527699 Service update failure thresholds and rollback
This adds support for two enhancements to swarm service rolling updates:

- Failure thresholds: In Docker 1.12, a service update could be set up
  to either pause or continue after a single failure occurs. This adds
  an --update-max-failure-ratio flag that controls how many tasks need to
  fail to update for the update as a whole to be considered a failure. A
  counterpart flag, --update-monitor, controls how long to monitor each
  task for a failure after starting it during the update.

- Rollback flag: service update --rollback reverts the service to its
  previous version. If a service update encounters task failures, or
  fails to function properly for some other reason, the user can roll back
  the update.

SwarmKit also has the ability to roll back updates automatically after
hitting the failure thresholds, but we've decided not to expose this in
the Docker API/CLI for now, favoring a workflow where the decision to
roll back is always made by an admin. Depending on user feedback, we may
add a "rollback" option to --update-failure-action in the future.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-10-18 10:09:50 -07:00
Yong Tang
e4c9079d09 Remove duplicate keys in labels of docker info
This fix tries to address the issue raised in 24392 where
labels with duplicate keys exist in `docker info`, which
contradicts with the specifications in the docs.

The reason for duplicate keys is that labels are stored as
slice of strings in the format of `A=B` (and the input/output).

This fix tries to address this issue by checking conflict
labels when daemon started, and remove duplicate labels (K-V).

The existing `/info` API has not been changed.

An additional integration test has been added to cover the
changes in this fix.

This fix fixes 24392.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-10-18 07:45:27 -07:00
Justin Cormack
1feaeac65c Merge pull request #27476 from yuexiao-wang/fix-typos-volume
Fix some typos
2016-10-18 13:50:20 +01:00
Justin Cormack
1643110ef4 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
Vincent Demeester
dad8cbfc2d Merge pull request #22566 from yongtang/22471-daemon-shutdown-timeout
Add config parameter to change per-container stop timeout during daemon shutdown
2016-10-18 14:33:09 +02:00
yuexiao-wang
7dad9d5ce4 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
dcb4d68092 wrap line in deleted containers when pruning
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-10-18 14:20:12 +08:00
Justin Cormack
c028a88158 Merge pull request #26519 from AkihiroSuda/fix-cli-command-formatter-json-support
Fix broken JSON support in cli/command/formatter
2016-10-17 22:44:04 +01:00
Yong Tang
cc703784f3 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
Vincent Demeester
862db3f191
Revert docker volume column name to VOLUME_NAME
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-10-17 20:03:31 +02:00
Vincent Demeester
a7c883fb04 Merge pull request #27074 from cyli/bump-notary-version
Bump notary version to 0.4.2
2016-10-17 16:35:57 +02:00
Akihiro Suda
3a32b58792 Fix broken JSON support in cli/command/formatter
How to test:

    $ docker ps --format '{{json .}}'
    $ docker network ls --format '{{json .}}'
    $ docker volume ls --format '{{json .}}'

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-10-17 08:07:17 +00:00
Vincent Demeester
9f5ffa2a81 Merge pull request #27236 from allencloud/return-nil-when-no-node-or-service
return nil when no node or service to avoid additional api call
2016-10-16 18:41:31 +02:00
cyli
0797af39c2 Fix API incompatibilities between notary v0.3.0 and v0.4.2:
- some function signatures have changed - use the new ones
- re-generate the notary delegation key certs, since notary doesn't allow SHA1
- fix some error message mapping because now if a root rotation fails to validate trusted operations will fail

Signed-off-by: cyli <cyli@twistedmatrix.com>
2016-10-14 17:53:34 -07:00
Yong Tang
1e9d04c458 Allow docker deploy command accept filename with/without extension
This fix tries to address the issue raised in 25855 where the command
`docker deploy` can only accept a STACK without extension of `.dab`.
In other words, `docker deploy hellojavaee.dab` gives an error:
```
Bundle hellojavaee.dab.dab not found. Specify the path with --file
```

This fix updates the way namespace STACK is taken so that in case
`STACK.dab` is provided with `docker deploy`:
```
$ docker deploy STACK.dab
```
The `STACK` is used as namespace (instead of `STACK.dab`).

NOTE: This fix will only allows `.dab` extension in namespace, because
it is not possible to have a namespace with `.` in the middle. In other
words, a namespace `hello.java.ee` will not work anyway (whether the file
`hello.java.ee` exists or not).

An additional integration test has been added to cover the changes.

This fix fixes 25855.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-10-14 11:44:15 -07:00
Sebastiaan van Stijn
66177532b6 Merge pull request #27333 from yongtang/27049-ListOpt
Use ListOpt for `docker network create --label` and `docker volume create --label`
2016-10-14 00:31:09 -07:00
Sebastiaan van Stijn
ba2c13fcf5 Merge pull request #26819 from ripcurld00d/fix_stats_mutex
Hide the mutex lock in formatter.ContainerStats
2016-10-13 17:38:22 -07:00
Alexander Morozov
f1e5349a03 Merge pull request #27338 from yuexiao-wang/instream-err
Fix the incorrect description for NewInStream
2016-10-13 12:32:43 -07:00
Tõnis Tiigi
62503f245f Merge pull request #27276 from yuexiao-wang/func-name
Modify function name from SetDaemonLogLevel to SetLogLevel
2016-10-13 12:10:59 -07:00
yuexiao-wang
90bddb4243 Fix the incorrect description for NewInStream
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-10-13 22:33:09 +08:00
Yong Tang
e3f484241d Use ListOpt for docker network create --label and docker volume create --label
This fix is related to 27049 and 27047. For `--label` flag, if string slice is
used (like 27047), then quote can not be used in command and will result in
an error :
```
line 1, column 14: bare " in non-quoted-field
```

The issue 27047 has been fixed by 27049.

Recently I found out that both `docker network create --label` and `docker volume create --label`
still use string slice and will return the same error when quotes are used.

This fix fixes `docker network create --label` and `docker volume create --label`
by using `ListOpt` (as 27049) as well.

This fix has been tested and verified manually.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-10-12 16:06:34 -07:00
Sebastiaan van Stijn
a7db0a8402 Merge pull request #27294 from mlaventure/hide-unused-volume-fields
Move types.Volumes optional fields under a new type
2016-10-11 23:55:25 +02:00
Kenfe-Mickael Laventure
d36952749d Move types.Volumes optional fields under a new type
This allows us to hide those fields when they are not filled.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-10-11 11:49:26 -07:00
yuexiao-wang
fe3ff54c7a Modify function name from SetDaemonLogLevel to SetLogLevel
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-10-11 19:35:12 +08:00
Sebastiaan van Stijn
f65bf11e26 Merge pull request #26894 from thaJeztah/improve-log-level-help
Improve --log-level help text
2016-10-11 12:35:42 +02:00
allencloud
3af743bb32 return nil when no node or service to avoid additional api call
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-10-11 10:59:16 +08:00
Sebastiaan van Stijn
3197b312d0 Improve --log-level help text
This information was added in
1efc940e6f,
but removed again in
a271eaeba2
to make the help-output fit in a 80-chars
terminal.

This adds the available options again
in the help output, and updates the CLI
reference documentation to match actual
output.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-10-10 23:10:17 +02:00
Boaz Shuster
929a77b814 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
fd62b6c950 better prune and system df
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-10-11 00:42:21 +08:00
Sebastiaan van Stijn
2f12d28084 Merge pull request #26778 from WeiZhang555/parallel-operations
Support parallel kill,rm
2016-10-10 18:31:10 +02:00
yuexiao-wang
6396c62fdc 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
John Howard
e85867cb68 Windows: Support credential specs
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-10-06 09:32:22 -07:00
Alexander Morozov
f08a450ad3 Merge pull request #25837 from reaperhulk/support-compressing-build-context
Add support for compressing build context during image build
2016-10-05 12:57:46 -07:00
Arnaud Porterie
86de7c000f Merge pull request #26108 from mlaventure/data-mngt
New Data Management commands
2016-10-01 03:17:18 +00:00
Paul Kehrer
4825e58a96 Add support for compressing build context during image build
When sending a build context to a remote server it may be
(significantly) advantageous to compress the build context. This commit
adds support for gz compression when constructing a build context
using a command like "docker build --compress ."

Signed-off-by: Paul Kehrer <paul.l.kehrer@gmail.com>
2016-09-30 17:46:08 -05:00
Sebastiaan van Stijn
1b944a3025 Merge pull request #27049 from dnephin/fix-label-flag-type
Use ListOpt for build labels
2016-09-30 23:40:08 +02:00
Kenfe-Mickael Laventure
b650a7bd27 Add new df subcomand to the system command
This command display the state of the data usage of the docker daemon.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-09-30 14:35:23 -07:00
Vincent Demeester
4fabc92cfc Merge pull request #26697 from allencloud/change-service-scale-logic
validate service parameter in client side to avoid api call in `docker service scale`
2016-09-30 18:37:35 +02:00
Daniel Nephin
6c3b44f755 Use ListOpt for labels.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-29 17:59:52 -04:00
Kenfe-Mickael Laventure
280c872366 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
Kenfe-Mickael Laventure
b717de5153 Update Images() to allow retrieving specific image size data
Those data include:
 - size of data shared with other images
 - size of data unique to a given image
 - how many containers are using a given image

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-09-29 07:42:53 -07:00
allencloud
ddec4c3ee4 add \n in engine labels display in docker node inspect xxx --pretty
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-09-29 18:17:54 +08:00
Vincent Demeester
b0e1b8fc79 Merge pull request #24850 from yongtang/24270-service-tasks-filter
Fix partial/full filter issue in `service tasks --filter`
2016-09-28 11:50:27 +02:00
Zhang Wei
2b773257e0 Support parallel rm
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-09-28 12:07:18 +08:00
Zhang Wei
d2bb3aba7e Support parallel kill
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-09-28 12:03:19 +08:00
Brian Goff
9a2f01ef13 Merge pull request #26951 from AkihiroSuda/update-ut-cli-command-service
Fix cli/command/service/opts_test.go, and add some extra test cases
2016-09-27 20:30:26 -04:00
Vincent Demeester
b881148385 Merge pull request #26255 from Microsoft/jjh/xenon-test-infrastructure
Add isolation to info - enables Hyper-V containers CI bring-up
2016-09-27 18:46:51 +02:00
Vincent Demeester
c505486bb1 Merge pull request #26906 from allencloud/add-endpoint-mode-in-service-pretty
add endpoint mode in service pretty
2016-09-27 18:28:43 +02:00
Akihiro Suda
4e01e7924d Fix cli/command/service/opts_test.go, and add some extra test cases
`m.Set("type=volume,target=/foo,volume-nocopy")` is valid even though it lacks "source"

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-09-27 15:27:02 +00:00
Yong Tang
eb19c2f080 Let swarmkit handle cluster defaults in swarm init if not specified
This fix tries to address the issue raised in 24958 where previously
`docker swarm init` will automatically fill in all the default value
(instead of letting swarmkit to handle the default).

This fix update the `swarm init` so that initial value are passed only
when a flag change has been detected.

This fix fixes 24958.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-09-27 04:19:38 -07:00
allencloud
70bb832060 add endpoint mode in service pretty
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-09-27 18:41:19 +08:00
Yong Tang
f676fc93c3 Fix partial/full filter issue in service tasks --filter
This fix tries to address the issue related to 24108 and 24790, and
also the case from 24620#issuecomment-233715656

The reason for the failure case in the above mentioned issues is that
currently Task names are actually indexed by Service Name
(`e.ServiceAnnotations.Name`)

To fix it, a pull request in swarmkit (swarmkit/pull/1193) has been
opened separately.

This fix adds the integration tests for the above mentioned issues.
Swarmkit revendoring is needed to completely fix the issues.

This fix fixes 24108.
This fix fixes 24790.
This fix is related to 24620.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-09-26 16:01:20 -07:00
Sebastiaan van Stijn
a4dd51a660 Merge pull request #23886 from AkihiroSuda/stackcli
add `docker stack ls`
2016-09-26 21:19:04 +02:00
Arnaud Porterie
7944480dd0 Merge pull request #26839 from tonistiigi/build-cache
Implement build cache based on history array
2016-09-26 17:31:49 +00:00
allencloud
5ba203e73a validate service parameter in client side to avoid api call
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-09-26 17:18:02 +08:00
Aaron Lehmann
02cc464e1a cli: Add more nil checking to service pretty-printer
Currently, if the service mode is not "global", this code assumes that
Replicated is non-nil. This assumption may not be true in the future.
Instead of making the assumption, explicitly check that Replicated is
non-nil before using it.

Similarly, for limits and reservations, enclose methods that read from
Limits and Reservations within checks that those fields are non-nil.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-09-26 10:12:24 +01:00
Vincent Demeester
8c929eeb34 Merge pull request #25853 from jhorwit2/jah/event-refactor
Refactor to new engine-api events api
2016-09-24 11:07:12 +02:00
John Howard
c4e1697274 Add isolation to info
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-23 12:13:29 -07:00
Tõnis Tiigi
690882c2e7 Implement build cache based on history array
Based on work by KJ Tsanaktsidis

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: KJ Tsanaktsidis <kjtsanaktsidis@gmail.com>
2016-09-23 11:30:06 -07:00
Vincent Demeester
72f556a9ff Merge pull request #26516 from yongtang/26453-build-bad-syntax
Check bad syntax on dockerfile before building.
2016-09-23 12:24:20 +02:00
Vincent Demeester
c03c80b1b0 Merge pull request #26299 from allencloud/support-docker-node-ps-multi-nodes
support docker node ps multiNodes
2016-09-23 09:50:24 +02:00
Akihiro Suda
5ce08ddfca add docker stack ls
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-09-22 19:31:39 +00:00
Josh Horwitz
d6bd79c18f Refactor to new events api
Signed-off-by: Josh Horwitz <horwitzja@gmail.com>
2016-09-22 14:42:06 -04:00
Misty Stanley-Jones
7b5c3d935a Clarify usage of --force when used on a swarm manager
Fixes #26125

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-21 13:05:33 -07:00
Daniel Nephin
c0699cd4a4 Merge pull request #24987 from ripcurld00d/stats_format_prod
Add format to stats
2016-09-21 10:38:21 -04:00
John Howard
6b74e2f09d Revert Box from HostConfig
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-20 12:01:04 -07:00
Vincent Demeester
a51967cd02 Merge pull request #26716 from dnephin/move-system-commands
Create system  subcommand
2016-09-20 15:54:01 +02:00
Vincent Demeester
00615efced Merge pull request #25025 from cpuguy83/service_inspect_formatter
Add formatter for service inspect
2016-09-20 14:49:45 +02:00
Daniel Nephin
d8c9951707 Merge pull request #26717 from dnephin/fix_experimental_commands
Make all the experimental subcommand consistent
2016-09-19 19:29:48 -04:00
Sebastiaan van Stijn
8c508ef813 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
Daniel Nephin
89ea589d2c Create a system subcommand for events and info.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-19 16:29:17 -04:00
Brian Goff
54ba82beab Add formatter for service inspect
Allows the user to use `pretty` as the format string.
This enables users to put custom format options into their CLI config
just like is supported for `docker ps` and `docker images`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-09-19 16:28:19 -04:00
Daniel Nephin
6eefcea51a Make all the experimental subcommand consistent.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-19 16:27:23 -04:00
John Howard
53774423ff Windows: OCI process struct convergence
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-19 10:34:31 -07:00
Daniel Nephin
a7c8bcac2b Only hide commands if the env variable is set.
Better formatting for usage template.
Group commands in usage to management/operation commands.
Remove the word Docker from the description of management commands.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-19 13:28:15 -04:00
Daniel Nephin
dda198761b Move the search command to the registry package.
And move it back to the top-level command.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-19 13:28:15 -04:00
Daniel Nephin
b993609d5a Move canonical image and container commands into a command group
Hide some top level commands
Add docker container and image inspect commands.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-19 13:28:02 -04:00
Sebastiaan van Stijn
bb6fe56e88 Merge pull request #26268 from AkihiroSuda/eventsjsonl
add `docker events --format`
2016-09-19 17:30:27 +02:00
Boaz Shuster
96622b2a7d Add the format switch to the stats command
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2016-09-18 14:16:13 +03:00
John Howard
4a0419f536 Merge pull request #25737 from Microsoft/jjh-statistics
Windows: Add support for docker stats
2016-09-17 09:31:24 -07:00
Sebastiaan van Stijn
94bc2b1bc0 Merge pull request #26387 from Microsoft/jjh/securityopts
Only output security options if there are any
2016-09-16 23:05:30 +02:00
John Howard
340e5233b2 Windows: stats support
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-16 11:56:15 -07:00
John Howard
dd3d223a7e Only output security options if there are any
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-16 10:05:21 -07:00
Akihiro Suda
5af5a1be62 add docker events --format
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-09-15 09:55:29 +00:00
Yong Tang
c8dc2b156a Check bad syntax on dockerfile before building.
This fix tries to address the issue raised in 26453 where bad syntax
on dockerfile is not checked before building, thus user has to wait
before seeing error in dockerfile.

This fix fixes the issue by evaluating all the instructions and check
syntax before dockerfile is invoked actually.

All existing tests pass.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-09-13 21:43:10 -07:00
Daniel Nephin
e16e9775d4 Fix testcases that expect trailing whitespace
and broken integration tests based of nil pointers

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-13 17:58:12 -04:00
Daniel Nephin
c8336743a4 Refactor formatter.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-13 17:58:12 -04:00
Daniel Nephin
a07be9be38 Use opts.FilterOpt for filter flags.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-13 16:20:10 -04:00
Daniel Nephin
c2decbe5ee Merge pull request #24761 from WeiZhang555/parallel-stop
Enhancement: allow parallel stop, pause, unpause
2016-09-13 10:46:51 -04:00
Yong Tang
54976b718f Fix issue of WARNING: --size ignored for volume for docker inspect
When `docker inspect` is invoked, it is possible to pass a flag of
`-s` for container types to display size information. If `-s` is used
for non-container types then a warning `WARNING: --size ignored for volume`
will show up.

However, currently `WARNING: --size ignored for volume` will show up even
when `-s` is not passed to `docker inspect` for non-container types.

This fix fixes this issue by checking if `-s` has been passed or not (`getSize`).
Also, since image inspect does not support `-s`, `IsSizeSupported` has been changed
to false for images.

This fix is tested manually.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-09-12 23:08:19 -07:00
Zhang Wei
f1dda4395e Add parallel operation support for pause/unpause
Support parallel pause/unpause

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-09-13 11:01:28 +08:00
Zhang Wei
2155b46915 Enhancement: allow parallel stop
Stop multiple containers in parallel to speed up stop process, allow
maximum 50 parallel stops.

Signed-off-by: Abhinav Dahiya <abhinavdtu2012@gmail.com>
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-09-13 10:50:55 +08:00
Brian Goff
e5544fbb0d Merge pull request #26103 from sakeven/fix-validate-build-arg
validate build-arg
2016-09-12 09:15:58 -04:00
Antonio Murdaca
e8b9f38c7e Merge pull request #26456 from dnephin/move_cli_command_registry
Remove registry/auth helper methods from the DockerCLI object
2016-09-12 15:11:04 +02:00
sakeven
5426510bea validate build-arg
Signed-off-by: sakeven <jc5930@sina.cn>
2016-09-12 18:02:21 +08:00
Vincent Demeester
4c3f2e7c37 Merge pull request #26303 from yongtang/26300-docker-images-3-fractional-digits
Restrict size to 2 fractional digits for `docker images`
2016-09-10 11:32:45 +02:00
Daniel Nephin
1dd46e0644 Remove remaining registry methods from DockerCLI.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-09 15:50:01 -04:00
Daniel Nephin
e05fa5de48 Remove cli/command/credentials
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-09 15:50:01 -04:00
Daniel Nephin
5d335fbda7 Remove RetrieveAuthConfigs
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-09 15:50:01 -04:00
allencloud
af4461ad29 support docker node ps multiNodes
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-09-10 02:52:48 +08:00
Phil Estes
cf58eb437c Merge pull request #22049 from boucher/docker-checkpoint-restore
Implement containerd API for checkpoints
2016-09-09 13:36:55 -04:00
boucher
67f607a02f Update checkpoint comments to be more accurate
Signed-off-by: boucher <rboucher@gmail.com>
2016-09-09 12:13:46 -04:00
Daniel Nephin
e7c9694d76 Move image trust related cli methods into the image package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-09 10:50:16 -04:00
boucher
cb0ad4258b Fix typo
Signed-off-by: boucher <rboucher@gmail.com>
2016-09-08 21:31:56 -04:00
boucher
d8fef66b03 Initial implementation of containerd Checkpoint API.
Signed-off-by: boucher <rboucher@gmail.com>
2016-09-08 21:31:52 -04:00
Yong Tang
4e7e3919ce Restrict size to 2 fractional digits for docker images
This fix tries to address the issue raised in 26300. Previously
`docker images` will use `HumanSize()` to display the size which
has a fixed precision of 4 (thus 3 fractional digits). This
could be problematic in certain languages (e.g. , German, see
26300) as `.` may be interpreted as thousands-separator in number.

This fix use `CustomSize()` instead and limit the precision to 3
(thus 2 fractional digits).

This fix has been tested manually.

This fix fixes 26300.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-09-08 18:26:50 -07:00
Daniel Nephin
485881b038 Fix a test that expects whitespace at the end of the line.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-08 15:50:14 -04:00
Daniel Nephin
9c2b935812 Replace api/client imports with cli/command in experimental files.
Using

git grep -l 'client\.DockerCli' cli/command/stack/ | xargs sed -i -e 's/client\.DockerCli/command\.Dockercli/g'

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-08 15:46:48 -04:00
Daniel Nephin
0640a14b4f Move api/client -> cli/command
Using
  gomvpkg
     -from github.com/docker/docker/api/client
     -to github.com/docker/docker/cli/command
     -vcs_mv_cmd 'git mv {{.Src}} {{.Dst}}'

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-08 15:46:29 -04:00
Cao Weiwei
cec564984e Fix typo
Signed-off-by: Cao Weiwei <cao.weiwei30@zte.com.cn>
2016-08-28 21:30:14 +08:00
Daniel Nephin
6e7405ebd4 Fix tests and windows service.
Support args to RunCommand
Fix docker help text test.
Fix for ipv6 tests.
Fix TLSverify option.
Fix TestDaemonDiscoveryBackendConfigReload
Use tempfile for another test.
Restore missing flag.
Fix tests for removal of shlex.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-25 13:09:36 -04:00
Daniel Nephin
14712f9ff0 Remove old cli framework.
Also consolidate the leftover packages under cli.
Remove pkg/mflag.
Make manpage generation work with new cobra layout.
Remove remaining mflag and fix tests after rebase with master.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-25 13:09:04 -04:00
Daniel Nephin
31bf9ca0c8 Update unit tests for new cobra root command.
Cleanup cobra integration
Update windows files for cobra and pflags
Cleanup SetupRootcmd, and remove unnecessary SetFlagErrorFunc.
Use cobra command traversal

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-25 13:09:04 -04:00
Daniel Nephin
0452ff5a4d Convert docker root command to use pflag and cobra
Fix the daemon proxy for cobra commands.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-25 13:09:03 -04:00
Daniel Nephin
fb83394714 Convert dockerd to use cobra and pflag
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-25 13:09:03 -04:00
Daniel Nephin
851c388ad9 Convert inspect to cobra.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-03 10:36:47 -04:00
Akihiro Suda
9d9dff3d0d Migrate exec command to cobra
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-07-29 02:10:36 +00:00
Daniel Nephin
00a8a40398 Add a script to generate man pages from cobra commands.
Use the generate.sh script instead of md2man directly.
Update Dockerfile for generating man pages.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-07-19 12:00:21 -04:00
Sebastiaan van Stijn
4f0b510552
Don't automagically add "[OPTIONS]" to usage
This removes the logic to automatically
add [OPTIONS] to the usage output.

The current logic was broken if a command
only has deprecated or hidden flags, and
in many cases put the [OPTIONS] in the
wrong location.

Requiring the usage string to be set
manually gives more predictable results,
and shouldn't require much to maintain.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-07-19 00:07:19 +02:00
allencloud
edc307cb92 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-05 20:42:17 +08:00
Yong Tang
9765593c5f Use spf13/cobra for docker update
This fix is part of the effort to convert commands to spf13/cobra #23211.

Thif fix coverted command `docker update` to use spf13/cobra

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-22 11:06:44 -07:00
Tomasz Kopczynski
ac7a663c0b Migrate info command to cobra
Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
2016-06-17 22:11:33 +02:00
Anusha Ragunathan
d6d448aab8 Avoid back and forth conversion between strings and bytes.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-06-15 09:55:40 -07:00
Arnaud Porterie
c0677565dc Merge pull request #23522 from docker/swarm-stack
Add experimental Docker Stack CLI commands
2016-06-15 02:22:01 +00:00
Tibor Vass
f37117045c plugins: experimental support for new plugin management
This patch introduces a new experimental engine-level plugin management
with a new API and command line. Plugins can be distributed via a Docker
registry, and their lifecycle is managed by the engine.
This makes plugins a first-class construct.

For more background, have a look at issue #20363.

Documentation is in a separate commit. If you want to understand how the
new plugin system works, you can start by reading the documentation.

Note: backwards compatibility with existing plugins is maintained,
albeit they won't benefit from the advantages of the new system.

Signed-off-by: Tibor Vass <tibor@docker.com>
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-06-14 14:20:27 -07:00
Daniel Nephin
71104bb592 Add experimental docker stack commands
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-06-14 14:56:35 -04:00
Vincent Demeester
2e6db51de7
Migrate cp command to cobra
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-14 17:16:59 +02:00
Daniel Nephin
12a00e6017 Add Swarm management CLI commands
As described in our ROADMAP.md, introduce new Swarm management commands
to call to the corresponding API endpoints.

This PR is fully backward compatible (joining a Swarm is an optional
feature of the Engine, and existing commands are not impacted).

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-13 22:17:15 -07:00
Tianyi Wang
5a0b53b5a3 Migrate ps command to cobra
Signed-off-by: Tianyi Wang <capkurmagati@gmail.com>
2016-06-14 11:59:37 +09:00
Alexander Morozov
f0193e278c Merge pull request #23256 from vdemeester/migrate-pull-push-to-cobra
Use spf13/cobra for docker push and docker pull
2016-06-13 14:16:42 -07:00
Alexander Morozov
a502158d8a Merge pull request #23265 from vdemeester/migrate-login-logout-to-cobra
Use spf13/cobra for docker login and docker logout
2016-06-13 14:15:46 -07:00
Alexander Morozov
e6c49bf71b Merge pull request #23309 from yongtang/23211-spf13-cobra-commit
Use spf13/cobra for docker commit
2016-06-13 14:13:37 -07:00
Vincent Demeester
ad4e20cd92
Moving Image{Push,Pull}Privileged to trust.go
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-10 12:07:32 +02:00
Vincent Demeester
9640e3a451
Migrate push command to cobra
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-10 12:07:28 +02:00
Vincent Demeester
fa67b984f8
Migrate pull command to cobra
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-10 12:07:23 +02:00
Vincent Demeester
baf467722b
Migrate login & logout command to cobra
Also moves some common stuff around :
- `api/client/registry.go` for registry related
method (`ElectAuthServer`, …)
- `api/client/credentials.go` to interact with credentials

Migrate logout command to cobra

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-10 12:04:29 +02:00
Vincent Demeester
6632fd2788
Migrate save command to cobra
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-09 17:38:20 +02:00
Vincent Demeester
8b1d40271f
Migrate load command to cobra
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-09 17:28:33 +02:00
Yong Tang
939a142c8d Use spf13/cobra for docker commit
This fix is part of the effort to convert commands to spf13/cobra #23211.

Thif fix coverted command `docker commit` to use spf13/cobra

NOTE: `RequiresMinMaxArgs()` has been renamed to `RequiresRangeArgs()`.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-08 19:00:58 -07:00
Vincent Demeester
e884a515e9 Merge pull request #23334 from WeiZhang555/cobra-stats
Migrate stats and events command to cobra
2016-06-08 23:50:46 +02:00
Alexander Morozov
3b08711bb7 Merge pull request #23343 from vdemeester/migrate-build-to-cobra
Use spf13/cobra for docker build
2016-06-08 11:59:48 -07:00
Zhang Wei
04cdb8e602 Migrate stats and events command to cobra.
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-06-08 10:39:53 +08:00
Vincent Demeester
13d101d53c Merge pull request #23333 from yongtang/23211-spf13-cobra-version
Use spf13/cobra for docker version
2016-06-07 23:46:01 +02:00
Brian Goff
ce96ce9e05 Merge pull request #23311 from WeiZhang555/cobra-rm
Migrate rm command to cobra
2016-06-07 17:05:21 -04:00
Sebastiaan van Stijn
08419313ec Merge pull request #23292 from yongtang/23211-spf13-cobra-images
Use spf13/cobra for docker images
2016-06-07 21:56:42 +02:00
Vincent Demeester
60f447b655
Migrate docker build to cobra
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-07 18:15:44 +02:00
Yong Tang
ba7324ffcb Use spf13/cobra for docker tag
This fix is part of the effort to convert commands to spf13/cobra #23211.

Thif fix coverted command `docker tag` to use spf13/cobra

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-07 08:12:49 -07:00
Yong Tang
bc82e51d77 Use spf13/cobra for docker version
This fix is part of the effort to convert commands to spf13/cobra #23211.

Thif fix coverted command `docker version` to use spf13/cobra

NOTE: Most of the commands like `run`, `images` etc. goes to packages of
`container`, `image`, `network`, etc. Didn't find a good place for
`docker version` so just use the package `client` for now.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-07 08:11:34 -07:00
Yong Tang
65a0034c67 Use spf13/cobra for docker images
This fix is part of the effort to convert commands to spf13/cobra #23211.

Thif fix coverted command `docker images` to use spf13/cobra

NOTE: As part of this fix, a new function `RequiresMaxArgs()`
has been defined in `cli/required.go`. This func returns an
error if there is not at most max args

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-07 08:10:49 -07:00
Zhang Wei
7702f39fe8 Migrate rm command to cobra
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-06-07 22:19:16 +08:00
Sebastiaan van Stijn
88323c861a Merge pull request #23307 from WeiZhang555/cobra-restart
Migrate restart command to cobra
2016-06-07 15:28:35 +02:00
Sebastiaan van Stijn
4f9e2f9fb4 Merge pull request #23297 from WeiZhang555/cobra-kill
Migrate kill command to cobra
2016-06-07 13:44:22 +02:00
Sebastiaan van Stijn
f061f556f2 Merge pull request #23269 from vdemeester/migrate-import-to-cobra
Use spf13/cobra for docker import
2016-06-07 13:07:30 +02:00
Zhang Wei
732f08a822 Migrate kill command to cobra
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-06-07 17:20:33 +08:00
Zhang Wei
264462d601 Migrate restart command to cobra
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-06-07 17:13:53 +08:00
Vincent Demeester
6d4a7213e6 Merge pull request #23285 from yongtang/23211-spf13-cobra-pause
Use spf13/cobra for docker pause
2016-06-07 10:01:42 +02:00
Vincent Demeester
804536df25 Merge pull request #23291 from yongtang/23211-spf13-cobra-history
Use spf13/cobra for docker history
2016-06-07 10:00:39 +02:00
Vincent Demeester
e83dad090a Merge pull request #23290 from yongtang/23211-spf13-cobra-rename
Use spf13/cobra for docker rename
2016-06-07 08:28:27 +02:00
Brian Goff
c077d4cc1e Merge pull request #23316 from dnephin/error_on_invalid_docker_host
Fix a panic when the DOCKER_HOST was invalid using cobra commands
2016-06-06 21:17:47 -04:00
Brian Goff
ab821f9f9b Merge pull request #23274 from WeiZhang555/cobra-attach
Move attach command to cobra
2016-06-06 21:16:45 -04:00
Yong Tang
70f7ccb304 Use spf13/cobra for docker rename
This fix is part of the effort to convert commands to spf13/cobra #23211.

Thif fix coverted command `docker rename` to use spf13/cobra

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-06 12:39:11 -07:00
Yong Tang
91731706c2 Use spf13/cobra for docker pause
This fix is part of the effort to convert commands to spf13/cobra #23211.

Thif fix coverted command `docker pause` to use spf13/cobra

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-06 12:37:18 -07:00
Daniel Nephin
90244abc5b Fix a panic when the DOCKER_HOST was invalid using cobra commands.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-06-06 14:17:04 -04:00
Alexander Morozov
5ce2f14f9b Merge pull request #23306 from yongtang/23211-spf13-cobra-top
Use spf13/cobra for docker top
2016-06-06 10:14:10 -07:00
Vincent Demeester
52da20b839 Merge pull request #23286 from yongtang/23211-spf13-cobra-port
Use spf13/cobra for docker port
2016-06-06 18:55:37 +02:00
Yong Tang
a76d387cda Use spf13/cobra for docker history
This fix is part of the effort to convert commands to spf13/cobra #23211.

Thif fix coverted command `docker history` to use spf13/cobra

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-06 08:03:07 -07:00
Zhang Wei
eceb8625a9 Move attach command to cobra.
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-06-06 22:28:57 +08:00
Yong Tang
0f38669267 Use spf13/cobra for docker top
This fix is part of the effort to convert commands to spf13/cobra #23211.

Thif fix coverted command `docker top` to use spf13/cobra

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-06 06:38:43 -07:00
Yong Tang
d5971c230d Use spf13/cobra for docker port
This fix is part of the effort to convert commands to spf13/cobra #23211.

Thif fix coverted command `docker port` to use spf13/cobra

Note: As part of this fix, a new function `RequiresMinMaxArgs(min int, max int)`
has been added in cli/required.go. This function restrict the args
to be at least min and at most max.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-06 05:32:34 -07:00
Yong Tang
82f84a67d6 Use spf13/cobra for docker wait
This fix is part of the effort to convert commands to spf13/cobra #23211.

Thif fix coverted command `docker wait` to use spf13/cobra

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-06 05:09:41 -07:00
Vincent Demeester
9d2e8abd30
Migrate import command to cobra
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-06 13:58:23 +02:00
Vincent Demeester
4bd202b00f
Migrate network command to cobra
- Migrates network command and subcommands (connect, create, disconnect,
  inspect, list and remove) to spf13/cobra
- Create a RequiredExactArgs helper function for command that require an
  exact number of arguments.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-06 10:28:52 +02:00
Vincent Demeester
731bae6749 Merge pull request #23284 from yongtang/23211-spf13-cobra-logs
Use spf13/cobra for docker logs
2016-06-06 09:06:51 +02:00
Vincent Demeester
2becfab55f Merge pull request #23283 from yongtang/23211-spf13-cobra-diff
Use spf13/cobra for docker diff
2016-06-06 09:05:18 +02:00
Vincent Demeester
c35d9f2611 Merge pull request #23268 from WeiZhang555/cobra-start
Migrate start command to cobra
2016-06-06 08:59:42 +02:00
Zhang Wei
4f3625a288 Migrate start command to cobra
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-06-06 09:53:18 +08:00
Yong Tang
8ea7733a63 Use spf13/cobra for docker unpause
This fix is part of the effort to convert commands to spf13/cobra #23211.

Thif fix coverted command `docker unpause` to use spf13/cobra

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-05 17:29:52 -07:00
Yong Tang
4f4b59cc43 Use spf13/cobra for docker logs
This fix is part of the effort to convert commands to spf13/cobra #23211.

Thif fix coverted command `docker logs` to use spf13/cobra

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-05 15:51:35 -07:00
Yong Tang
5899afae52 Use spf13/cobra for docker diff
This fix is part of the effort to convert commands to spf13/cobra #23211.

Thif fix coverted command `docker diff` to use spf13/cobra

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-05 15:13:55 -07:00
Vincent Demeester
60e48bd6bd
Use spf13/cobra for docker rmi
Moves image command rmi to `api/client/image/remove.go` and use cobra :)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-05 22:40:35 +02:00
Vincent Demeester
b259558336 Merge pull request #23276 from yongtang/23211-spf13-cobra-stop
Use spf13/cobra for docker stop
2016-06-05 22:37:15 +02:00
Yong Tang
63d66d2796 Use spf13/cobra for docker stop
This fix is part of the effort to convert commands to spf13/cobra #23211.

Thif fix coverted command `docker stop` to use spf13/cobra

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-05 10:25:21 -07:00
Vincent Demeester
b25e64183c
Migrate export command to cobra
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-05 16:42:19 +02:00
Sebastiaan van Stijn
6b4a46f282 Merge pull request #23253 from vdemeester/carry-pr-23159
Carry #23159 : Use spf13/cobra for `docker run` and `docker create`
2016-06-04 18:55:23 +02:00
Vincent Demeester
6180c5c12e
Display "See 'docker cmd --help'." in error cases
This brings back this message in case missing arguments.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-04 16:19:54 +02:00
Daniel Nephin
5ab2434225 Convert 'docker create' to use cobra and pflag
Return the correct status code on flag parsins errors.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-06-04 13:57:30 +02:00
Daniel Nephin
a77f2450c7 Convert 'docker run' to a cobra command and to use pflags
Move container options into a struct so that tests should pass.
Remove unused FlagSet arg from Parse
Disable interspersed args on docker run

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-06-04 13:55:35 +02:00
Vincent Demeester
a11ef10631
Use spf13/cobra for docker search
- Move image command search to `api/client/image/search.go`
- Use cobra :)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-03 19:50:01 +02:00
Daniel Nephin
9b2bb64a38 Make the -h flag deprecated.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-05-31 15:43:16 -07:00
Daniel Nephin
fc5a4514fb Use Args in cobra.Command to validate args.
Also re-use context.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-05-31 15:43:16 -07:00
Daniel Nephin
54b5cce7e4 Support usage messages on bad flags.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-05-31 15:43:16 -07:00
Daniel Nephin
667dcb0e8e Update usage and help to (almost) match the existing docker behaviour
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-05-31 14:41:37 -07:00
Daniel Nephin
69264beb40 Migrate volume commands to cobra.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-05-31 14:41:37 -07:00
muge
b65e57bed5 cli: remove unnecessary initErr type
Signed-off-by: ZhangHang <stevezhang2014@gmail.com>
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-05-23 13:04:10 -07:00
David Calavera
90dfb3dacc Merge pull request #22372 from dnephin/cli_cleanup
Reorganize client and cli packages
2016-04-29 17:31:39 -07:00
Brian Goff
5c8950e84d Remove reflection on CLI init
before:
```
$ time docker --help
real  0m0.177s
user  0m0.000s
sys 0m0.040s
```

after:
```
$ time docker --help
real  0m0.010s
user  0m0.000s
sys 0m0.000s
```

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-04-29 11:57:46 -04:00
Daniel Nephin
01a34e43b3 Consolidate the files in client/
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-04-27 14:53:36 -04:00
Daniel Nephin
33c9edaf6c Cleanup the structure of the cli package.
Move all flags into cli/flags
Move usage help into cli/usage.go

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-04-27 14:25:47 -04:00
Daniel Nephin
9e7651db4d Build two binaries client and daemon.
Add a proxy to support 'docker daemon'
Fix configFile option, and remove a test that is no longer relevant.
Remove daemon build tag.
Remove DOCKER_CLIENTONLY from build scripts.

Signed-off-by: Daniel Nephin <dnephin@docker.com>

Change docker-daemon to dockerd.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-04-22 11:26:01 -04:00
allencloud
6983f05b42 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-03-26 22:06:45 +08:00
Martin Mosegaard Amdisen
5a701c3e4c Update 'save' command help
Based on review feedback.

Signed-off-by: Martin Mosegaard Amdisen <martin.amdisen@praqma.com>
2016-03-22 08:16:52 +01:00
Martin Mosegaard Amdisen
a826c244ed Fix plural typo in 'save' command help
The form "Save an images" is not correct.
Either "Save an image" or "Save images" work, but since
the save commands accepts multiple images, I chose the
latter.

Fixed in all places where I could grep "Save an image(s)".

Signed-off-by: Martin Mosegaard Amdisen <martin.amdisen@praqma.com>
2016-03-21 15:15:40 +01:00
Sebastiaan van Stijn
971c080b67 Remove some references to "register" through login
These were left-overs from the now deprecated
and removed functionality to registrer a new account
through "docker login"

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-03-01 17:33:23 +01:00
Zhang Wei
ff3ea4c90f Update RestartPolicy of container
Add `--restart` flag for `update` command, so we can change restart
policy for a container no matter it's running or stopped.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-02-20 17:06:32 +08:00
huqun
f609fb4d83 fix grammar error
it is not very important,but I think the modification makes the coders read more conviently!

Signed-off-by: huqun  <huqun@zju.edu.cn>
2016-02-12 16:11:31 +08:00
David Calavera
8e034802b7 Remove usage of pkg sockets and tlsconfig.
- Use the ones provided by docker/go-connections, they are a drop in replacement.
- Remove pkg/sockets from docker.
- Keep pkg/tlsconfig because libnetwork still needs it and there is a
  circular dependency issue.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-12-29 19:27:12 -05:00
Qiang Huang
8799c4fc0f Implemet docker update command
It's used for updating properties of one or more containers, we only
support resource configs for now. It can be extended in the future.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-12-28 19:19:26 +08:00
Madhu Venugopal
46f7ab3585 Added network to docker --help and help cleanup
Fixes https://github.com/docker/docker/issues/16909

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-15 03:10:39 -07:00
Lei Jitang
2b0927c9ac Use consistent command description
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-10-08 08:46:21 -04:00
Tibor Vass
96ce3a194a cli: new daemon command and new cli package
This patch creates a new cli package that allows to combine both client
and daemon commands (there is only one daemon command: docker daemon).

The `-d` and `--daemon` top-level flags are deprecated and a special
message is added to prompt the user to use `docker daemon`.

Providing top-level daemon-specific flags for client commands result
in an error message prompting the user to use `docker daemon`.

This patch does not break any old but correct usages.

This also makes `-d` and `--daemon` flags, as well as the `daemon`
command illegal in client-only binaries.

Signed-off-by: Tibor Vass <tibor@docker.com>
2015-07-23 19:44:46 -04:00