Commit graph

773 commits

Author SHA1 Message Date
Sebastiaan van Stijn
f1fdbeca2a 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
d0053a34bc Merge pull request #29688 from tronicum/since-flag
explain since format and give examples
2017-01-09 09:27:30 -05:00
ttronicum
519c35889e 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
7a85579917
*: 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
db6652ca71 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
0ad02c6108 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
58738cdee3 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
4f9b076e8e 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
d45c652e83 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
Daniel Nephin
abe32de6b4 Trim quotes from TLS flags.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-01-03 15:58:41 -05:00
Sebastiaan van Stijn
e4223e3361 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
18265591c2 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
187592583c 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
84cb2d100b
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
1b58d0bc51 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
e91953407c
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
edaa3c6f07 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
1dd9410776 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
4d5cba127b 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
e03b55a2f5 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
78101b26af Read long description from a file.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-12-28 16:08:23 -05:00
Alexander Morozov
4f657ff55c 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
a412c1b7a0 Merge pull request #29668 from dmcgowan/plugins-dct
Support Docker Content Trust for plugins
2016-12-28 10:43:32 -05:00
Doug Davis
9fab262690 Merge pull request #29752 from allencloud/fix-nits-in-comments
fix nits in comments
2016-12-28 08:33:48 -05:00
Daniel Nephin
f5af9b9738 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
14e8bba4f5
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
bf6eb85539 Merge pull request #29666 from tonistiigi/client-deps
Clean up client binary dependencies
2016-12-27 15:01:24 -05:00
Brian Goff
efbb23f3e6 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
6fb05778ba fix nits in comments
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-12-27 23:30:50 +08:00
Tonis Tiigi
feaf5902f6 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
13222160e8 Define PushResult in api types
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-12-26 18:53:22 -08:00
Yong Tang
9155e14e77 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
0b243acbfc 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
d5179cb4d4
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
ce964a607a
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
c424be21b7
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
3d86b0c79b 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
d1dfc1a5ef 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
8cb2229cd1 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
70942352d5 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
b9ee31ae02 Merge pull request #29314 from vdemeester/no-more-utils
Remove the utils package
2016-12-22 15:21:05 +01:00
Vincent Demeester
0ca3e84227 Merge pull request #29603 from mstanleyjones/docker_diff_improvements
Clarify what docker diff shows
2016-12-22 15:15:01 +01:00
Vincent Demeester
8f9a48ab5a Merge pull request #29565 from yuexiao-wang/fix-typo-tls
Change tls to TLS
2016-12-22 12:10:09 +01:00
Brian Goff
e91604c0d2 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
267d6935c5 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
d65d5db2a0 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
b2e348f2a6 Merge pull request #29527 from allencloud/change-minor-mistake
change minor mistake of spelling
2016-12-21 13:15:00 -05:00
Yong Tang
0b3c10ac4d 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
4497801c8a Clarify what docker diff shows
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-12-20 17:03:11 -08:00
Tibor Vass
0d5a715931 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
yuexiao-wang
113cae5ba2 Change tls to TLS
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-12-20 22:08:07 +08:00
allencloud
7c3657065c change minor mistake of spelling
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-12-20 21:05:19 +08:00
Yong Tang
acc93db32b 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
77dde3efa7 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
aecb79ff98 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
3c7676a057
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
05dc9846e1
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
120241937e
Improve validation for volume specs
The current validation only checked for the
number of elements in the volume-spec, however,
did not validate if the elements were empty.

Because of this, an empty volume-spec (""),
or volume spec only containing separators ("::")
would not be invalidated.

This adds a simple check for empty elements in
the volume-spec, and returns an error if
the spec is invalid.

A unit-test is also added to verify the behavior.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-19 01:50:08 +01:00
Sebastiaan van Stijn
34889e579f
fix conversion of anonymous volumes in compose-file
the `convertVolumeToMount()` function did not take
anonymous volumes into account when converting
volume specifications to bind-mounts.

this resulted in the conversion to try to
look up an empty "source" volume, which
lead to an error;

    undefined volume:

this patch distinguishes "anonymous"
volumes from bind-mounts and named-volumes,
and skips further processing if no source
is defined (i.e. the volume is "anonymous").

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-18 16:50:32 +01:00
Sebastiaan van Stijn
4436a5946d 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
32de162fc9 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
2121041944 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
a6a0880a22 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
914a72541f 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
643fd775ed Move pkg to cli/compose/convert
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-12-16 12:27:31 -05:00
Daniel Nephin
655e48e653 Move ConvertService to composetransform package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-12-16 12:20:07 -05:00
Daniel Nephin
7685e80fc9 Move ConvertVolumes to composetransform package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-12-16 11:51:13 -05:00
Daniel Nephin
6b778c9633 Move ConvertNetworks to composetransform package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-12-16 11:51:13 -05:00
Sebastiaan van Stijn
f89eee5d9d
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
2c187a24e0 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
d4d6f8c0d0 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
4b8c79f25e 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
2fe62f2395 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
5665c73642 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
66cf4cc7f7
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
c6f0b7f448 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
5aa5a1cb00 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
3d52c86d4c 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
cd317282c9 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
91dd29acdc 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
04f7a03359
Move templates to pkg/templates
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-12 09:34:03 +01:00
Vincent Demeester
ce37550347
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
9d4aa3621f 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
75bf18c9f0 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
30b8f08443 Windows: Prompt fix
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-12-09 14:27:53 -08:00
Sebastiaan van Stijn
032b5b21b6 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
cefda34773 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
e94a40cdda 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
6174adc4b3 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
dca76ed50a 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
cdb8ea90b0 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
bbd2018ee1 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
d91ed88365 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
7f9ba93914 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
57d77cc205 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
745795ef2e 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
806cc1e0f8
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
24ffa2fa77 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
3638ca4d14 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
a6be56b54e 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
8a226ed643 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
90bb2cdb9f 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
57ace38103 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
f1df2d5a2e 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
c4d773cdfe 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
0e70d96a68 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
0ce6e070f7 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
07c4b4124b 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
a3be176f13 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
5cef55ba91 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
53d69aeb74 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
b4306588e9 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
b8dac5dc99 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
063d5679c5 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
986740691f Merge pull request #28874 from yuexiao-wang/fix-layer-typo
Fix some typos
2016-11-29 14:45:08 +01:00
yuexiao-wang
c8c7a3ff21 Fix some typos
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-11-30 03:01:32 +08:00
Sebastiaan van Stijn
d5654a8e76 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
5b93e77138 change secret remove logic in cli
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-11-29 15:12:05 +08:00
Daniel Nephin
4013a7c6d8 Use namespace label on stack volumes.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-28 18:02:39 -05:00
John Howard
dfeaf7a959 Align output of docker version again
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-11-28 11:38:58 -08:00
Vincent Demeester
eb55d03f3c
Revert "Add -a option to service/node ps"
This reverts commit 139fff2bf0.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-11-28 18:08:45 +01:00
Vincent Demeester
b20bf510e5 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
6fff845409
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
3abee1bf8a 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
ce0068ed04 Merge pull request #28780 from vieux/accept_src_in_secret
support src in --secret
2016-11-26 14:34:30 +01:00
Vincent Demeester
c36c63b308 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
f1dd721b69 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
c394034f59 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
1c65cb6657 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
2510f254ee 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
9e414bfa6b 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
32229914c7 Merge pull request #28773 from dnephin/exit-status
exit with status 1 if help is called on an invalid command
2016-11-23 15:13:29 -08:00
Victor Vieux
f70470b71e support src in --secret
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-23 14:30:57 -08:00
Vincent Demeester
205291c5f3 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
bb7601a3ff exit with status 1 if help is called on an invalid command.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-23 15:13:58 -05:00
Daniel Nephin
c72daf953a 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
d87c91e39f update secret command
Signed-off-by: erxian <evelynhsu21@gmail.com>
2016-11-23 10:07:09 -05:00
Victor Vieux
7c6f001248 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
2c0613540a 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
70d2cefd51 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
677e14643c 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
c8388a52ec 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
d1258c761a Merge pull request #28659 from xuzhenglun/master
bugfix: incorrect ErrConnectFailed Comparison
2016-11-22 13:01:05 +01:00
Reficul
d5dc9b8b1f
fix incorrect ErrConnectFailed comparison
Signed-off-by: Reficul <xuzhenglun@gmail.com>
2016-11-22 10:42:55 +08:00
Brian Goff
f4bb8c51de 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
eac91a19d6 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
99a7289632 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
3a6829257e 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
83ca993c15 Add HTTP client timeout.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-11-21 13:11:40 -08:00
Vincent Demeester
05963010ee 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
6df5baf30f Move docker stack out of experimental
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-21 15:30:25 -05:00
Vincent Demeester
158388ef8d
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
278e01d6de 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
3739c3bed3 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
514ca09426
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
f1b9df9172
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 f32869d956
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
e7d83fdb9a
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
948e60691e 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
7c1b399235 Default parallelism to 1.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-18 16:17:08 +01:00
Vincent Demeester
3bd64de7a9
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
6c447f552c 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
039aca05c2 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
e61ad74655 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
43de09045c Merge pull request #28554 from vieux/showhelp
refactor help func in CLI
2016-11-17 14:27:26 -08:00
Evan Hazlett
bebd472e40 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
22dccaf2d6 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
bf95472105 refactor help func in CLI
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-17 10:54:10 -08:00
Yong Tang
ace786e9d5 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
b6857e91c1 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
312cc7eebd 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
b35973ffe8 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
c716827dc8 Merge pull request #26868 from Microsoft/jjh/deprecateemail
1.14 deprecation: email from login
2016-11-15 13:08:05 +01:00
John Howard
7c29f5beed Windows: Use sequential file access
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-11-14 17:41:52 -08:00
Victor Vieux
8930aa0a86 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
d2bb29f87e Add docs for plugin push
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-11-14 09:10:21 -08:00
Brian Goff
b4ab453084 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
aff5dacec1 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
32b12a28fc 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
a66efbddb8 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
744d9dac10 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
6f3720ca9e 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
de325535d4 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
e8469c0e63 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
828bd441eb 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
8dfdecbd2b 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
820b809e70
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
f32869d956 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
84450b72cd 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
de15de6b4d
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
0427afa409 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
48a0c3e831 Merge pull request #28235 from dmcgowan/fix-registry-authorization-errors
Fix registry authorization errors
2016-11-10 19:39:28 -08:00
Jana Radhakrishnan
14ac9f60d0 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
750d634d62 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
891e03eb7d 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
c85eb00841
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
acd6e0d9b2 Merge pull request #28226 from vieux/exit_exp_plugin
move plugins out of experimental
2016-11-10 17:30:54 -08:00
Victor Vieux
bed96ce922 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
c410222e42 move plugins out of experimental
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-11-10 15:51:32 -08:00
Andrea Luzzardi
5f9fe54b35 Merge pull request #28089 from aluzzardi/service-logs
service logs
2016-11-10 15:13:41 -08:00
Victor Vieux
0151fb7618 Merge pull request #28253 from aaronlehmann/arg-descriptions
cli: Change autolock flag description
2016-11-10 13:59:46 -08:00
Andrea Luzzardi
c7995fdc77 cli: docker service logs support
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2016-11-10 13:46:02 -08:00
Michael Crosby
801230ce31 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
dfd1227906 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
41b84e0994 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
ea9a23ccdb 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
02918908af 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
89cc35447d Merge pull request #28148 from vieux/rename_plugin_manifest
rename plugin manifest
2016-11-10 09:47:15 -08:00
Daniel Nephin
ef90081d44 Handle bind options and volume options
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-10 12:37:17 -05:00
Daniel Nephin
bd8de8d8be 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
aa5e7d038a 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
eefccc25c5 Add integration test for stack deploy.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-10 11:28:18 -05:00
Daniel Nephin
b45581b786 Remove bundlefile
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-10 11:28:18 -05:00
Daniel Nephin
46ca5827f9 Remove duplication of name mangling.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-10 11:28:18 -05:00
Daniel Nephin
644d30369a 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
b0efbcc34a Send warnings to stderr.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-10 11:28:18 -05:00
Aanand Prasad
3d2cb23782 Default to replicated mode
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-11-10 11:28:18 -05:00
Aanand Prasad
fcad58f3c8 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
13384ba34b Add swarmkit fields to stack service.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-10 11:28:18 -05:00
Aanand Prasad
0884e3c868 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
cbbc6b4d9b 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
2de83a430d 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
33af4dd505 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
49ca91fbeb rename plugin manifest
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-11-10 00:09:23 -08:00
Victor Vieux
d286734b41 Merge pull request #28224 from vieux/fix_manpages
fix manpages
2016-11-09 23:22:30 -08:00
yuexiao-wang
713cae7ca2 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
28a1ea342d Merge pull request #28164 from anusha-ragunathan/plugin-build
Add plugin create functionality.
2016-11-09 17:49:51 -08:00
Victor Vieux
8e701f0bd7 fix manpages
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-11-09 17:11:14 -08:00
Aaron Lehmann
a6030a50c9 Add unlock key rotation
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-11-09 16:09:01 -08:00
Aaron Lehmann
0f9fc54df9 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
b4a667c8c4 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
5b6e1bc9e5 Add plugin create functionality.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-11-09 15:23:03 -08:00
Yong Tang
9b6b3c2076 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
880e8be1ee 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
427c70d977 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
5b2230a38b SecretRequestOptions -> SecretRequestOption
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-11-09 14:27:45 -05:00
Evan Hazlett
583c013a87 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
a257f674ba secrets: support simple syntax --secret foo
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-11-09 14:27:45 -05:00
Evan Hazlett
b2e4c7f3b5 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
c00138748d move secretopt to opts pkg
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-11-09 14:27:45 -05:00
Evan Hazlett
e0e65b9a3b 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
2adbdcdf5a 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
88dea0e06e 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
dce2afbd81 simplify secret lookup on service create
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-11-09 14:27:44 -05:00
Evan Hazlett
111e497dc6 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
00237a9624 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
189f89301e 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
857e60c2f9 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
3716ec25b4 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
Vincent Demeester
fe77fc5bf1 Merge pull request #28196 from allencloud/add-short-flag-for-force
add short flag for force
2016-11-09 18:11:58 +01:00
Sebastiaan van Stijn
01f5c52a59 Merge pull request #28163 from yongtang/11082016-help-ptr
Remove `-ptr` from the help output of `service create`
2016-11-09 17:53:06 +01:00