Commit Graph

667 Commits

Author SHA1 Message Date
Yong Tang 3c47987838 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>
2017-01-10 16:31:51 -08:00
Yong Tang ab2635ead0 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>
2017-01-10 16:31:51 -08:00
Vincent Demeester 70643ad005 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>
2017-01-10 10:29:09 +01:00
Vincent Demeester f28fbb0b69 Merge pull request #29918 from dongluochen/service_inspect_pretty
add port PublishMode to service inspect --pretty output
2017-01-09 22:43:41 +01:00
Sebastiaan van Stijn 583d846c1d Merge pull request #29802 from thaJeztah/fix-secret-rm-consistency
Update order of '--secret-rm' and '--secret-add'
2017-01-09 21:34:05 +01:00
Sebastiaan van Stijn 20f73b1c4e Merge pull request #29143 from vdemeester/node-cli-unit-tests
Add some unit tests to the node and swarm cli code
2017-01-09 20:52:23 +01:00
Dong Chen e8ad538d90 add port PublishMode to service inspect --pretty output
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
2017-01-09 10:30:28 -08:00
Tibor Vass fa1b74a77e Merge pull request #29955 from vieux/improve_secret_Create
remove -f on secret create and unify usage with other commands
2017-01-09 10:22:39 -08:00
Vincent Demeester ee8f9e084a 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>
2017-01-09 18:30:15 +01:00
Sebastiaan van Stijn 39c5af4a85 Merge pull request #29226 from yongtang/28535-prune-until-follow-up
Add `--filter until=<timestamp>` for `docker container/image prune`
2017-01-09 17:58:01 +01:00
Brian Goff 092eb696e9 Merge pull request #29688 from tronicum/since-flag
explain since format and give examples
2017-01-09 09:27:30 -05:00
ttronicum 6081f43bd1 explain since format and give examples
Signed-off-by: tronicum <tronicum@user.github.com>
2017-01-08 05:27:54 +01:00
Stephen J Day 5d67ac20cb *: 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>
2017-01-06 18:48:41 -08:00
Victor Vieux 62cbb25a17 remove -f on secret create and unify usage with other commands
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-06 14:07:48 -08:00
Yong Tang 4e89a50a31 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>
2017-01-04 15:18:44 -08:00
Yong Tang e2416af013 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>
2017-01-04 14:16:42 -08:00
yuexiao-wang 567b554540 keep network option consistent between network connect and run
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2017-01-04 19:54:03 +08:00
John Howard 9651fbd197 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.
2017-01-03 14:07:50 -08:00
Sebastiaan van Stijn f2cac1b6e8 Merge pull request #26830 from dnephin/man-desc-in-files
Move the command description to a markdown file for man pages
2017-01-03 17:47:49 +01:00
Vincent Demeester 636e546aa1 Merge pull request #25234 from yongtang/25228-service-ps-multiple-ID
Support multiple service IDs on "docker service ps"
2017-01-03 12:40:24 +01:00
Vincent Demeester d3d8379a16 Merge pull request #29806 from albers/fix-plugin-inspect-usage
Fix usage message of `plugin inspect`
2017-01-02 19:30:24 +01:00
Vincent Demeester b5bc69238c 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>
2017-01-02 11:19:33 +01:00
Harald Albers 87fea846fc Fix usage message of `plugin inspect`
Signed-off-by: Harald Albers <github@albersweb.de>
2016-12-31 09:55:04 -08:00
Sebastiaan van Stijn edeb5b6e0d 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>
2016-12-31 14:55:29 +01:00
Tõnis Tiigi 1eedfcf0ce Merge pull request #29609 from dnephin/add-compose-file-package
Replace the vendored aanand/compose-file with a local copy
2016-12-29 15:12:59 -08:00
Sebastiaan van Stijn 2e880dd199 Merge pull request #29683 from vdemeester/runconfig-clean
Clean some stuff from runconfig that are cli only…
2016-12-29 17:42:08 +01:00
Vincent Demeester 734f695b29 Merge pull request #29687 from thaJeztah/cleanup-cli-command-container
Minor cleanups in cli/command/container
2016-12-29 09:31:46 +01:00
Xianglin Gao 5860dd5f80 exit collect when we get EOF
Signed-off-by: Xianglin Gao <xlgao@zju.edu.cn>
2016-12-29 13:38:30 +08:00
Daniel Nephin 48930c8bbf Read long description from a file.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-12-28 16:08:23 -05:00
Alexander Morozov 6b5ddb5cf8 Merge pull request #29313 from vdemeester/move-cli-config
Move package cliconfig to cli/config
2016-12-28 09:05:51 -08:00
Brian Goff 2a66659625 Merge pull request #29668 from dmcgowan/plugins-dct
Support Docker Content Trust for plugins
2016-12-28 10:43:32 -05:00
Doug Davis c27216af3d Merge pull request #29752 from allencloud/fix-nits-in-comments
fix nits in comments
2016-12-28 08:33:48 -05:00
Daniel Nephin 52c0157036 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>
2016-12-27 16:17:24 -05:00
Derek McGowan fcaa89f296 Support for docker content trust for plugins
Add integration test for docker content trust

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-12-27 12:51:00 -08:00
Brian Goff d4404e6d1c Merge pull request #29666 from tonistiigi/client-deps
Clean up client binary dependencies
2016-12-27 15:01:24 -05:00
Brian Goff 0f686b1e45 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`
2016-12-27 13:56:01 -05:00
allencloud 4e68d651b3 fix nits in comments
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-12-27 23:30:50 +08:00
Tonis Tiigi c41bfce39a Move builder cli helper functions to own pkg
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-12-26 18:53:22 -08:00
Tonis Tiigi bcc61e1300 Define PushResult in api types
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-12-26 18:53:22 -08:00
Yong Tang 65be5677bd 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>
2016-12-26 13:47:43 -08:00
allencloud 3e7dca7900 split function out of command description scope
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-12-26 13:50:00 +08:00
Sebastiaan van Stijn f459796896 Minor cleanups in cli/command/container
This change does some minor cleanups in the
cli/command/container package;

- sort imports
- replace `fmt.Fprintf()` with `fmt.Fprintln()` if no formatting is used
- replace `fmt.Errorf()` with `errors.New()` if no formatting is used
- remove some redundant `else`'s

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-26 01:33:25 +01:00
Vincent Demeester bfe47a124a Move package cliconfig to cli/config
I felt it made more sence 👼

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-25 20:31:52 +01:00
Vincent Demeester 6726879382 Clean some stuff from runconfig that are cli only…
… or could be in `opts` package. Having `runconfig/opts` and `opts`
doesn't really make sense and make it difficult to know where to put
some code.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-24 13:16:00 +01:00
Tonis Tiigi 2825296deb 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>
2016-12-23 13:29:58 -08:00
Anusha Ragunathan ae76b43227 Merge pull request #29599 from anusha-ragunathan/refcount
Enforce zero plugin refcount during disable, not remove.
2016-12-22 15:38:54 -08:00
Anusha Ragunathan bf3250ae0a 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>
2016-12-22 13:26:53 -08:00
Yong Tang d04375bd4a Support multiple service IDs on "docker service ps"
This fix tries to address issue raised in 25228 to support
multiple service IDs on `docker service ps`.

Multiple IDs are allowed with `docker service ps ...`, and
related documentation has been updated.

A test has been added to cover the changes.

This fix fixes 25228.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-12-22 11:33:47 -08:00
Sebastiaan van Stijn 6c1299e819 Merge pull request #29314 from vdemeester/no-more-utils
Remove the utils package
2016-12-22 15:21:05 +01:00
Vincent Demeester ea51e6159f Merge pull request #29603 from mstanleyjones/docker_diff_improvements
Clarify what docker diff shows
2016-12-22 15:15:01 +01:00
Brian Goff 9b17b8ea18 Merge pull request #29212 from yongtang/29185-docker-inspect
Fix `docker plugin inspect <unkown object>` issue on Windows
2016-12-21 15:47:17 -05:00
Brian Goff 63677ef495 Merge pull request #28714 from thaJeztah/move-logdriver-check-to-daemon
move check for supported drivers to daemon
2016-12-21 13:47:30 -05:00
Brian Goff b373d1b81e Merge pull request #29491 from yongtang/12162016-stats-error
Improve error output for `docker stats ...`
2016-12-21 13:19:20 -05:00
Brian Goff a4be350fb0 Merge pull request #29527 from allencloud/change-minor-mistake
change minor mistake of spelling
2016-12-21 13:15:00 -05:00
Yong Tang 86a07d3fec 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>
2016-12-20 21:05:10 -08:00
Misty Stanley-Jones 606a16a07d Clarify what docker diff shows
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-12-20 17:03:11 -08:00
Tibor Vass df760c86cf 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
2016-12-20 13:21:47 -08:00
allencloud 3c8d009c7a change minor mistake of spelling
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-12-20 21:05:19 +08:00
Yong Tang 23ab849f06 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>
2016-12-19 19:35:05 -08:00
Tibor Vass 285710d3c8 Merge pull request #29246 from thaJeztah/improve-swarm-check-in-inspect
Ignore certificate expiry error for top-level inspect
2016-12-19 15:37:53 -08:00
Tõnis Tiigi 91f9b72481 Merge pull request #29339 from dmcgowan/plugins-abstract-download-manager
Abstract layerstore from pull/push distribution code
2016-12-19 13:32:28 -08:00
Derek McGowan 476adcfd20 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>
2016-12-19 10:55:00 -08:00
Sebastiaan van Stijn 8246c49498 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>
2016-12-19 14:30:01 +01:00
Sebastiaan van Stijn a3c24bf450 Merge pull request #28629 from yongtang/28581-secret-create-input
Add `--file` flag for `docker secret create` command
2016-12-18 03:04:10 +01:00
Yong Tang c6b3fcbe32 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>
2016-12-17 16:51:11 -08:00
Sebastiaan van Stijn fc1222118d Merge pull request #29423 from unclejack/api_cli_integ_return
return directly without ifs in remaining packages
2016-12-17 21:30:47 +01:00
Ying Li e4102ce61e 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>
2016-12-16 17:16:55 -08:00
Vincent Demeester 15bcbad07a Merge pull request #29003 from dnephin/pkg-compose-transform
Move composefile -> engine api type conversion to `cli/compose/convert`
2016-12-16 23:34:41 +01:00
Daniel Nephin c4ea22972f Move pkg to cli/compose/convert
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-12-16 12:27:31 -05:00
Daniel Nephin 31355030b3 Move ConvertService to composetransform package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-12-16 12:20:07 -05:00
Daniel Nephin af6a411358 Move ConvertVolumes to composetransform package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-12-16 11:51:13 -05:00
Daniel Nephin a28db56b0f Move ConvertNetworks to composetransform package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-12-16 11:51:13 -05:00
Sebastiaan van Stijn 4cf95aeaa2 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>
2016-12-16 15:10:20 +01:00
unclejack 9197940e4e return directly without ifs in remaining packages
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2016-12-14 23:28:27 +02:00
Aaron Lehmann fdb6a6ee1c 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>
2016-12-14 10:49:33 -08:00
Aaron Lehmann 639f97daea 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>
2016-12-14 10:49:32 -08:00
Sebastiaan van Stijn 4a5426ef16 Merge pull request #28943 from vdemeester/publish-long-short-syntax
Remove --port and update --publish for services to support syntaxes
2016-12-14 17:55:48 +01:00
Vincent Demeester 340eb44b73 Merge pull request #29288 from Microsoft/jjh/promptusestdin
Windows: Prompt fix use regular stdin
2016-12-13 21:18:54 +01:00
Sebastiaan van Stijn 518b65c6f5 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>
2016-12-13 17:22:43 +01:00
Yong Tang 8e680c48f1 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>
2016-12-13 07:35:45 -08:00
Yong Tang 249d4e5709 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>
2016-12-13 05:05:04 -08:00
Vincent Demeester bc8091d9cc Merge pull request #29267 from yuexiao-wang/fix-bulid-para
Update the option for docker build
2016-12-13 08:55:20 +01:00
yuexiao-wang dd2b83e297 Update the option 'network' for docker build
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-12-13 18:18:53 +08:00
Sebastiaan van Stijn ded2ece9ad Merge pull request #29196 from aluzzardi/service-ps-output
service ps: Revert output to 1.12 behavior.
2016-12-12 17:20:45 +01:00
Vincent Demeester 26fca512dd Move templates to pkg/templates
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-12 09:34:03 +01:00
Vincent Demeester a51750a650 Move debug functions to cli/debug package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-12 09:33:58 +01:00
Vincent Demeester b4a6d83dc2 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>
2016-12-11 23:14:54 +01:00
Vincent Demeester 7fbc616b47 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>
2016-12-11 23:14:54 +01:00
John Howard 1da163febe Windows: Prompt fix
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-12-09 14:27:53 -08:00
Sebastiaan van Stijn f099e134e4 Merge pull request #25860 from yongtang/1396-service-update-publish-rm
Return error for incorrect argument of `service update --publish-rm`
2016-12-08 20:09:56 +01:00
Sebastiaan van Stijn 72d7156784 Merge pull request #29020 from wefine/commands_order
Give a order to AddCommands, for better read and maintenance.
2016-12-08 15:13:22 +01:00
Sebastiaan van Stijn e2b06ebc88 Merge pull request #29041 from aaronlehmann/hide-updatestatus
api: Hide UpdateStatus when it is not present
2016-12-08 13:55:13 +01:00
wefine e41cf4a860 Give a order to AddCommands, for easy read and maintenance.
Signed-off-by: wefine <wang.xiaoren@zte.com.cn>
2016-12-08 16:43:14 +08:00
Tõnis Tiigi 4b7ad6c23e Merge pull request #29104 from duglin/Issue29084
Fix processing of unset build-args during build
2016-12-07 17:18:55 -08:00
Doug Davis f1801ba475 Fix processing of unset build-args during build
This reverts 26103.  26103 was trying to make it so that if someone did:
  docker build --build-arg FOO .
and FOO wasn't set as an env var then it would pick-up FOO from the
Dockerfile's ARG cmd.  However, it went too far and removed the ability
to specify a build arg w/o any value. Meaning it required the --build-arg
param to always be in the form "name=value", and not just "name".

This PR does the right fix - it allows just "name" and it'll grab the value
from the env vars if set. If "name" isn't set in the env then it still needs
to send "name" to the server so that a warning can be printed about an
unused --build-arg. And this is why buildArgs in the options is now a
*string instead of just a string - 'nil' == mentioned but no value.

Closes #29084

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-12-07 07:41:55 -08:00
Andrea Luzzardi 43ed65ee28 service ps: Revert output to 1.12 behavior.
- Display the ID column
- Do not append the task ID in the name column
- (NEW): Truncate task IDs, unless --no-trunc is specified

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2016-12-06 18:52:47 -08:00
Aaron Lehmann a5a246dbbc registry: Remove reference.go
This removes some very old vestigial code that really should have been
removed during the content addressability transition. It implements
something called "reference" but it behaves differently from the actual
reference package. This was only used by client-side content trust code,
and is relatively easy to extricate.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-12-06 15:53:21 -08:00
Vincent Demeester 2bf94d9226 Merge pull request #29073 from adshmh/28756-print-checkpoint-name-in-checkpoint-create-command
Print checkpoint id when creating a checkpoint
2016-12-06 11:06:29 +01:00
Vincent Demeester 0e1a2e1f27 Merge pull request #28896 from yongtang/28884-secret-name-mask-ID
Fix issue where secret ID is masked by name
2016-12-06 11:05:30 +01:00
Vincent Demeester 652b457a60 Merge pull request #28535 from yongtang/28497-prune-until
Convert DanglingOnly to Filters for `docker image prune`
2016-12-06 11:03:45 +01:00
Vincent Demeester 68db0a20dd Handle logging in compose to swarm
Logging configuration was completely ignore when deploy a compose file
to swarm. This fixes it.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-05 15:18:36 +01:00
Anusha Ragunathan f9f00faf63 Merge pull request #28967 from yongtang/28946-support-plugin-docker-inspect
Support plugin type in `docker inspect`
2016-12-04 18:30:38 -08:00
Yong Tang ff9ff6fdd2 Fix issue where secret ID is masked by name
This fix tries to address the issue in 28884 where
it is possible to mask the secret ID by name.

The reason was that searching a secret is based on name.
However, searching a secret should be done based on:
- Full ID
- Full Name
- Partial ID (prefix)

This fix addresses the issue by changing related implementation
in `getCliRequestedSecretIDs()`

An integration test has been added to cover the changes.

This fix fixes 28884

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-12-02 20:24:29 -08:00
Yong Tang dd39897fca Convert DanglingOnly to Filters for `docker image prune`
This fix convert DanglingOnly in ImagesPruneConfig to Filters,
so that it is possible to maintain API compatibility in the future.

Several integration tests have been added to cover changes.

This fix is related to 28497.

A follow up to this PR will be done once this PR is merged.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-12-02 20:08:49 -08:00
Yong Tang 0449997cf6 Add `ID` field for `docker plugin ls`
This fix tries to address the enhancement proposed in 28708 to display
ID field for the output of `docker plugin ls`.

This fix add `ID` field to the output of `docker plugin ls`

Related docs has been updated.

This fix fixes 28708.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-12-02 13:42:50 -08:00
Yong Tang 492c2c8da8 Support plugins in `docker inspect`
This fix tries to address the proposal raised in 28946
to support plugins in `docker inspect`.

The command `docker inspect` already supports
"container", "image", "node", "network", "service", "volume", "task".
However, `--type plugin` is not supported yet at the moment.

This fix address this issue by adding the support of `--type plugin`
for `docker inspect`.

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

This fix fixes 28946.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-12-02 11:33:29 -08:00
Anusha Ragunathan ae4fc345a4 Merge pull request #28789 from yongtang/28735-plugin-inspect-id-or-name
Allow `docker plugin inspect` to search based on ID or name
2016-12-02 08:46:47 -08:00
Arash Deshmeh b68a6ad2ac Print checkpoint id when creating a checkpoint
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2016-12-01 23:30:14 -05:00
Yong Tang 8597e231a5 Return error for incorrect argument of `service update --publish-rm <TargetPort>`
Currently `--publish-rm` only accepts `<TargetPort>` or `<TargetPort>[/Protocol]`
though there are some confusions.

Since `--publish-add` accepts `<PublishedPort>:<TargetPort>[/Protocol]`, some user
may provide `--publish-rm 80:80`. However, there is no error checking so the incorrect
provided argument is ignored silently.

This fix adds the check to make sure `--publish-rm` only accepts `<TargetPort>[/Protocol]`
and returns error if the format is invalid.

The `--publish-rm` itself may needs to be revisited to have a better UI/UX experience,
see discussions on:
https://github.com/docker/swarmkit/issues/1396
https://github.com/docker/docker/issues/25200#issuecomment-236213242
https://github.com/docker/docker/issues/25338#issuecomment-240787002

This fix is short term measure so that end users are not misled by the silently ignored error
of `--publish-rm`.

This fix is related to (but is not a complete fix):
https://github.com/docker/swarmkit/issues/1396

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-12-01 17:46:53 -08:00
Aaron Lehmann 8a379d7bce api: Hide UpdateStatus when it is not present
When UpdateStatus was not present, the empty values of the timestamps
would be present:

        "UpdateStatus": {
            "StartedAt": "0001-01-01T00:00:00Z",
            "CompletedAt": "0001-01-01T00:00:00Z"
        }

To fix this, make the timestamps pointers, so they can be set to nil
when they should not be shown.

Also make UpdateStatus itself a pointer, so an empty object does not
show up when there is no UpdateStatus.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-12-01 15:08:41 -08:00
Yong Tang 312958f4db Allow `docker plugin inspect` to search based on ID or name
This fix tries to address the issue raised in discussion of
PR 28735 where it was not possible to manage plugin based on
plugin ID. Previously it was not possible to invoke
`docker plugin inspect` with a plugin ID (or ID prefix).

This fix updates the implementation of `docker plugin inspect`
so that it is possbile to search based on a plugin name, or a
plugin ID. A short format of plugin ID (prefix) is also possible,
as long as there is no ambiguity.

Previously the check of `docker plugin inspect` was mostly done
on the client side. This could potentially cause inconsistency
between API and CMD. This fix move all the checks to daemon side
so that API and CMD will be consistent.

An integration test has been added to cover the changes.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-12-01 10:44:17 -08:00
Jake Sanders c84b90291c Add registry-specific credential helper support
Signed-off-by: Jake Sanders <jsand@google.com>
2016-12-01 10:29:00 -08:00
Sebastiaan van Stijn ebd8ec6c3f Merge pull request #28922 from yuexiao-wang/fix-secret
Fix the inconsistency for secret ls and secrect rm
2016-12-01 11:29:58 +01:00
yuexiao-wang cd79095c81 Fix the use for secret create
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-12-01 19:48:33 +08:00
Alexander Morozov d94d204f97 Merge pull request #28885 from vdemeester/revert-service-ps-all
Revert "Add -a option to service/node ps"
2016-11-30 12:02:34 -08:00
yuexiao-wang 7a9e414988 Fix the inconsistency for docker secret
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-11-30 17:23:39 +08:00
Victor Vieux d3411b7a70 Merge pull request #28876 from vdemeester/28835-better-handling-of-external-networks
stack deploy: handle external network when deploying
2016-11-29 15:00:35 -08:00
Vincent Demeester 9ab6d420b9 Merge pull request #28919 from allencloud/change-secret-remove-in-cli
change secret remove logic in cli
2016-11-29 15:08:24 +01:00
Vincent Demeester b82f2ce501 Merge pull request #28874 from yuexiao-wang/fix-layer-typo
Fix some typos
2016-11-29 14:45:08 +01:00
yuexiao-wang 5e2a13b971 Fix some typos
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-11-30 03:01:32 +08:00
Sebastiaan van Stijn dea82af0ea Merge pull request #28904 from dnephin/add-volume-labels-to-deploy
Use namespace label on stack volumes
2016-11-29 14:39:26 +01:00
allencloud 0227275b7f change secret remove logic in cli
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-11-29 15:12:05 +08:00
Daniel Nephin 798c4a614e Use namespace label on stack volumes.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-28 18:02:39 -05:00
John Howard a913891b7d Align output of docker version again
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-11-28 11:38:58 -08:00
Vincent Demeester 6ffb62368a Revert "Add -a option to service/node ps"
This reverts commit 139fff2bf0ebe12b61871ba8ec8be8d51c2338db.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-11-28 18:08:45 +01:00
Vincent Demeester a0ce75c25d Merge pull request #28822 from yuexiao-wang/modify-plugin
Modify repoName to PLUGIN for docker plugin create
2016-11-28 17:52:04 +01:00
Vincent Demeester 8e63000bf3 stack deploy: handle external network when deploying
If the network is marked as external, don't use the namespace on
it. Otherwise, it's not found.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-11-28 17:38:41 +01:00
Kei Ohmura 8feea86e0f fix description of 'docker swarm init'
Signed-off-by: Kei Ohmura <ohmura.kei@gmail.com>
2016-11-28 13:24:02 +09:00
Antonio Murdaca a0f447d124 Merge pull request #28780 from vieux/accept_src_in_secret
support src in --secret
2016-11-26 14:34:30 +01:00
Vincent Demeester 60da1d9830 Merge pull request #28815 from dnephin/add-short-option
Add a short flag for docker stack deploy
2016-11-25 21:18:09 +01:00
Daniel Nephin 7b35599e2d Add a short flag for docker stack deploy
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-25 13:23:36 -05:00
yuexiao-wang 48537db849 Modify reponame to PLUGIN and fix some typos
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-11-25 23:09:46 +08:00
Daniel Nephin c40696023b Allow hostname to be updated on service.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-24 15:44:35 -05:00
Yong Tang 961046c5a8 Update docs of `docker network ls --filter`
Currently the help output of `docker network ls --filter` is:
```
Options:
  -f, --filter value   Provide filter values (i.e. 'dangling=true') (default [])
  ...
```
This caused confusion as only the following filters are supported at the moment:
 - `driver`
 - `type`
 - `name`
 - `id`
 - `label`

This fix update the help output of `docker network ls --filter` and `network_ls.md`.
The `dangling=true` description has been replace to:
```
Options:
  -f, --filter filter   Provide filter values (i.e. 'driver=bridge')
  ...
```

This fix fixes 28786.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-11-24 08:14:36 -08:00
yuexiao-wang 7a89624bd5 Add options for docker plugin enable and fix some typos
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-11-25 04:07:06 +08:00
Victor Vieux dc5c8a7713 support src in --secret
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-23 14:30:57 -08:00
Vincent Demeester 36c919d313 Merge pull request #28675 from dnephin/no-swarmmode-error-on-deploy
Better error message on stack deploy when not a swarm manager
2016-11-23 22:47:13 +01:00
Daniel Nephin 5ead1cc490 Better error message on stack deploy against not a swarm.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-23 12:15:11 -05:00
erxian 0171a79c56 update secret command
Signed-off-by: erxian <evelynhsu21@gmail.com>
2016-11-23 10:07:09 -05:00
Victor Vieux d8787ecd81 Merge pull request #28716 from ehazlett/fix-multi-secret-inspect
Update secret inspect to support IDs
2016-11-22 17:39:48 -08:00
cyli 357cabef2d Do not display the digest or size of swarm secrets
Signed-off-by: cyli <cyli@twistedmatrix.com>
2016-11-22 18:13:27 -05:00
Evan Hazlett 46cd1fa87b update secret inspect to support IDs
This updates secret inspect to support inspect by ID in addition to name
as well as inspecting multiple secrets.  This also cleans up the
help text for consistency.

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-11-22 16:01:16 -05:00
Tibor Vass e0ad93a836 Merge pull request #28595 from anusha-ragunathan/plugin_timeout
Allow HTTP client timeout to be configurable on plugin enable.
2016-11-22 10:17:10 -08:00
Vincent Demeester 1318c8dcb4 Merge pull request #28445 from cpuguy83/28439_fix_client_rm_on_old_daemons
Handle `run --rm` against older daemons on the cli
2016-11-22 14:25:03 +01:00
Vincent Demeester 7d0f584f54 Merge pull request #28659 from xuzhenglun/master
bugfix: incorrect ErrConnectFailed Comparison
2016-11-22 13:01:05 +01:00
Reficul 14770269e8 fix incorrect ErrConnectFailed comparison
Signed-off-by: Reficul <xuzhenglun@gmail.com>
2016-11-22 10:42:55 +08:00
Brian Goff 4632a029d9 Handle `run --rm` against older daemons on the cli
For previous versions of Docker, `--rm` was handled client side, as such
there was no support in the daemon for it.
Now it is handled daemon side, but we still need to handle the case of a
newer client talking to an older daemon.

Falls back to client-side removal when the daemon does not support it.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-11-21 20:39:04 -05:00
Victor Vieux 23c399dd10 Merge pull request #28677 from dnephin/remove-deploy-experimental
Move `docker stack` out of experimental
2016-11-21 14:33:35 -08:00
Victor Vieux 07c896b18e Merge pull request #28328 from aaronlehmann/duration-opts
cli: Add valid suffixes for remaining duration options
2016-11-21 14:03:00 -08:00
Victor Vieux 2d66496a2b Merge pull request #28504 from runcom/fix-info-route-secopt
api: types: do not remove old SecurityOptions struct
2016-11-21 13:55:07 -08:00
Anusha Ragunathan 752a9a7c56 Add HTTP client timeout.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-11-21 13:11:40 -08:00
Vincent Demeester 2d7ef04a57 Merge pull request #28556 from ehazlett/container-secret-store
Fix target reference secrets and container secret store
2016-11-21 21:40:01 +01:00
Daniel Nephin e1b5bdd768 Move docker stack out of experimental
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-21 15:30:25 -05:00
Vincent Demeester 2638cd6f3d Do not panic if network is nil
network is `nil` if the following case:

```
services:
  foo:
    image: nginx
    networks:
      mynetwork:
```

It's a valid compose so we should not panic.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-11-21 17:59:29 +01:00
Vincent Demeester 89703a0196 Merge pull request #28539 from nishanttotla/pin-image-digest-ux
Suppressing digest for docker service ls/ps
2016-11-21 14:06:37 +01:00
Vincent Demeester 4e343ae989 Merge pull request #28294 from vdemeester/compose-swarm-healthcheck
Add support for healthcheck in compose to swarm
2016-11-21 10:28:37 +01:00
Antonio Murdaca 123d33d81d api: types: keep info.SecurityOptions a string slice
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-11-19 13:21:16 +01:00
Sebastiaan van Stijn 82804cc8e5 swap position of "host" and "ip"
the service definition uses the format as defined
in  http://man7.org/linux/man-pages/man5/hosts.5.html
(IP_address canonical_hostname [aliases...])

This format is the _reverse_ of the format used in
the container API.

Commit f32869d956eb175f88fd0b16992d2377d8eae79c
inadvertently used the incorrect order.

This fixes the order, and correctly sets it to;

    IP-Address hostname

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-11-18 22:04:27 +01:00
Nishant Totla 5f1209bf4b Suppressing digest for docker service ls/ps
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
2016-11-18 09:39:34 -08:00
Aaron Lehmann b866fa77f4 Return warnings from service create and service update when digest pinning fails
Modify the service update and create APIs to return optional warning
messages as part of the response. Populate these messages with an
informative reason when digest resolution fails.

This is a small API change, but significantly improves the UX. The user
can now get immediate feedback when they've specified a nonexistent
image or unreachable registry.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-11-18 09:31:31 -08:00
Daniel Nephin c682f10a8f Default parallelism to 1.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-18 16:17:08 +01:00
Vincent Demeester e21f4f9996 Add support for healthcheck in composefile v3
`docker stack deploy` now supports a composefile v3 format that have a
healthcheck.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-11-18 15:09:13 +01:00
Vincent Demeester dd8712c634 Merge pull request #28354 from ripcurld00d/tag_creation
Change the docker-tag usage text to be clearer
2016-11-18 13:02:40 +01:00
Boaz Shuster cc36bf62ef Change the docker-tag usage text to be clearer
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2016-11-18 10:34:02 +02:00
Michael Crosby e59facceb7 Merge pull request #28347 from yongtang/28339-ignore-unkwnon-field-template
Use `map[string]bool` for `preProcessor` to ignore unknown fields
2016-11-17 15:13:02 -08:00
Tõnis Tiigi 4e4b58fbcb Merge pull request #28554 from vieux/showhelp
refactor help func in CLI
2016-11-17 14:27:26 -08:00
Evan Hazlett bc542f365c do not force target type for secret references
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

use secret store interface instead of embedded secret data into container

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-11-17 15:49:02 -05:00
Brian Goff a7987ef105 Merge pull request #28538 from yongtang/11162016-Log-Logf-fix
Fix several issues with `go vet` and `gofmt -s`
2016-11-17 15:21:22 -05:00
Victor Vieux 55908f8a82 refactor help func in CLI
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-17 10:54:10 -08:00
Yong Tang d691bce8c9 Fix several issues with `go vet` and `go fmt`
For some reason, `go vet` and `go fmt` validate does not capture
several issues.

The following was the output of `go vet`:
```
ubuntu@ubuntu:~/docker$ go vet ./... 2>&1 | grep -v ^vendor | grep -v '^exit status 1$'
cli/command/formatter/container_test.go:393: possible formatting directive in Log call
volume/volume_test.go:257: arg mp.RW for printf verb %s of wrong type: bool
```

The following was the output of `go fmt -s`:
```
ubuntu@ubuntu:~/docker$ gofmt -s -l . | grep -v ^vendor
cli/command/stack/list.go
daemon/commit.go
```

Fixed above issues with `go vet` and `go fmt -s`

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-11-17 06:31:28 -08:00
Yong Tang 4488d9f9fb Fix crash caused by `docker service inspect --pretty`
This fix tries to fix the crash caused by `docker service inspect --pretty`,
by performing necessary nil pointer check.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-11-16 17:26:03 -08:00
Yong Tang 3c56459801 Use `map[string]bool` for `preProcessor` to ignore unknwon field
This fix is an attempt to address the issue raised in 28339. In
`docker ps`, the formatter needs to expose all fields of `types.Container`
to `preProcessor` so that template could be executed.

This direct exposing is unreliable and could cause issues as user may incorrectly
assume all fields in `types.Container` will be available for templating.

However, the purpose of `preProcessor` is to only find out if `.Size`
is defined (so that opts.size could be set accordingly).

This fix defines `preProcessor` as `map[string]bool` with a func `Size()`.
In this way, any unknown fields will be ignored.

This fix adds several test cases to the existing `TestBuildContainerListOptions`.

This fix fixes 28339.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-11-16 13:23:47 -08:00
Sebastiaan van Stijn 91aed2e673 Merge pull request #28272 from Microsoft/jjh/sequentialscan2
Windows: Perf: Use sequential file access
2016-11-16 00:47:19 +01:00
Sebastiaan van Stijn 66d50e5695 Merge pull request #26868 from Microsoft/jjh/deprecateemail
1.14 deprecation: email from login
2016-11-15 13:08:05 +01:00
John Howard 5723c85b1d Windows: Use sequential file access
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-11-14 17:41:52 -08:00
Victor Vieux dc2eeb6456 Merge pull request #28340 from cpuguy83/28337_fix_template_opts_ps
Fix issue with missing fields for `ps` template
2016-11-14 14:25:01 -08:00
Anusha Ragunathan f1598f8b82 Add docs for plugin push
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-11-14 09:10:21 -08:00
Brian Goff d3169abc3b Fix issue with missing fields for `ps` template
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-11-12 11:23:21 -05:00
yupeng 0f6af2074c context.Context should be the first parameter of a function
Signed-off-by: yupeng <yu.peng36@zte.com.cn>
2016-11-12 14:14:34 +08:00
Aaron Lehmann 7e7c4eefa4 cli: Add valid suffixes for remaining duration options
A recent PR added `(ns|us|ms|s|m|h)` to the descriptions of some
duration options, but not all. Add it to the remaining options for
consistency.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-11-11 17:44:42 -08:00
John Howard 4088f3bcff Planned 1.13 deprecation: email from login
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-11-11 17:32:46 -08:00
Vincent Demeester 827b121154 Merge pull request #28306 from ehazlett/service-create-no-secrets
only check secrets for service create if requested
2016-11-11 20:58:40 +01:00
Victor Vieux 460a7e213c Merge pull request #28042 from yongtang/28018-docker-info-swarm-managers
Add information for `Manager Addresses` in the output of `docker info`
2016-11-11 09:30:01 -08:00
Brian Goff 356ff43768 Merge pull request #27872 from vdemeester/images-filter-filters
Add reference filter and deprecated filter param…
2016-11-11 11:24:19 -05:00
Sebastiaan van Stijn 57da27f76c Merge pull request #28297 from vdemeester/compose-swarm-openstdin
Add support for stdin_open in compose to swarm
2016-11-11 17:09:04 +01:00
Yong Tang cd71257cfd Add information for `Manager Addresses` in the output of `docker info`
As is specified in 28018, it would be useful to know the manager's addresses
even in a worker node. This is especially useful when there are many
worker nodes in a big cluster.

The information is available in `info.Swarm.RemoteManagers`.

This fix add the information of `Manager Addresses` to the output
of `docker info`, to explicitly show it.

A test has been added for this fix.

This fix fixes 28018.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-11-11 07:35:32 -08:00
Evan Hazlett 885c5f1747 only check secrets for service create if requested
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-11-11 10:07:24 -05:00
Vincent Demeester 3c61af0f76 Add reference filter and deprecated filter param…
… for `docker images`.

This deprecates the `filter` param for the `/images` endpoint and make a
new filter called `reference` to replace it. It does change the CLI
side (still possible to do `docker images busybox:musl`) but changes the
cli code to use the filter instead (so that `docker images --filter
busybox:musl` and `docker images busybox:musl` act the same).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-11-11 15:34:01 +01:00
Vincent Demeester 84a795bf05 Add support for extra_hosts in composefile v3
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-11-11 15:20:02 +01:00
Vincent Demeester f24ff647e1 Add support for stdin_open in composefile v3
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-11-11 15:19:00 +01:00
Vincent Demeester 356421b7da Add support for tty in composefile v3
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-11-11 11:27:21 +01:00
Victor Vieux 19c8941f2f Merge pull request #27955 from mlaventure/runc-docker-info
Add external binaries version to docker info
2016-11-10 21:27:14 -08:00
Tõnis Tiigi 795e487513 Merge pull request #28235 from dmcgowan/fix-registry-authorization-errors
Fix registry authorization errors
2016-11-10 19:39:28 -08:00
Jana Radhakrishnan 148dc157f6 Add support for host port PublishMode in services
Add api/cli support for adding host port PublishMode in services.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-11-10 18:07:55 -08:00
Victor Vieux 7d89ba2d9d Merge pull request #27998 from dnephin/compose-on-swarm
Support `docker stack deploy` from a Compose file
2016-11-10 17:59:57 -08:00
Lei Jitang 005a3037de Merge pull request #28231 from yuexiao-wang/container-exec
Remove redundant parameter and fix typos
2016-11-11 09:55:42 +08:00
Derek McGowan 43bcd982cd Update for distribution vendor
Handle updates to reference package.
Updates for refactoring of challenge manager.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-11-10 17:34:12 -08:00
Victor Vieux 63167f17b0 Merge pull request #28226 from vieux/exit_exp_plugin
move plugins out of experimental
2016-11-10 17:30:54 -08:00
Victor Vieux 32beb80f99 Merge pull request #28031 from yongtang/27902-extra-hosts
Add flag `--host` to `service create` and `--host-add/rm` to `service update`
2016-11-10 16:55:29 -08:00
Victor Vieux f5cea67e33 move plugins out of experimental
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-11-10 15:51:32 -08:00
Andrea Luzzardi 79e1fd01ce Merge pull request #28089 from aluzzardi/service-logs
service logs
2016-11-10 15:13:41 -08:00
Victor Vieux d04c77bdae Merge pull request #28253 from aaronlehmann/arg-descriptions
cli: Change autolock flag description
2016-11-10 13:59:46 -08:00
Andrea Luzzardi b059cf5286 cli: docker service logs support
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2016-11-10 13:46:02 -08:00
Michael Crosby 6bf79deab5 Merge pull request #27797 from vdemeester/stats-format-names-support
Add support for Names and ID in stats format
2016-11-10 13:26:00 -08:00
Daniel Nephin cb1783590c Implement ipamconfig.subnet and be more explicit about restart policy always.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-10 16:22:31 -05:00
Aaron Lehmann fd5673eeb9 cli: Change autolock flag description
This change incorporates feedback from @thaJeztah in the PR that added
the autolock flag. It changes the descriptions to be different for
"swarm init" and "swarm update" so that the boolean nature so that the
purpose of the flag in both contexts is clearer.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-11-10 12:05:19 -08:00
Yong Tang 6f3ee9c568 Add flag `--host` to `service create` and `--host-add/--host-rm` to `service update`
This fix tries to address 27902 by adding a flag `--host`
to `docker service create` and `--host-add/--host-rm` to
`docker service update`, so that it is possible to
specify extra `host:ip` settings in `/etc/hosts`.

This fix adds `Hosts` in swarmkit's `ContainerSpec` so that it
is possible to specify extra hosts during service creation.

Related docs has been updated.

An integration test has been added.

This fix fixes 27902.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-11-10 10:20:24 -08:00
Sebastiaan van Stijn 82c10dd9f9 Merge pull request #28243 from andrewhsu/change-context
use "golang.org/x/net/context" instead of "context"
2016-11-10 19:13:56 +01:00
Tibor Vass fb0e903122 Merge pull request #28148 from vieux/rename_plugin_manifest
rename plugin manifest
2016-11-10 09:47:15 -08:00
Daniel Nephin 0333117b88 Handle bind options and volume options
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-10 12:37:17 -05:00
Daniel Nephin 458ffcd2e6 Restore stack deploy integration test with dab
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-10 11:28:19 -05:00
Aanand Prasad 791b687848 Reinstate --bundle-file argument to 'docker deploy'
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-11-10 11:28:18 -05:00
Daniel Nephin d05510d954 Add integration test for stack deploy.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-10 11:28:18 -05:00
Daniel Nephin 3875355a3e Remove bundlefile
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-10 11:28:18 -05:00
Daniel Nephin ef845be6a5 Remove duplication of name mangling.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-10 11:28:18 -05:00
Daniel Nephin d89cb4c62f Always use a default network if no other networks are set.
also add network labels.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-10 11:28:18 -05:00
Daniel Nephin ae8f001829 Send warnings to stderr.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-10 11:28:18 -05:00
Aanand Prasad 25c93d4ebb Default to replicated mode
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-11-10 11:28:18 -05:00
Aanand Prasad dfab8f2bd4 Handle unsupported, deprecated and forbidden properties
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-11-10 11:28:18 -05:00
Daniel Nephin e1b96b6447 Add swarmkit fields to stack service.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-10 11:28:18 -05:00
Aanand Prasad a9fc9b60fe Add support for service-level 'volumes' key
Support volume driver + options
Support external volumes
Support hostname in Compose file

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-11-10 11:28:18 -05:00
Daniel Nephin f702b722d8 Convert deploy to use a compose-file.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-10 11:28:18 -05:00
Andrew Hsu dc32cb6c77 use "golang.org/x/net/context" instead of "context"
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2016-11-10 08:23:19 -08:00
Sebastiaan van Stijn c5fbdc8572 Merge pull request #28186 from yongtang/27567-follow-up-dns-options
Add `--dns-option` to `docker run` and hide `--dns-opt`
2016-11-10 16:20:17 +01:00
Victor Vieux 0ae9598f96 rename plugin manifest
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-11-10 00:09:23 -08:00
Victor Vieux e876381912 Merge pull request #28224 from vieux/fix_manpages
fix manpages
2016-11-09 23:22:30 -08:00
yuexiao-wang b6fe99530c Remove redundant parameter and fix typos
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-11-10 11:05:31 +08:00
Victor Vieux 1a34843c0c Merge pull request #28164 from anusha-ragunathan/plugin-build
Add plugin create functionality.
2016-11-09 17:49:51 -08:00
Victor Vieux 96c16101dd fix manpages
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-11-09 17:11:14 -08:00
Aaron Lehmann 65e1e166ee Add unlock key rotation
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-11-09 16:09:01 -08:00
Aaron Lehmann 56b7ad90b1 Revise swarm init/update flags, add unlocking capability
- Neither swarm init or swarm update should take an unlock key
- Add an autolock flag to turn on autolock
- Make the necessary docker api changes
- Add SwarmGetUnlockKey API call and use it when turning on autolock
- Add swarm unlock-key subcommand

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-11-09 16:09:00 -08:00
Tonis Tiigi d006a04357 Add support for swarm init lock and swarm unlock
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-11-09 16:09:00 -08:00
Anusha Ragunathan b825c58ff8 Add plugin create functionality.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-11-09 15:23:03 -08:00
Yong Tang b38ca0f4c3 Add `--dns-option` to `docker run` and hide `--dns-opt`
This fix is a follow up to #27567 based on:
https://github.com/docker/docker/pull/27567#issuecomment-259295055

In #27567, `--dns-options` has been added to `service create/update`,
together with `--dns` and `--dns-search`. The `--dns-opt` was used
in `docker run`.

This fix add `--dns-option` (not `--dns-options`) to `docker run/create`, and hide
`--dns-opt`. It is still possible to use `--dns-opt` with
`docker run/create`, though it will not show up in help output.

This fix change `--dns-options`to --dns-option` for `docker service create`
and `docker service update`.

This fix also updates the docs and bash/zsh completion scripts.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-11-09 12:13:25 -08:00
Evan Hazlett 06666a5a23 use human readable units when listing secrets
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-11-09 14:27:46 -05:00
Evan Hazlett c7d7b50003 more review updates
- return err instead of wrap for update secret
- add omitempty for data in secret spec

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-11-09 14:27:45 -05:00
Evan Hazlett 0dc9115006 SecretRequestOptions -> SecretRequestOption
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-11-09 14:27:45 -05:00
Evan Hazlett 0bda23ec2b support labels for secrets upon creation; review updates
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-11-09 14:27:45 -05:00
Evan Hazlett b3bbcc1ba6 secrets: support simple syntax --secret foo
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-11-09 14:27:45 -05:00
Evan Hazlett 9074333957 review updates
- use Filters instead of Filter for secret list
- UID, GID -> string
- getSecrets -> getSecretsByName
- updated test case for secrets with better source
- use golang.org/x/context instead of context
- for grpc conversion allocate with make
- check for nil with task.Spec.GetContainer()

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-11-09 14:27:45 -05:00
Evan Hazlett 91c08eab93 move secretopt to opts pkg
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-11-09 14:27:45 -05:00
Evan Hazlett d22e1a91f6 secrets: enable secret inspect and rm by secret name
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-11-09 14:27:45 -05:00
Evan Hazlett 15b97a39d7 secrets: use explicit format when using secrets
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-11-09 14:27:44 -05:00
Evan Hazlett 2b0fa52c09 update to support new target in swarmkit
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-11-09 14:27:44 -05:00
Evan Hazlett 6bbc35a743 simplify secret lookup on service create
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-11-09 14:27:44 -05:00
Evan Hazlett ab5f829742 support the same secret with different targets on service create
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-11-09 14:27:44 -05:00
Evan Hazlett 8554b64b99 add secret support for service update
- add nosuid and noexec to tmpfs

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-11-09 14:27:44 -05:00
Evan Hazlett 4e8f1a7dd9 more review updates
- use /secrets for swarm secret create route
- do not specify omitempty for secret and secret reference
- simplify lookup for secret ids
- do not use pointer for secret grpc conversion

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-11-09 14:27:43 -05:00
Evan Hazlett 3f9494f1d6 review changes
- fix lint issues
- use errors pkg for wrapping errors
- cleanup on error when setting up secrets mount
- fix erroneous import
- remove unneeded switch for secret reference mode
- return single mount for secrets instead of slice

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-11-09 14:27:43 -05:00
Evan Hazlett 1be644fbcf secrets: secret management for swarm
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

wip: use tmpfs for swarm secrets

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

wip: inject secrets from swarm secret store

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

secrets: use secret names in cli for service create

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

switch to use mounts instead of volumes

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

vendor: use ehazlett swarmkit

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

secrets: finish secret update

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-11-09 14:27:43 -05:00