Commit graph

437 commits

Author SHA1 Message Date
Yong Tang
3891c1f376 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>
(cherry picked from commit 90bb2cdb9f)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-05 00:39:30 -08:00
Yong Tang
c015a2a1a6 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>
(cherry picked from commit 8a226ed643)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-05 00:38:57 -08:00
Yong Tang
3477da0cdb 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>
(cherry picked from commit 0ce6e070f7)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-02 13:39:37 -08:00
yuexiao-wang
68b88c8749 Fix the use for secret create
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit 5cef55ba91)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-01 13:40:14 -08:00
yuexiao-wang
f687616995 Fix the inconsistency for docker secret
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit b4306588e9)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-01 13:39:06 -08:00
Vincent Demeester
f8b981574c Revert "Add -a option to service/node ps"
This reverts commit 139fff2bf0.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit eb55d03f3c)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:11:02 -08:00
Vincent Demeester
4609c728e3 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>
(cherry picked from commit 6fff845409)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:10:29 -08:00
allencloud
1b187660c2 change secret remove logic in cli
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 5b93e77138)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-29 14:14:36 -08:00
Daniel Nephin
a8c2248e6f Use namespace label on stack volumes.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 4013a7c6d8)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-29 14:12:10 -08:00
John Howard
7c74809fe9 Align output of docker version again
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit dfeaf7a959)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-29 14:07:39 -08:00
Kei Ohmura
76d2619406 fix description of 'docker swarm init'
Signed-off-by: Kei Ohmura <ohmura.kei@gmail.com>
(cherry picked from commit 3abee1bf8a)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:28:52 -08:00
yuexiao-wang
bfbb2fdee9 Modify reponame to PLUGIN and fix some typos
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit c394034f59)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:23:58 -08:00
Daniel Nephin
4b230af83f Add a short flag for docker stack deploy
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit f1dd721b69)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:22:59 -08:00
yuexiao-wang
05a75a567a Add options for docker plugin enable and fix some typos
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit 9e414bfa6b)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:21:20 -08:00
Yong Tang
a2c9e625e6 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>
(cherry picked from commit 2510f254ee)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:19:34 -08:00
Victor Vieux
edbe73670a support src in --secret
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
(cherry picked from commit f70470b71e)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:19:02 -08:00
Daniel Nephin
234a8b9496 exit with status 1 if help is called on an invalid command.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit bb7601a3ff)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:18:28 -08:00
Daniel Nephin
46cfeaf8ef Allow hostname to be updated on service.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 1c65cb6657)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:17:18 -08:00
erxian
d981bbc288 update secret command
Signed-off-by: erxian <evelynhsu21@gmail.com>
(cherry picked from commit d87c91e39f)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:16:47 -08:00
Daniel Nephin
f70e7f840b Better error message on stack deploy against not a swarm.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit c72daf953a)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:15:40 -08:00
Evan Hazlett
01807b785f 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>
(cherry picked from commit 70d2cefd51)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 18:43:53 -08:00
yupeng
b82be871ab context.Context should be the first parameter of a function
Signed-off-by: yupeng <yu.peng36@zte.com.cn>
(cherry picked from commit aff5dacec1)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 18:43:29 -08:00
cyli
aa6211e153 Do not display the digest or size of swarm secrets
Signed-off-by: cyli <cyli@twistedmatrix.com>
(cherry picked from commit 2c0613540a)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 16:54:50 -08:00
Reficul
ca51b2bf2c fix incorrect ErrConnectFailed comparison
Signed-off-by: Reficul <xuzhenglun@gmail.com>
(cherry picked from commit d5dc9b8b1f)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 11:23:49 -08:00
Anusha Ragunathan
0403addc5f Add HTTP client timeout.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 83ca993c15)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 11:23:20 -08:00
Brian Goff
b4c0b07d89 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>
(cherry picked from commit f4bb8c51de)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 11:22:08 -08:00
Daniel Nephin
95398c33cc Move docker stack out of experimental
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 6df5baf30f)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 14:47:24 -08:00
Evan Hazlett
01aab8baa3 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>
(cherry picked from commit bebd472e40)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 14:45:39 -08:00
Antonio Murdaca
0a5732d1cf api: types: keep info.SecurityOptions a string slice
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
(cherry picked from commit 514ca09426)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 14:45:05 -08:00
Aaron Lehmann
2737519f9a 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>
(cherry picked from commit 32b12a28fc)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 14:44:33 -08:00
Vincent Demeester
05eb544ae2 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>
(cherry picked from commit 158388ef8d)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 13:23:24 -08:00
Nishant Totla
5b81d7e8b5 Suppressing digest for docker service ls/ps
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
(cherry picked from commit e7d83fdb9a)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 13:23:23 -08:00
Vincent Demeester
c8e2552827 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>
(cherry picked from commit 3bd64de7a9)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 11:48:22 -08:00
Daniel Nephin
a0df810219 Default parallelism to 1.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 7c1b399235)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 11:48:16 -08:00
Sebastiaan van Stijn
c4fd597ab3 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>
(cherry picked from commit f1b9df9172)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 15:15:51 -08:00
Yong Tang
e3c24caf7a 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>
(cherry picked from commit ace786e9d5)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 15:14:49 -08:00
Aaron Lehmann
d4392659f7 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>
(cherry picked from commit 948e60691e)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:57:11 -08:00
Yong Tang
3e9dd55695 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>
(cherry picked from commit 312cc7eebd)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:42:21 -08:00
Boaz Shuster
19d2e68fb8 Change the docker-tag usage text to be clearer
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
(cherry picked from commit 039aca05c2)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:41:48 -08:00
Yong Tang
7ef4feaf38 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>
(cherry picked from commit b6857e91c1)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:34:35 -08:00
Victor Vieux
411e0bdc8e refactor help func in CLI
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
(cherry picked from commit bf95472105)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:30:44 -08:00
John Howard
dbf1900e8c Windows: Use sequential file access
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-11-16 11:05:23 -08:00
Brian Goff
a9bbf92b3f Fix issue with missing fields for ps template
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-11-14 14:25:27 -08:00
Evan Hazlett
8ac6b97189 only check secrets for service create if requested
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-11-14 11:48:48 -08:00
Anusha Ragunathan
a7a8fa0e6b Add docs for plugin push
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-11-14 11:34:28 -08: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
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