Commit Graph

476 Commits

Author SHA1 Message Date
ffebf75329 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: bb3c0b246617aecb8ecf9120f07efcf45b94ae09
Component: engine
2017-01-23 14:52:36 +01:00
b0c7dd934b return error when listNode fails
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 8e04e9902a9739a13e5e824339082cc3d361d097
Component: engine
2017-01-19 14:02:06 +08:00
d6bce40c8a Merge pull request #30218 from kevinetc123/patch-typo
fix a typo error
Upstream-commit: 7d0041f9e5dce58366a3ce09e75d82ce307cf28a
Component: engine
2017-01-19 14:34:19 +09:00
0bc7b63417 correct all the formate to formatter
Signed-off-by: kaiwentan <kaiwentan@harmonycloud.cn>
Upstream-commit: b8155bd5bead29bf116aeea9159563e1a6409c41
Component: engine
2017-01-19 11:26:49 +08:00
140c56ac38 Merge pull request #28925 from daehyeok/ineffassign
Refactoring ineffectual assignments
Upstream-commit: 5eda0c59477a7364878351c3d311cd3a4c6dd28d
Component: engine
2017-01-18 15:01:57 +01:00
2351cc0042 purify error message in cli for create and run command
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 3f1feaf4d66a7a8770a0eab4356106be2a18aacb
Component: engine
2017-01-17 17:21:17 +08:00
c249c5ced8 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: 0ea7b143b0a8366799c83a955be676aaf1345214
Component: engine
2017-01-15 01:59:57 +01:00
fed9eaa59d Merge pull request #29856 from Microsoft/jjh/warntoout
Windows to Linux build warning to stdout
Upstream-commit: 7d24cc7710f49f1f3caadf15d9eddb7e3b7a5f0d
Component: engine
2017-01-14 16:37:31 -05:00
fe46c62362 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: 77b8465d7e68ca102d7aae839c7b3fe0ecd28398
Component: engine
2017-01-13 09:51:05 -08:00
287ee51be3 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: 6306019d0bad9c4e60ee437e93f2450dfb0b68c0
Component: engine
2017-01-13 00:27:01 -07:00
07dc948442 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: be20dc15af0cb281bd6d11586cfcc96bd50d12ca
Component: engine
2017-01-12 07:49:22 -08:00
acaf4ba63f 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: 0f30c644441b3b4150252af1b41db99d4b6e697a
Component: engine
2017-01-10 16:31:51 -08:00
9a5d4b9c8d 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: a8e7e37aa82d1adac67b05836ea97a06fbdfdbf0
Component: engine
2017-01-10 16:31:51 -08:00
c1d7d93cb3 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: 3191f5809bc1233bbf2103d2432b75cac93567bb
Component: engine
2017-01-10 10:29:09 +01:00
acc7a7c5ca Merge pull request #29918 from dongluochen/service_inspect_pretty
add port PublishMode to service inspect --pretty output
Upstream-commit: d6c8391bf680b1f7995e0390a346f10b114d1990
Component: engine
2017-01-09 22:43:41 +01:00
a164ad0f0e Merge pull request #29802 from thaJeztah/fix-secret-rm-consistency
Update order of '--secret-rm' and '--secret-add'
Upstream-commit: cd82a31edbae37c31212ac8b23180d90735ceab4
Component: engine
2017-01-09 21:34:05 +01:00
ddcbfb5519 Merge pull request #29143 from vdemeester/node-cli-unit-tests
Add some unit tests to the node and swarm cli code
Upstream-commit: 38f766ae0e4b80d452a3825c42a7ac9fee965790
Component: engine
2017-01-09 20:52:23 +01:00
ccb8041876 add port PublishMode to service inspect --pretty output
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
Upstream-commit: 5470312d236445b54bb6723f47c0966d3b057658
Component: engine
2017-01-09 10:30:28 -08:00
f34f548a3b Merge pull request #29955 from vieux/improve_secret_Create
remove -f on secret create and unify usage with other commands
Upstream-commit: 3e298f46a2318c792dc476a178c3df34d1247fa4
Component: engine
2017-01-09 10:22:39 -08:00
f6ad06ceb6 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: f151c297eb268e22dc1eb36ded0e356885f40739
Component: engine
2017-01-09 18:30:15 +01:00
701de0a381 Merge pull request #29226 from yongtang/28535-prune-until-follow-up
Add `--filter until=<timestamp>` for `docker container/image prune`
Upstream-commit: f1fdbeca2a39c7189b1ca8db4e4543fe77ff1150
Component: engine
2017-01-09 17:58:01 +01:00
31fc922f11 Merge pull request #29688 from tronicum/since-flag
explain since format and give examples
Upstream-commit: d0053a34bc979a49e6a9c11b8b5e0d25f43ea3ec
Component: engine
2017-01-09 09:27:30 -05:00
7f19873a05 explain since format and give examples
Signed-off-by: tronicum <tronicum@user.github.com>
Upstream-commit: 519c35889ebe6b232fa1181709e3464c22fb516a
Component: engine
2017-01-08 05:27:54 +01:00
775c5633ef *: 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: 7a855799175b6b984886ef1cfa337d6df1d4c668
Component: engine
2017-01-06 18:48:41 -08:00
589e081a09 remove -f on secret create and unify usage with other commands
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: db6652ca71c60c1ff3ac274968876c88eb7146ad
Component: engine
2017-01-06 14:07:48 -08:00
0c3b3bfadc 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: 58738cdee327f5de481dcf7d3d377374cbb5f13a
Component: engine
2017-01-04 14:16:42 -08:00
47aebadce2 keep network option consistent between network connect and run
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: 4f9b076e8eecb19083b3875b7cacbc3b660fde75
Component: engine
2017-01-04 19:54:03 +08:00
6019fc383c 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: d45c652e8393416d5a00eaa8864223b786c4182e
Component: engine
2017-01-03 14:07:50 -08:00
0cb4581486 Merge pull request #26830 from dnephin/man-desc-in-files
Move the command description to a markdown file for man pages
Upstream-commit: e4223e33617b9964ea5ecc5a4782171eea7b35d6
Component: engine
2017-01-03 17:47:49 +01:00
eb7043f1ff Merge pull request #25234 from yongtang/25228-service-ps-multiple-ID
Support multiple service IDs on "docker service ps"
Upstream-commit: 18265591c2ae16b2fc831e9922fb27542f97fcf6
Component: engine
2017-01-03 12:40:24 +01:00
93dfbee84c Merge pull request #29806 from albers/fix-plugin-inspect-usage
Fix usage message of `plugin inspect`
Upstream-commit: 187592583c7ba804e8f52b2594cfd496b4c78072
Component: engine
2017-01-02 19:30:24 +01:00
c1643b271a Remove deadcode from service/opts.go, SecretOpt
`SecretOpt` is in the `opts` package, this one is never used, so it's
dead code, removing it 👼.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 84cb2d100b440db2213588e864d0df58315eb50b
Component: engine
2017-01-02 11:19:33 +01:00
8f0e0230a0 Fix usage message of plugin inspect
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 1b58d0bc51e2bfc9e268dab762d1d891c18890c9
Component: engine
2016-12-31 09:55:04 -08:00
b86a1135cd Update order of '--secret-rm' and '--secret-add'
When using both `--secret-rm` and `--secret-add` on `docker service update`,
`--secret-rm` was always performed last. This made it impossible to update
a secret that was already in use on a service (for example, to change
it's permissions, or mount-location inside the container).

This patch changes the order in which `rm` and `add` are performed,
allowing updating a secret in a single `docker service update`.

Before this change, the `rm` was always performed "last", so the secret
was always removed:

    $ echo "foo" | docker secret create foo -f -
    foo

    $ docker service create --name myservice --secret foo nginx:alpine
    62xjcr9sr0c2hvepdzqrn3ssn

    $ docker service update --secret-rm foo --secret-add source=foo,target=foo2 myservice
    myservice

    $ docker service inspect --format '{{ json .Spec.TaskTemplate.ContainerSpec.Secrets }}' myservice | jq .
    null

After this change, the `rm` is performed _first_, allowing users to
update a secret without updating the service _twice_;

    $ echo "foo" | docker secret create foo -f -
    1bllmvw3a1yaq3eixqw3f7bjl

    $ docker service create --name myservice --secret foo nginx:alpine
    lr6s3uoggli1x0hab78glpcxo

    $ docker service update --secret-rm foo --secret-add source=foo,target=foo2 myservice
    myservice

    $ docker service inspect --format '{{ json .Spec.TaskTemplate.ContainerSpec.Secrets }}' myservice | jq .

    [
      {
        "File": {
          "Name": "foo2",
          "UID": "0",
          "GID": "0",
          "Mode": 292
        },
        "SecretID": "tn9qiblgnuuut11eufquw5dev",
        "SecretName": "foo"
      }
    ]

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: e91953407c310b476c44bd82a00b6c6ce64ee7c6
Component: engine
2016-12-31 14:55:29 +01:00
ce228c30e5 Merge pull request #29609 from dnephin/add-compose-file-package
Replace the vendored aanand/compose-file with a local copy
Upstream-commit: edaa3c6f07385f0c08bc62811508c56d821e696f
Component: engine
2016-12-29 15:12:59 -08:00
ce3330c6eb Merge pull request #29683 from vdemeester/runconfig-clean
Clean some stuff from runconfig that are cli only…
Upstream-commit: 1dd941077653bc93ee4141c4d2bac90534678e3f
Component: engine
2016-12-29 17:42:08 +01:00
7e8e39781a Merge pull request #29687 from thaJeztah/cleanup-cli-command-container
Minor cleanups in cli/command/container
Upstream-commit: 4d5cba127b7fccdbc00cfca5fc31d7bf655d8c5e
Component: engine
2016-12-29 09:31:46 +01:00
681436c413 Read long description from a file.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 78101b26afe4f7edbc4218d49238044e3feef54b
Component: engine
2016-12-28 16:08:23 -05:00
9d3a22d754 Merge pull request #29313 from vdemeester/move-cli-config
Move package cliconfig to cli/config
Upstream-commit: 4f657ff55cc91e9196ae980ddf692f763dced271
Component: engine
2016-12-28 09:05:51 -08:00
98526f223f Merge pull request #29668 from dmcgowan/plugins-dct
Support Docker Content Trust for plugins
Upstream-commit: a412c1b7a03e24ba733809924c680f395fad2655
Component: engine
2016-12-28 10:43:32 -05:00
22afb90b38 Merge pull request #29752 from allencloud/fix-nits-in-comments
fix nits in comments
Upstream-commit: 9fab262690a1e9c465687b3dc22f84b053c5624f
Component: engine
2016-12-28 08:33:48 -05:00
edfbbc6ec9 Replace vendor of aanand/compose-file with a local copy.
Add go-bindata for including the schema.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: f5af9b9738892b5988f987ce5fbce6e31a10e768
Component: engine
2016-12-27 16:17:24 -05:00
17e3d2d6b6 Support for docker content trust for plugins
Add integration test for docker content trust

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 14e8bba4f5d39e7a540bee44c133a1e73db48f84
Component: engine
2016-12-27 12:51:00 -08:00
96e9f269ff Merge pull request #29666 from tonistiigi/client-deps
Clean up client binary dependencies
Upstream-commit: bf6eb855391e166a65db284567686fafbe4a9a0a
Component: engine
2016-12-27 15:01:24 -05:00
e23a7bc09c Merge pull request #29716 from yongtang/28885-docker-stack-ps-all
Remove `docker stack ps -a` to match removal of `docker service/node ps -a`
Upstream-commit: efbb23f3e6c585b64e7898a38b0088a0992ea883
Component: engine
2016-12-27 13:56:01 -05:00
0cddfcad2f fix nits in comments
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 6fb05778ba241b344dd9014ff1091e3f70a8b40c
Component: engine
2016-12-27 23:30:50 +08:00
8fc615e678 Move builder cli helper functions to own pkg
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: feaf5902f650f2326e1c41e82dfe28962f1ba46e
Component: engine
2016-12-26 18:53:22 -08:00
1c2e3ffc9c Define PushResult in api types
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 13222160e84a01db2174c0dbf3000761a756fd72
Component: engine
2016-12-26 18:53:22 -08:00
98d0c42181 Remove docker stack ps -a to match removal of docker service/node ps -a
In #28507 and #28885, `docker service/node ps -a` has been removed so that
information about slots are show up even without `-a` flag.

The output of `docker stack ps` reused the same output as `docker service/node ps`.
However, the `-a` was still there. It might make sense to remove `docker stack ps -a`
as well to bring consistency with `docker service/node ps`.

This fix is related to #28507, #28885, and #25983.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 9155e14e77a8235791a6de752f6f43e83308e23d
Component: engine
2016-12-26 13:47:43 -08:00
e55475c7b3 split function out of command description scope
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 0b243acbfccddc150d4bb8321d41713a67e039fc
Component: engine
2016-12-26 13:50:00 +08:00