Commit graph

29421 commits

Author SHA1 Message Date
Lei Jitang
a46dbbded9 Fix update clear the restart policy of monitor
Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit 737b5b1781)
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-04 12:44:55 +01:00
Victor Vieux
4e9dd0e51c replace no-remove by sample-volume-plugin in docs
Signed-off-by: Victor Vieux <vieux@docker.com>
(cherry picked from commit bcead9282e)
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-04 12:44:55 +01:00
Brian Goff
84f25c7cb8 Fix race/deadlock in v1 plugin handlers
When a plugin is activated, and then `plugins.Handle` is called to
register a new handler for a given plugin type, a deadlock occurs when
for anything which calls `waitActive`, including `Get`, and `GetAll`.

This happens because `Handle()` is setting `activated` to `false` to
ensure that plugin handlers are run on next activation.
Maybe these handlers should be called immediately for any plugins which
are already registered... but to preserve the existing behavior while
fixing the deadlock, track if handlers have been run on plugins and
reset when a new handler is registered.

The simplest way to reproduce the deadlock with Docker is to add a `-v
/foo` to the test container created for the external graphdriver tests.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 2938dce794)
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-04 12:44:55 +01:00
Yong Tang
6841887132 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>
(cherry picked from commit c6f0b7f448)
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-04 12:44:55 +01:00
Yanqiang Miao
aa5ac38f41 Optimization a error description
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
(cherry picked from commit 6c021893aa)
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-04 12:44:55 +01:00
Yong Tang
d01138c162 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>
(cherry picked from commit 9155e14e77)
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-04 12:44:54 +01:00
Brian Goff
def75b2c2c Fixes a race condition in client events monitoring
In cases where there is high latency (ie, not-local network)
`waitExitOrRemoved` was not receiving events for short-lived containers.
This caused the client to hang while waiting for a notification that the
container has stopped.

This happens because `client.Events()` returns immediately and spins a
goroutine up to process events. The problem here is it returns before
the request to the events endpoint is even made.
Even without high-latency issues, there is no guarantee that the
goroutine is even scheduled by the time the function returns.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 47585996bf)
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-04 12:44:54 +01:00
Harald Albers
ff7934faf2 Fix usage message of plugin inspect
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 1b58d0bc51)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:44:54 +01:00
Daniel Nephin
045e9834a5 Trim quotes from TLS flags.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit abe32de6b4)
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-04 12:43:17 +01:00
Daniel Nephin
a2dc349c74 Add quoted string flag Value.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit e4c1f07729)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:42 +01:00
Sebastiaan van Stijn
7cbc4cb7f2 fix powershell dco check
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 611a633ba4)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:42 +01:00
Yong Tang
e2b04a7818 Fix image's CMD after WORKDIR in Dockerfile
This fix tries to fix 29667 where image's `CMD` is modified
after `WORKDIR` in Dockerfile.

The value of `b.runConfig.Cmd` was modified in the processing
of `WORKDIR`, in order to fix 28902. However, the same
`b.runConfig.Cmd` is passed to `commit()`.

This fix restored the `b.runConfig.Cmd` before `commit()`
the image for `WORKDIR`.

A test has been added.

This fix fixes 29667.

This fix is related to 28902, 28909, 28514.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 0836023847)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:42 +01:00
Harald Albers
ea00b14170 Add bash completion for plugin disable --force
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit e1403453f0)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:42 +01:00
Harald Albers
5903ead08e Fix bash completion for plugin enable|disable
`docker plugin enable` and `docker plugin disable` only
accept one plugin.

Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 390effdd11)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:42 +01:00
Alexander Morozov
428ae70759 commit: do not change container labels on commit
Fix #29547

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
(cherry picked from commit ca6c6f0765)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:42 +01:00
Brian Goff
eefb2220c0 Fix usage of boltdb in volume restore
bolt k/v pairs are only valid for the life of a transaction.
This means the memory that the k/v pair is referencing may be invalid if
it is accessed outside of the transaction.
This can potentially cause a panic.

For reference: https://godoc.org/github.com/boltdb/bolt#hdr-Caveats

To fix this issue, unmarshal the stored data into volume meta before
closing the transaction.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 4876a9047e)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:41 +01:00
yuexiao-wang
8b155a9109 Update 'ID' field for 'docker plugin ls'
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit 1e6587ff28)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:41 +01:00
Harald Albers
c809c40647 Add bash completion for plugin install --alias
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 83158f8aff)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:41 +01:00
Yanqiang Miao
994b3928f6 Add 'volume prune' to the volume commands index
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
(cherry picked from commit 3d4ea98971)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:41 +01:00
Harald Albers
39b3e39c40 Remove bash completion for deprecated docker daemon
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 536a9ec698)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:41 +01:00
Harald Albers
e7960584f2 Remove --all|-a from docker node ps reference
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 364e900237)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:41 +01:00
Harald Albers
c25a4762ef Remove bash completion for docker node ps --all|-a
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit a54cc4f88d)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:41 +01:00
Zhang Wei
2c53989b4b Add missing "--default-runtime" flag in manpage
Add missing flag and more descriptions in manpage.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
(cherry picked from commit 977fd43985)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:41 +01:00
Akihiro Suda
1c5cb46649 update experimental/README.md
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
(cherry picked from commit eb11a10ddf)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:41 +01:00
Tobias Gesellchen
97b0bb730e fix swagger description for DELETE /plugin/{name}
Signed-off-by: Tobias Gesellchen <tobias@gesellix.de>
(cherry picked from commit e6b2829a7f)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:40 +01:00
Tonis Tiigi
6d6c11dceb Fix inspect object by invalid reference
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 3cd39aaeab)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:40 +01:00
Tibor Vass
7d58f5fb88 Merge pull request #29869 from cpuguy83/backport_28263
[cherry-pick] Moves graphdriver plugin docs out of experimental
2017-01-03 21:35:06 -08:00
Tibor Vass
73be1c098a Merge pull request #29858 from mavenugo/1.13-nplugins
Cherry-pick : Fixing a couple of network plugin life-cycle mgmt issues
2017-01-03 19:56:11 -08:00
Brian Goff
c18f592150 Moves graphdriver plugn docs out of experimental
Also updates some of the structures being sent so plugins are getting
all the new options.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-01-03 21:58:43 -05:00
Tibor Vass
f335200410 Merge pull request #29859 from thaJeztah/1.13-fix-anonymous-volumes
[1.13] fix anonymous volumes
2017-01-03 16:20:10 -08:00
Madhu Venugopal
c5b5b4ea45 Properly cleanup plugin states which might impact other tests
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2017-01-03 15:37:47 -08:00
Madhu Venugopal
627bc91727 Handle Plugin reference count during network create and delete
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2017-01-03 15:37:47 -08:00
Madhu Venugopal
15293063ba Vendoring libnetwork to bring in isbuiltin changes
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2017-01-03 15:37:47 -08:00
Madhu Venugopal
b219698e75 Add a GetAll function that returns only managed plugins supported by V2
The current GetAll handles both V2 and legacy plugins. Also due to the
nature of V1 plugins, it also loads them. This causes problems when
loading is not required. Hence adding an independent API that will
return only the plugins that are loaded using v2 mangaed plugins.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2017-01-03 15:37:46 -08:00
Sebastiaan van Stijn
1ca25a2e5e
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>
2017-01-03 21:49:03 +01:00
Sebastiaan van Stijn
36c0b59149
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>
2017-01-03 21:22:07 +01:00
Brian Goff
3e0df05ec4 Merge pull request #29734 from tonistiigi/1.13-plugins
[v1.13] plugins updates
2016-12-28 10:56:21 -05:00
Tonis Tiigi
f02d46f050 Fix validation of plugins without rootfs in config
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 6c7cb52009)
2016-12-27 17:21:08 -08:00
Derek McGowan
25bbf8ab7c Support for docker content trust for plugins
Add integration test for docker content trust

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
(cherry picked from commit 14e8bba4f5)
2016-12-27 14:27:28 -08:00
Tonis Tiigi
38d914cc96 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>
(cherry picked from commit 3d86b0c79b)
2016-12-27 13:31:14 -08:00
Derek McGowan
bb37c67a90 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>
(cherry picked from commit 3c7676a057)
2016-12-27 13:31:06 -08:00
Derek McGowan
a55a9b14d1 Update distribution vendor for manifest builder change
Manifest builder allows setting the configuration type
for the manifest being build. Additionally the default
type has been renamed to reflect it is an image type.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
(cherry picked from commit 61ac7c4bf8)
2016-12-27 13:30:44 -08:00
Anusha Ragunathan
2039ea6adc 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>
(cherry picked from commit 8cb2229cd1)
2016-12-27 13:19:25 -08:00
Yong Tang
05426c80d9 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>
(cherry picked from commit 0b3c10ac4d)
2016-12-27 13:19:16 -08:00
Yong Tang
fed1b91bb4 Use GetByName to check for collision before create any context in plugin creation
This fix is a follow up to the comment:
https://github.com/docker/docker/pull/28717#discussion_r90040589

Currently, the collision checking is done at the last step `Add()` of
plugin creation. However, at this stage the context such as plugin
directories have already been creation. In case of name collision,
rollback is needed which could be expensive.

This fix performs the check at the beginning of CreateFromContext using
GetByName. In this way, collision fails fast and no context creation
or rollback is needed.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 52405a9b58)
2016-12-27 12:10:11 -08:00
Victor Vieux
88862e707a bump 1.13.0-rc4
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-16 02:10:49 -08:00
Victor Vieux
f3749c5a9c Merge pull request #29465 from docker/1.13.0-rc4-cherrypicks
1.13.0-rc4 cherry-picks: part2
2016-12-16 13:12:57 -08:00
Victor Vieux
7d4318c83c Merge pull request #29433 from aaronlehmann/swarm-plugins-1.13
[1.13] Support v2 plugins in swarm mode
2016-12-16 12:47:52 -08:00
Aaron Lehmann
05fba4af5f Add integration test for volume plugins on swarm
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-12-16 10:44:26 -08:00
Aaron Lehmann
501083e82a Fix volume Create to check against canonical driver name
Previously, it was comparing against the driver name passed in by the
caller. This could lead to subtle issues when using plugins, like
"plugin" vs. "plugin:latest".

Also, remove "conflict:" prefix to improve the error message.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit a854cf262336e5625ec06e8e12e8ebc1500ce656)
2016-12-16 10:44:26 -08:00