Commit Graph

423 Commits

Author SHA1 Message Date
d7733ea8ff Move package cliconfig to cli/config
I felt it made more sence 👼

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: bfe47a124a
Component: cli
2016-12-25 20:31:52 +01:00
b5d022c608 Implement content addressability for plugins
Move plugins to shared distribution stack with images.

Create immutable plugin config that matches schema2 requirements.

Ensure data being pushed is same as pulled/created.

Store distribution artifacts in a blobstore.

Run init layer setup for every plugin start.

Fix breakouts from unsafe file accesses.

Add support for `docker plugin install --alias`

Uses normalized references for default names to avoid collisions when using default hosts/tags.

Some refactoring of the plugin manager to support the change, like removing the singleton manager and adding manager config struct.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: 2825296deb
Component: cli
2016-12-23 13:29:58 -08:00
15f04ca54d Merge pull request #29599 from anusha-ragunathan/refcount
Enforce zero plugin refcount during disable, not remove.
Upstream-commit: ae76b43227
Component: cli
2016-12-22 15:38:54 -08:00
52276a061b Enforce zero plugin refcount during disable.
When plugins have a positive refcount, they were not allowed to be
removed. However, plugins could still be disabled when volumes
referenced it and containers using them were running.

This change fixes that by enforcing plugin refcount during disable.
A "force" disable option is also added to ignore reference refcounting.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: bf3250ae0a
Component: cli
2016-12-22 13:26:53 -08:00
d1cd767c90 Merge pull request #29314 from vdemeester/no-more-utils
Remove the utils package
Upstream-commit: 6c1299e819
Component: cli
2016-12-22 15:21:05 +01:00
4b4fbe7e43 Merge pull request #29603 from mstanleyjones/docker_diff_improvements
Clarify what docker diff shows
Upstream-commit: ea51e6159f
Component: cli
2016-12-22 15:15:01 +01:00
246158109a Merge pull request #29212 from yongtang/29185-docker-inspect
Fix `docker plugin inspect <unkown object>` issue on Windows
Upstream-commit: 9b17b8ea18
Component: cli
2016-12-21 15:47:17 -05:00
618dee8851 Merge pull request #28714 from thaJeztah/move-logdriver-check-to-daemon
move check for supported drivers to daemon
Upstream-commit: 63677ef495
Component: cli
2016-12-21 13:47:30 -05:00
646a6e9abe Merge pull request #29491 from yongtang/12162016-stats-error
Improve error output for `docker stats ...`
Upstream-commit: b373d1b81e
Component: cli
2016-12-21 13:19:20 -05:00
1ae9a84d49 Merge pull request #29527 from allencloud/change-minor-mistake
change minor mistake of spelling
Upstream-commit: a4be350fb0
Component: cli
2016-12-21 13:15:00 -05:00
8d700ff527 Fix docker plugin inspect <unkown object> issue on Windows
This fix is a follow up for comment:
https://github.com/docker/docker/pull/29186/files#r91277345

While #29186 addresses the issue of `docker inspect <unknown object>`
on Windows, it actually makes `docker plugin inspect <unknown object>`
out `object not found` on Windows as well. This is actually misleading
as plugin is not supported on Windows.

This fix reverted the change in #29186 while at the same time,
checks `not supported` in `docker inspect <unknown object>` so that
- `docker plugin inspect <unknown object>` returns `not supported` on Windows
- `docker inspect <unknown object>` returns `not found` on Windows

This fix is related to #29186 and #29185.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 86a07d3fec
Component: cli
2016-12-20 21:05:10 -08:00
d11aa2f821 Clarify what docker diff shows
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: 606a16a07d
Component: cli
2016-12-20 17:03:11 -08:00
19e575d974 Merge pull request #29470 from cyli/ask-for-unlock-key-only-if-locked
Check if a swarm is locked before asking a user to enter their unlock key
Upstream-commit: df760c86cf
Component: cli
2016-12-20 13:21:47 -08:00
d49dbca381 change minor mistake of spelling
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 3c8d009c7a
Component: cli
2016-12-20 21:05:19 +08:00
375b7aafd2 Fix misleading default for --replicas
This fix tries to address the issue raised in 29291 where
the output of `--replicas` in `service create/update`:
```
      --replicas uint                    Number of tasks (default none)
```
is misleading. User might incorrectly assume the number of replicas
would be `0` (`none`) by default, while the actual default is `1`.

The issue comes from the fact that some of the default values are
from daemon and it is not possible for client to find out the default
value.

In this case, it might be better to just simply not displaying `(default none)`.

This fix returns "" for `Uint64Opt` so that `(default none)` is hidden.

In addition to `--replicas`, this fix also changes
`--restart-delay`, `--restart-max-attempts`, `--stop-grace-period`,
`--health-interval`, `--health-timeout`, and `--restart-window`
in a similiar fashion.

New Output:
```
      --health-interval duration         Time between running the check (ns|us|ms|s|m|h)
      --health-timeout duration          Maximum time to allow one check to run (ns|us|ms|s|m|h)
...
      --replicas uint                    Number of tasks
...
      --restart-delay duration           Delay between restart attempts (ns|us|ms|s|m|h)
      --restart-max-attempts uint        Maximum number of restarts before giving up
      --restart-window duration          Window used to evaluate the restart policy (ns|us|ms|s|m|h)
...
      --stop-grace-period duration       Time to wait before force killing a container (ns|us|ms|s|m|h)
```

The docs has been updated. Note the docs for help output of `service create/update`
is out of sync with the current master. This fix replace with the update-to-date
help output.

This fix fixes 29291.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 23ab849f06
Component: cli
2016-12-19 19:35:05 -08:00
26b770f227 Merge pull request #29246 from thaJeztah/improve-swarm-check-in-inspect
Ignore certificate expiry error for top-level inspect
Upstream-commit: 285710d3c8
Component: cli
2016-12-19 15:37:53 -08:00
a2643a0c32 Merge pull request #29339 from dmcgowan/plugins-abstract-download-manager
Abstract layerstore from pull/push distribution code
Upstream-commit: 91f9b72481
Component: cli
2016-12-19 13:32:28 -08:00
ed51ff0e2b Abstract distribution interfaces from image specific types
Move configurations into a single file.
Abstract download manager in pull config.
Add supports for schema2 only and schema2 type checking.
Add interface for providing push layers.
Abstract image store to generically handle configurations.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: 476adcfd20
Component: cli
2016-12-19 10:55:00 -08:00
2858451cf0 remove client-side for supported logging drivers
The `docker logs` command performed a
client-side check if the container's
logging driver was supported.

Now that we allow the client to connect
to both "older" and "newer" daemon versions,
this check is best done daemon-side.

This patch remove the check on the client
side, and leaves validation to the daemon,
which should be the source of truth.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 8246c49498
Component: cli
2016-12-19 14:30:01 +01:00
9769995188 Merge pull request #28629 from yongtang/28581-secret-create-input
Add `--file` flag for `docker secret create` command
Upstream-commit: a3c24bf450
Component: cli
2016-12-18 03:04:10 +01:00
12d8535d84 Improve error output for docker stats ...
While looking into `docker stats <c1> <c2> ...` I noticed that
the error output is quite long, especially if there are multiple errors:
```sh
ubuntu@ubuntu:~/docker$ docker stats nofound
: Error response from daemon: No such container: nofound
ubuntu@ubuntu:~/docker$ docker stats nofound foo bar
: Error response from daemon: No such container: nofound, : Error response from daemon: No such container: foo, : Error response from daemon: No such container: bar
```

There are several issues,
1. There is an extra `: ` at the beginning. That is because if container is not found,
the name will not be available from the daemon.
2. Multiple errors are concatenated with `, ` which will be quite long.

This fix:
1. Only prient out the error from daemon.
2. Multiple errors are printed out line by line.

Below is the new output:
```sh
ubuntu@ubuntu:~/docker$ docker stats nofound
Error response from daemon: No such container: nofound
ubuntu@ubuntu:~/docker$ docker stats nofound foo bar
Error response from daemon: No such container: nofound
Error response from daemon: No such container: foo
Error response from daemon: No such container: bar
```

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: c6b3fcbe32
Component: cli
2016-12-17 16:51:11 -08:00
e3659c33cd Merge pull request #29423 from unclejack/api_cli_integ_return
return directly without ifs in remaining packages
Upstream-commit: fc1222118d
Component: cli
2016-12-17 21:30:47 +01:00
7e0fb1585d Before asking a user for the unlock key when they run docker swarm unlock, actually
check to see if the node is part of a swarm, and if so, if it is unlocked first.
If neither of these are true, abort the command.

Signed-off-by: Ying Li <ying.li@docker.com>
Upstream-commit: e4102ce61e
Component: cli
2016-12-16 17:16:55 -08:00
b512bfb3a7 Merge pull request #29003 from dnephin/pkg-compose-transform
Move composefile -> engine api type conversion to `cli/compose/convert`
Upstream-commit: 15bcbad07a
Component: cli
2016-12-16 23:34:41 +01:00
49a03faa44 Move pkg to cli/compose/convert
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: c4ea22972f
Component: cli
2016-12-16 12:27:31 -05:00
415fa73d46 Move ConvertService to composetransform package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 31355030b3
Component: cli
2016-12-16 12:20:07 -05:00
4c4bfbf1f3 Move ConvertVolumes to composetransform package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: af6a411358
Component: cli
2016-12-16 11:51:13 -05:00
b77718801b Move ConvertNetworks to composetransform package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: a28db56b0f
Component: cli
2016-12-16 11:51:13 -05:00
0f4c3f59f3 swarm leave is not only for workers
the "docker swarm leave" command description
mentioned that the command can only be used
for workers, however, the command can also
be used for managers (using the `-f` / `--force`
option).

this patch removes the "(workers only)" part
of the command description.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 4cf95aeaa2
Component: cli
2016-12-16 15:10:20 +01:00
a92decfa5f return directly without ifs in remaining packages
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Upstream-commit: 9197940e4e
Component: cli
2016-12-14 23:28:27 +02:00
c953080e22 cli: Pin image to digest using content trust
Implement notary-based digest lookup in the client when
DOCKER_CONTENT_TRUST=1.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: fdb6a6ee1c
Component: cli
2016-12-14 10:49:33 -08:00
fe8fcf4846 cli: Split out GetNotaryRepository and associated functions
Split these into cli/trust so that other commands can make use of them.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 639f97daea
Component: cli
2016-12-14 10:49:32 -08:00
22ebdb900e Merge pull request #28943 from vdemeester/publish-long-short-syntax
Remove --port and update --publish for services to support syntaxes
Upstream-commit: 4a5426ef16
Component: cli
2016-12-14 17:55:48 +01:00
19115e5ac6 Merge pull request #29288 from Microsoft/jjh/promptusestdin
Windows: Prompt fix use regular stdin
Upstream-commit: 340eb44b73
Component: cli
2016-12-13 21:18:54 +01:00
db5fdebfa8 Ignore certificate expiry error for top-level inspect
The top-level `docker inspect` command could return
an error if the nodes Swarm certificates were expired.

In situations where the user did not explicitly
ask for an object-type (`--type=foo`), we should
ignore these errors, and consider them equal to
"node is not a swarm manager".

This change makes `docker inspect` ignore these
errors if no type was specified.

As a further optimization, the "swarm status"
result is now stored in a variable, so that
other swarm-specific API calls can be skipped.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 518b65c6f5
Component: cli
2016-12-13 17:22:43 +01:00
d0c6ebff61 Add --file flag for docker secret create command
This fix tries to address the issue raised in 28581 and 28927
where it is not possible to create a secret from a file (only
through STDIN).

This fix add a flag `--file` to `docker secret create` so that
it is possible to create a secret from a file with:
```
docker secret create --file secret.in secret.name
```

or
```
echo TEST | docker secret create --file - secret.name
```

Related docs has been updated.

An integration test has been added to cover the changes.

This fix fixes 28581.
This fix is related to 28927.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 8e680c48f1
Component: cli
2016-12-13 07:35:45 -08:00
14f444d932 Show usage when docker swarm update has no flags
This fix tries to address the issue raised in 24352. Previously,
when `docker swarm update` has no flags, the output is
```
Swarm updated.
```
even though nothing was updated. This could be misleading for
users.

This fix tries to address the issue by adding a `PreRunE` function
in the command so that in case no flag is provided (`cmd.Flags().NFlag() == 0`),
the usage will be outputed instead.

An integration has been added to cover the changes.

This fix fixes 24352.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 249d4e5709
Component: cli
2016-12-13 05:05:04 -08:00
73cab18478 Merge pull request #29267 from yuexiao-wang/fix-bulid-para
Update the option for docker build
Upstream-commit: bc8091d9cc
Component: cli
2016-12-13 08:55:20 +01:00
e51409f512 Update the option 'network' for docker build
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: dd2b83e297
Component: cli
2016-12-13 18:18:53 +08:00
d06f41e36a Merge pull request #29196 from aluzzardi/service-ps-output
service ps: Revert output to 1.12 behavior.
Upstream-commit: ded2ece9ad
Component: cli
2016-12-12 17:20:45 +01:00
8f86ac53c1 Move templates to pkg/templates
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 26fca512dd
Component: cli
2016-12-12 09:34:03 +01:00
6f40e3addd Move debug functions to cli/debug package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: a51750a650
Component: cli
2016-12-12 09:33:58 +01:00
d4d9c59756 Make --publish-rm precedes --publish-add, so that add wins
`--publish-add 8081:81 --publish-add 8082:82 --publish-rm 80
--publish-rm 81/tcp --publish-rm 82/tcp` would thus result in 81 and
82 to be published.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: b4a6d83dc2
Component: cli
2016-12-11 23:14:54 +01:00
eef5b8fb30 Remove --port and update --publish for services to support syntaxes
Add support for simple and complex syntax to `--publish` through the
use of `PortOpt`.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 7fbc616b47
Component: cli
2016-12-11 23:14:54 +01:00
4b41f05671 Windows: Prompt fix
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 1da163febe
Component: cli
2016-12-09 14:27:53 -08:00
b7d0227813 Merge pull request #25860 from yongtang/1396-service-update-publish-rm
Return error for incorrect argument of `service update --publish-rm`
Upstream-commit: f099e134e4
Component: cli
2016-12-08 20:09:56 +01:00
59eb7b746b Merge pull request #29020 from wefine/commands_order
Give a order to AddCommands, for better read and maintenance.
Upstream-commit: 72d7156784
Component: cli
2016-12-08 15:13:22 +01:00
57b31db9e4 Merge pull request #29041 from aaronlehmann/hide-updatestatus
api: Hide UpdateStatus when it is not present
Upstream-commit: e2b06ebc88
Component: cli
2016-12-08 13:55:13 +01:00
e967701d49 Give a order to AddCommands, for easy read and maintenance.
Signed-off-by: wefine <wang.xiaoren@zte.com.cn>
Upstream-commit: e41cf4a860
Component: cli
2016-12-08 16:43:14 +08:00
27fca83e87 Merge pull request #29104 from duglin/Issue29084
Fix processing of unset build-args during build
Upstream-commit: 4b7ad6c23e
Component: cli
2016-12-07 17:18:55 -08:00