Commit Graph

520 Commits

Author SHA1 Message Date
1ecc83f981 Add docker plugin upgrade
This allows a plugin to be upgraded without requiring to
uninstall/reinstall a plugin.
Since plugin resources (e.g. volumes) are tied to a plugin ID, this is
important to ensure resources aren't lost.

The plugin must be disabled while upgrading (errors out if enabled).
This does not add any convenience flags for automatically
disabling/re-enabling the plugin during before/after upgrade.

Since an upgrade may change requested permissions, the user is required
to accept permissions just like `docker plugin install`.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: d98ab3d3ab
Component: cli
2017-02-03 16:21:12 -05:00
4f11f6fb59 Merge pull request #30180 from allencloud/add-endpoint-mode-a-default-value
add endpoint mode a default value
Upstream-commit: 9f3d30afe3
Component: cli
2017-02-02 11:51:44 -08:00
1c35c6a82f Merge pull request #28199 from yongtang/11062016-service-ls-format
Add `--format` to `docker service ls`
Upstream-commit: 16c1a50ddf
Component: cli
2017-02-02 10:40:04 +01:00
4f8232c350 Merge pull request #30203 from allencloud/validate-healthcheck-params-in-daemon-side
validate healthcheck params in daemon side
Upstream-commit: 1ce67df34e
Component: cli
2017-02-01 21:19:30 -05:00
0fe55a8f05 Merge pull request #29747 from xlgao-zju/break-the-for
exit collect when we get EOF
Upstream-commit: 2454afb121
Component: cli
2017-02-01 22:29:18 +01:00
c340c8f767 Add --format to docker service ls
This fix tries to improve the display of `docker service ls`
and adds `--format` flag to `docker service ls`.

In addition to `--format` flag, several other improvement:
1. Updates `docker stacks service`.
2. Adds `servicesFormat` to config file.

Related docs has been updated.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 31fb756bb6
Component: cli
2017-02-01 08:33:19 -08:00
8d883b5e67 Merge pull request #29692 from yongtang/29492-daemon-shm-size
Add daemon option `--default-shm-size`
Upstream-commit: cb8723543e
Component: cli
2017-02-01 16:56:10 +01:00
042d091899 Merge pull request #28627 from yongtang/28624-docker-plugin-ls
Add `--filter enabled=true` for `docker plugin ls`
Upstream-commit: 8efe4cea80
Component: cli
2017-02-01 16:52:00 +01:00
b090b514cd Merge pull request #22563 from mlaventure/cgroup-devices
Allow adding rules to cgroup devices.allow on container create/run
Upstream-commit: 77467608bd
Component: cli
2017-02-01 16:29:34 +01:00
7812d9088a Merge pull request #30162 from yongtang/29972-service-read-only
Add `--read-only` for `service create` and `service update`
Upstream-commit: 7ed541d8bd
Component: cli
2017-01-31 13:20:00 -08:00
8f6cebdec9 Merge pull request #30411 from thaJeztah/fix-build-from-local-github-directories
do not ignore local build-contexts starting with "github.com"
Upstream-commit: 543c88bb33
Component: cli
2017-01-31 12:45:11 -08:00
9bdd0ca52f Add --read-only for service create and service update
This fix tries to address the issue raised in 29972 where
it was not possible to specify `--read-only` for `docker service create`
and `docker service update`, in order to have the container's root file
system to be read only.

This fix adds `--read-only` and update the `ReadonlyRootfs` in `HostConfig`
through `service create` and `service update`.

Related docs has been updated.

Integration test has been added.

This fix fixes 29972.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: b849aa6b95
Component: cli
2017-01-30 12:47:26 -08:00
41c8dfca13 Merge pull request #30186 from thaJeztah/add-version-annotation-to-flags
Add version annotation to various flags added in 1.13
Upstream-commit: 2e02d615c4
Component: cli
2017-01-30 12:33:36 -08:00
2874513efc validate healthcheck params in daemon side
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 406c6348b6
Component: cli
2017-01-29 13:35:32 +08:00
c3e631a485 remove cli/command/secrets/utils.go
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: ca1e5ffeea
Component: cli
2017-01-29 13:32:49 +08:00
43d29b1590 add endpoint mode a default value
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 67db25f42e
Component: cli
2017-01-28 20:46:34 +08:00
60b21e3b0e Merge pull request #29218 from yongtang/28884-secret-inspect-follow-up
Move secret name or ID prefix resolving from client to daemon
Upstream-commit: 53edcd37a2
Component: cli
2017-01-27 13:31:04 -08:00
6300064c81 Update opts.MemBytes to disable default, and move docker run/create/build to use opts.MemBytes
This fix made several updates:
1. Update opts.MemBytes so that default value will not show up.
   The reason is that in case a default value is decided by daemon,
   instead of client, we actually want to not show default value.
2. Move `docker run/create/build` to use opts.MemBytes for `--shm-size`
   This is to bring consistency between daemon and docker run
3. docs updates.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: f75ecc5ad2
Component: cli
2017-01-27 12:17:06 -08:00
e94be9a069 Add daemon option --default-shm-size
This fix fixes issue raised in 29492 where it was not
possible to specify a default `--default-shm-size` in daemon
configuration for each `docker run``.

The flag `--default-shm-size` which is reloadable, has been
added to the daemon configuation.
Related docs has been updated.

This fix fixes 29492.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: ab794c5579
Component: cli
2017-01-27 12:17:06 -08:00
25a9f2a83b Move secret name or ID prefix resolving from client to daemon
This fix is a follow up for comment:
https://github.com/docker/docker/pull/28896#issuecomment-265392703

Currently secret name or ID prefix resolving is done at the client
side, which means different behavior of API and CMD.

This fix moves the resolving from client to daemon, with exactly the
same rule:
- Full ID
- Full Name
- Partial ID (prefix)

All existing tests should pass.

This fix is related to #288896, #28884 and may be related to #29125.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 383ed6f121
Component: cli
2017-01-27 10:40:05 -08:00
c62b9c86df Add [OPTIONS] to usage of plugin disable|push
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 0e9401f84b
Component: cli
2017-01-27 16:17:02 +01:00
d883a70a2c Add --filter enabled=true for docker plugin ls
This fix adds `--filter enabled=true` to `docker plugin ls`,
as was specified in 28624.

The related API and docs has been updated.

An integration test has been added.

This fix fixes 28624.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 2a949b5574
Component: cli
2017-01-26 13:16:11 -08:00
65bef339c1 Remove secrets as part of stack remove.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 40bde3ee00
Component: cli
2017-01-26 11:33:15 -05:00
a568e7cd60 Add integration test for stack deploy with secrets.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 4a1c23bc26
Component: cli
2017-01-26 11:33:15 -05:00
5805451da4 Implement secret types for compose file.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 0382f4f365
Component: cli
2017-01-26 11:33:15 -05:00
e80af1f403 Allow adding rules to cgroup devices.allow on container create/run
This introduce a new `--device-cgroup-rule` flag that allow a user to
add one or more entry to the container cgroup device `devices.allow`

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: f33bf818a2
Component: cli
2017-01-26 07:20:45 -08:00
eaf2723a5b Merge pull request #30043 from dmcgowan/distribution-reference-update-1
Distribution reference update
Upstream-commit: 96c7794e95
Component: cli
2017-01-24 20:38:20 -08:00
8868b20a7e Merge pull request #30291 from yongtang/30279-ps-format
Fix failure in `docker ps --format` when `.Label` has args
Upstream-commit: d62ccd9907
Component: cli
2017-01-24 17:55:52 -08:00
a578545068 do not ignore local build-contexts starting with "github.com"
Docker special-cases build-contexts starting with `github.com`, and
treats them as remote URLs.

Because of this special treatment, local build contexts in a directory
named "github.com" are ignored by `docker build`.

This patch changes the way the build-context is detected and first
checks if a local path with the given name exists before considering
it to be a remote URL.

Before this change;

    $ mkdir -p github.com/foo/bar && echo -e "FROM scratch\nLABEL iam=local" > github.com/foo/bar/Dockerfile

    $ docker build -t dont-ignore-me github.com/foo/bar
    Username for 'https://github.com':

After this change;

    $ mkdir -p github.com/foo/bar && echo -e "FROM scratch\nLABEL iam=local" > github.com/foo/bar/Dockerfile

    $ docker build -t dont-ignore-me github.com/foo/bar
    Sending build context to Docker daemon 2.048 kB
    Step 1/2 : FROM scratch
     --->
    Step 2/2 : LABEL iam local
     ---> Using cache
     ---> ae2c603fe970
    Successfully built ae2c603fe970

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: bfd9613e5f
Component: cli
2017-01-24 17:44:44 +01:00
78bd4c768c Merge pull request #30378 from mlaventure/fix-negative-size
Ensure proper value is used when computing reclaimable space
Upstream-commit: f35f889c10
Component: cli
2017-01-24 09:24:53 -05:00
0bde62f513 Merge pull request #29900 from yongtang/29226-network-format-created-at
Add `.CreatedAt` placeholder for `docker network ls --format`
Upstream-commit: 0afeb93de4
Component: cli
2017-01-24 11:01:37 +01:00
103aea31ce Merge pull request #30211 from thaJeztah/fix-content-trust-flags
fix flag descriptions for content-trust
Upstream-commit: ff1bdf07e5
Component: cli
2017-01-23 23:52:11 +01:00
c55820cad8 Ensure proper value is used when computing reclaimable space
When Size was reverted to be equal to VirtualSize, the df command
formatter was not correctly updated to account for the change.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 3494b518a5
Component: cli
2017-01-23 13:57:20 -08:00
309b93f78c Merge pull request #30139 from Microsoft/jjh/sequential
Windows: Use sequential file access
Upstream-commit: 9f0e5f7e1f
Component: cli
2017-01-23 12:46:06 -08:00
a84143df5a Windows: Use sequential file access
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 0964347819
Component: cli
2017-01-23 10:25:36 -08:00
4c7cf08fd0 Fix failure in docker ps --format when .Label has args
This fix tries to fix the issue in 30279 where  `docker ps --format`
fails if `.Label` has args. For example:
```
docker ps --format '{{.ID}}\t{{.Names}}\t{{.Label "some.label"}}'
```

The reason for the failure is that during the preprocessing phase
to detect the existance of `.Size`, the `listOptionsProcessor`
does not has a method of `Label(name string) string`.

This results in the failure of
```
template: :1:24: executing "" at <.Label>: Label is not a method but has arguments
```

This fix fixes the issue by adding needed method of `Label(name string) string`.

This fix fixes 30279.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: a2afbcbb57
Component: cli
2017-01-23 09:31:48 -08:00
c4b51bb540 Merge pull request #29088 from yongtang/28708-plugin-list-format
Add `--format` flag for `docker plugin ls`
Upstream-commit: d6f65e40e3
Component: cli
2017-01-23 08:49:28 -08:00
abe2284d28 fix flag descriptions for content-trust
Commit ed13c3abfb242905ec012e8255dc6f26dcf122f6 added flags
for Docker Content Trust. Depending on the `verify` boolean,
the message is "Skip image verification", or "Skip image signing".
"Signing" is intended for `docker push` / `docker plugin push`.

During the migration to Cobra, this boolean got flipped for
`docker push` (9640e3a4514f96a890310757a09fd77a3c70e931),
causing `docker push` to show the incorrect flag description.

This patch changes the flags to use the correct description
for `docker push`, and `docker plugin push`.

To prevent this confusion in future, the boolean argument
is removed, and a `AddTrustSigningFlags()` function is added.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 62ff1a0ea7
Component: cli
2017-01-23 14:52:36 +01:00
54ef62681b Merge pull request #30272 from AkihiroSuda/fix-cli-json
Fix broken JSON support in cli/command/formatter
Upstream-commit: 50ff57b6e9
Component: cli
2017-01-23 11:03:18 +01:00
23c2c8d9bb Add --format flag for docker plugin ls
This fix tries to address the enhancement discussed in 28735 to add
`--format` for the output of `docker plugin ls`.

This fix
1. Add `--format` and `--quiet` flags to `docker plugin ls`
2. Convert the current implementation to use `formatter`, consistent with
   other docker list commands.
3. Add `pluginsFormat` for config.json.

Related docs has been updated.

Several unit tests have been added to cover the changes.

This fix is related to 28708 and 28735.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: c799b20f5b
Component: cli
2017-01-20 15:59:44 -08:00
82428da3c9 Remove use of forked reference package for cli
Use resolving to repo info as the split point between the
legitimate reference package and forked reference package.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: bbc4ac69fa
Component: cli
2017-01-19 16:04:50 -08:00
c02ff6e41e Fix broken JSON support in cli/command/formatter
How to test (it should not print `{}`, and just returns JSON with the actual data):

   $ docker images --format '{{json .}}'
   $ docker container stats --format '{{json .}}'

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: 775d9759c6
Component: cli
2017-01-19 09:51:13 +00:00
eca2ee10e8 return error when listNode fails
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: ca5bd1c106
Component: cli
2017-01-19 14:02:06 +08:00
dd7e1c9ff9 Merge pull request #30218 from kevinetc123/patch-typo
fix a typo error
Upstream-commit: e4a2c958e3
Component: cli
2017-01-19 14:34:19 +09:00
5b6dccd76a correct all the formate to formatter
Signed-off-by: kaiwentan <kaiwentan@harmonycloud.cn>
Upstream-commit: 182bccefbe
Component: cli
2017-01-19 11:26:49 +08:00
2603252d3d Merge pull request #28925 from daehyeok/ineffassign
Refactoring ineffectual assignments
Upstream-commit: d9c0b0b8ef
Component: cli
2017-01-18 15:01:57 +01:00
159f204ae9 purify error message in cli for create and run command
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: b554a5f625
Component: cli
2017-01-17 17:21:17 +08:00
1daa5daff5 Add version annotation to various flags added in 1.13
Pull request https://github.com/docker/docker/pull/27745 added support for the
client to talk to older versions of the daemon. Various flags were added to
docker 1.13 that are not compatible with older daemons.

This PR adds annotations to those flags, so that they are automatically hidden
if the daemon is older than docker 1.13 (API 1.25).

Not all new flags affect the API (some are client-side only). The following
PR's added new flags to docker 1.13 that affect the API;

- https://github.com/docker/docker/pull/23430 added `--cpu-rt-period`and `--cpu-rt-runtime`
- https://github.com/docker/docker/pull/27800 / https://github.com/docker/docker/pull/25317 added `--group` / `--group-add` / `--group-rm`
- https://github.com/docker/docker/pull/27702 added `--network` to `docker build`
- https://github.com/docker/docker/pull/25962 added `--attachable` to `docker network create`
- https://github.com/docker/docker/pull/27998 added `--compose-file` to `docker stack deploy`
- https://github.com/docker/docker/pull/22566 added `--stop-timeout` to `docker run` and `docker create`
- https://github.com/docker/docker/pull/26061 added `--init` to `docker run` and `docker create`
- https://github.com/docker/docker/pull/26941 added `--init-path` to `docker run` and `docker create`
- https://github.com/docker/docker/pull/27958 added `--cpus` on `docker run` / `docker create`
- https://github.com/docker/docker/pull/27567 added `--dns`, `--dns-opt`, and `--dns-search` to `docker service create`
- https://github.com/docker/docker/pull/27596 added `--force` to `docker service update`
- https://github.com/docker/docker/pull/27857 added `--hostname` to `docker service create`
- https://github.com/docker/docker/pull/28031 added `--hosts`, `--host-add` / `--host-rm` to `docker service create` and `docker service update`
- https://github.com/docker/docker/pull/28076 added `--tty` on `docker service create` / `docker service update`
- https://github.com/docker/docker/pull/26421 added `--update-max-failure-ratio`, `--update-monitor` and `--rollback` on `docker service update`
- https://github.com/docker/docker/pull/27369 added `--health-cmd`, `--health-interval`, `--health-retries`, `--health-timeout` and `--no-healthcheck` options to `docker service create` and `docker service update`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 5d2722f83d
Component: cli
2017-01-16 18:21:20 +01:00
79ea6e48d7 Don't use AutoRemove on older daemons
Docker 1.13 moves the `--rm` flag to the daemon,
through an AutoRemove option in HostConfig.

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

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

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

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

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

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

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 35de37289b
Component: cli
2017-01-15 01:59:57 +01:00
5b7a6d1329 Merge pull request #29856 from Microsoft/jjh/warntoout
Windows to Linux build warning to stdout
Upstream-commit: b41c16fcae
Component: cli
2017-01-14 16:37:31 -05:00