Commit Graph

497 Commits

Author SHA1 Message Date
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
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
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
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
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
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
4588b337cd Add SecretUpdate method to client
closes #28678

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Update cli/command/service/update_test.go

Fixes test build error:

  secretAPIClientMock does not implement "github.com/docker/docker/client".SecretAPIClient (missing SecretUpdate method)

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: acda56d47c
Component: cli
2017-01-13 09:51:05 -08:00
df1baac4fc Refactoring ineffectual assignments
This patch fixed below 4 types of code line
1. Remove unnecessary variable assignment
2. Use variables declaration instead of explicit initial zero value
3. Change variable name to underbar when variable not used
4. Add erro check and return for ignored error

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
Upstream-commit: 266900235c
Component: cli
2017-01-13 00:27:01 -07:00
5c20fde4a3 Fix ImageSummary.Size value
The prune PR changed the meaning of the file to mean "space on disk
only unique to this image", this PR revert this change.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: ce20950422
Component: cli
2017-01-12 07:49:22 -08:00
c4a2b1cead Allow swarm init with --availability=drain
This fix adds a new flag `--availability` to `swarm join`.

Related documentation has been updated.

An integration test has been added.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 3c47987838
Component: cli
2017-01-10 16:31:51 -08:00
7d950520e5 Allow swarm join with --availability=drain
This fix tries to address the issue raised in 24596 where it was not
possible to join as manager only (`--availability=drain`).

This fix adds a new flag `--availability` to `swarm join`.

Related documentation has been updated.

An integration test has been added.

NOTE: Additional pull request for swarmkit and engine-api will
be created separately.

This fix fixes 24596.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: ab2635ead0
Component: cli
2017-01-10 16:31:51 -08:00
4b2d2c595b Few stack deploy network fixes
- Make sure we use the correct network name for external ones.
- Make the default network overridable and only creates networks that
  are used by services — so that default network is only created if a
  service doesn't declare a network.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 70643ad005
Component: cli
2017-01-10 10:29:09 +01:00
9c20659614 Merge pull request #29918 from dongluochen/service_inspect_pretty
add port PublishMode to service inspect --pretty output
Upstream-commit: f28fbb0b69
Component: cli
2017-01-09 22:43:41 +01:00
231ca3ec32 Merge pull request #29802 from thaJeztah/fix-secret-rm-consistency
Update order of '--secret-rm' and '--secret-add'
Upstream-commit: 583d846c1d
Component: cli
2017-01-09 21:34:05 +01:00
eb0e6476ae Merge pull request #29143 from vdemeester/node-cli-unit-tests
Add some unit tests to the node and swarm cli code
Upstream-commit: 20f73b1c4e
Component: cli
2017-01-09 20:52:23 +01:00
f3fc9391c5 add port PublishMode to service inspect --pretty output
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
Upstream-commit: e8ad538d90
Component: cli
2017-01-09 10:30:28 -08:00
12773ed0c0 Merge pull request #29955 from vieux/improve_secret_Create
remove -f on secret create and unify usage with other commands
Upstream-commit: fa1b74a77e
Component: cli
2017-01-09 10:22:39 -08:00
99b5324db7 Add some unit tests to the node and swarm cli code
Start work on adding unit tests to our cli code in order to have to
write less costly integration test.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: ee8f9e084a
Component: cli
2017-01-09 18:30:15 +01:00
7a6a7e6b80 Merge pull request #29226 from yongtang/28535-prune-until-follow-up
Add `--filter until=<timestamp>` for `docker container/image prune`
Upstream-commit: 39c5af4a85
Component: cli
2017-01-09 17:58:01 +01:00
058574859e Merge pull request #29688 from tronicum/since-flag
explain since format and give examples
Upstream-commit: 092eb696e9
Component: cli
2017-01-09 09:27:30 -05:00
d499070791 explain since format and give examples
Signed-off-by: tronicum <tronicum@user.github.com>
Upstream-commit: 6081f43bd1
Component: cli
2017-01-08 05:27:54 +01:00
ec2f9bcbe4 *: use opencontainers/go-digest package
The `digest` data type, used throughout docker for image verification
and identity, has been broken out into `opencontainers/go-digest`. This
PR updates the dependencies and moves uses over to the new type.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 5d67ac20cb
Component: cli
2017-01-06 18:48:41 -08:00
57533e2335 remove -f on secret create and unify usage with other commands
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 62cbb25a17
Component: cli
2017-01-06 14:07:48 -08:00
ec49b3a694 Add .CreatedAt placeholder for docker network ls --format
This fix tries to add a placeholder `.CreatedAt` for Go
format template in `docker network ls --format`.

While working on 29226, I noticed that it is not possible to
display network's creation time in `docker network ls`, with or
without `--format`.

We are able to find the timestamp through `docker network inspect` though.

However, as we allows networks to be pruned based on the timestamp
(see 29226), showing the timestamp in `docker network ls --format`
would be much useful now.

This fix adds the `.CreatedAt` placeholder for `docker network ls --format`.
The default output was not changed for `docker network ls --format`.

A test case for unit tests has been added.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 4e89a50a31
Component: cli
2017-01-04 15:18:44 -08:00
c902dd671a Add --filter until=<timestamp> for docker container/image prune
This fix is a follow up for comment
https://github.com/docker/docker/pull/28535#issuecomment-263215225

This fix provides `--filter until=<timestamp>` for `docker container/image prune`.

This fix adds `--filter until=<timestamp>` to `docker container/image prune`
so that it is possible to specify a timestamp and prune those containers/images
that are earlier than the timestamp.

Related docs has been updated

Several integration tests have been added to cover changes.

This fix fixes #28497.

This fix is related to #28535.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: e2416af013
Component: cli
2017-01-04 14:16:42 -08:00
a1174cb059 keep network option consistent between network connect and run
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: 567b554540
Component: cli
2017-01-04 19:54:03 +08:00
2fcf755a19 Windows to Linux build warning to stdout
Signed-off-by: John Howard <jhoward@microsoft.com>

When building a Dockerfile from a Windows client on a Linux daemon, a
"security warning" is printed
on stderr. Having this warning printed on stderr makes it difficult to
distinguish a failed build from one that's succeeding, and the only way to
suppress the warning is through the -q option, which also suppresses every
output. This change prints the warning on stdout, instead of stderr, to
resolve this situation.
Upstream-commit: 9651fbd197
Component: cli
2017-01-03 14:07:50 -08:00
bdedcec96e Merge pull request #26830 from dnephin/man-desc-in-files
Move the command description to a markdown file for man pages
Upstream-commit: f2cac1b6e8
Component: cli
2017-01-03 17:47:49 +01:00