Commit Graph

182 Commits

Author SHA1 Message Date
866adfbbee Merge pull request #28923 from erikh/fix-copy
Fix copy API (`docker cp`, etc) uid/gid handling
Upstream-commit: d40a17ffc2f6592396a3dfc0f5ebe396c2107536
Component: engine
2017-04-12 08:21:17 -07:00
1386ad9dee daemon/archive.go: Fix copy routines to preserve UID.
This changes the long-standing bug of copy operations not preserving the
UID/GID information after the files arrive to the container.

Signed-off-by: Erik Hollensbe <github@hollensbe.org>
Upstream-commit: 8a7ff5ff746a77e0be601c11540562341b2228c1
Component: engine
2017-04-12 10:33:19 +00:00
640fde4eb4 client: Allow hex strings as source references for ImageTag
The source of a tag operation is allowed to be a 64-character hex
string. This means it should use ParseAnyReference for validation
instead of ParseNormalizedNamed.

This fixes a regression that happened in 17.04.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 4a0704cdbd1805d0d9ef046eb62a77352f1feab0
Component: engine
2017-04-11 13:37:04 -07:00
d2aa64e45c Merge pull request #32284 from aaronlehmann/fix-service-defaults
Improve default handling for "service create"
Upstream-commit: a258ef58d8a100467d5d948b026a884ebe58eaf4
Component: engine
2017-04-11 13:06:53 +02:00
a89a2c21c5 builder: add an option for specifying build target
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 33e07f41adc0ec96edad5f22bc2cfaec0d26ea58
Component: engine
2017-04-10 16:21:43 -07:00
3d267a0dc8 Change "service inspect" to show defaults in place of empty fields
This adds a new parameter insertDefaults to /services/{id}. When this is
set, an empty field (such as UpdateConfig) will be populated with
default values in the API response. Make "service inspect" use this, so
that empty fields do not result in missing information when inspecting a
service.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 1d274e9acfe96b98be3ec956636ff4e5c70e98af
Component: engine
2017-04-10 13:41:16 -07:00
6d75b7a10d Merge pull request #30740 from yongtang/29999-prune-filter-label
Add `label` filter for `docker system prune`
Upstream-commit: 4460312ce1a53316e3c474ab951b85e737a902c5
Component: engine
2017-04-10 19:38:01 +02:00
1f0e0155dc use an encrypted client certificate to connect to a docker daemon
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
Upstream-commit: 603dd8b3b48273c0c7e1f2aef5f344acac66424e
Component: engine
2017-04-07 01:50:51 -04:00
83d9648a45 Add label filter for docker system prune
This fix tries to address the issue raised in 29999 where it was not
possible to mask these items (like important non-removable stuff)
from `docker system prune`.

This fix adds `label` and `label!` field for `--filter` in `system prune`,
so that it is possible to selectively prune items like:
```
$ docker container prune --filter label=foo

$ docker container prune --filter label!=bar
```

Additional unit tests and integration tests have been added.

This fix fixes 29999.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 702524732427ce028277f99f215e1fab297e6001
Component: engine
2017-04-06 09:11:25 -07:00
93e346635c Add support for task and arbitrary combo logs
Refactored the API to more easily accept new endpoints. Added REST,
client, and CLI endpoints for getting logs from a specific task. All
that is needed after this commit to enable arbitrary service log
selectors is a REST endpoint and handler.

Task logs can be retrieved by putting in a task ID at the CLI instead of
a service ID.

Signed-off-by: Drew Erny <drew.erny@docker.com>
Upstream-commit: d330dc3223df7e6c2b066373718709e34e19efca
Component: engine
2017-04-03 18:40:54 -07:00
95794e3edc Merge pull request #31710 from sanimej/drillerrr
Add verbose flag to network inspect to show all services & tasks in swarm mode
Upstream-commit: cdf66ba715c573f85338a2b2a432db6cb9a48e6d
Component: engine
2017-03-13 21:12:32 -07:00
ff11389227 Enhance network inspect to show all tasks, local & non-local, in swarm mode
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
Upstream-commit: 14f76a21db71c5a817cb4d1e27f9940cefd5c820
Component: engine
2017-03-13 17:52:08 -07:00
da38e7fbf1 Hide command options that are related to Windows
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: 7199522ea2e77c77bf931474eca92aa502ce0031
Component: engine
2017-03-12 08:47:17 +02:00
d82df5d4ba Implement server-side rollback, for daemon versions that support this
Server-side rollback can take advantage of the rollback-specific update
parameters, instead of being treated as a normal update that happens to
go back to a previous version of the spec.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: f9bd8ec8b268581f93095c5a80679f0a8ff498bf
Component: engine
2017-03-03 16:33:34 -08:00
abcd382ec2 Merge pull request #31354 from anusha-ragunathan/dial_socket
Net dial to the plugin socket during enable.
Upstream-commit: e77c2001aacd7cb0dd2b59b9ac32763d029bfc0f
Component: engine
2017-02-28 18:24:56 +01:00
23ca2941d2 Net dial to the plugin socket during enable.
When a plugin fails to start, we still incorrectly mark it as enabled.
This change verifies that we can dial to the plugin socket to confirm that
the plugin is functional and only then mark the plugin as enabled. Also,
dont delete the plugin on install, if only the enable fails.

Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
Upstream-commit: 1b41b7a4f4c824bbfdb1acac3e8c8505e0fdb84f
Component: engine
2017-02-27 18:11:28 -08:00
12aa0347d6 Merge pull request #30383 from TDAbboud/30096-add-host-docker-build
Add --add-host for docker build
Upstream-commit: a64ea37753fd9a94dfa3ab81f67f46df7bd641f8
Component: engine
2017-02-27 12:42:18 +01:00
7dba33b4e7 Add --add-host for docker build
Signed-off-by: Tony Abboud <tdabboud@hotmail.com>
Upstream-commit: 7a962e4577628c357f96153eca07e527813fb42b
Component: engine
2017-02-20 17:32:28 -05:00
6446421ffd add missing API changes
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: a7e6d2ca1fd30a6122a65558507135e7079ae6a7
Component: engine
2017-02-19 01:33:43 -08:00
29e3dcbbb0 why there are so many mistakes in our repo (up to /cmd)
Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>
Upstream-commit: f8a40477960976f12dbbb72e5b133b5b0f05f9b3
Component: engine
2017-02-17 00:32:48 +08:00
5e49c7739c Merge pull request #30851 from chchliang/networktest
add testcase check connect.EndpointConfig not nil
Upstream-commit: 019eb5d71f7ebe89c5900df6e3219354dd3ceb01
Component: engine
2017-02-13 10:58:02 -05:00
877717c8a7 remove redundant colon introduced by mistake
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: df64bc3ed0e315a1064937d1a3ad6d0f324b11c8
Component: engine
2017-02-13 10:16:57 +08:00
fee80945cc remove redundant code and better error msg
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 5c0ea56d56065ee737557650fa797a61f52e8378
Component: engine
2017-02-11 09:22:07 +08:00
46de6776e3 remove unused headers in secret_create.go
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 31d9ce6f5c6afed4d76ee70533871944b754e869
Component: engine
2017-02-11 00:16:48 +08:00
1b1c293b02 add test case check connect.EndpointConfig not nil
Signed-off-by: chchliang <chen.chuanliang@zte.com.cn>
Upstream-commit: fd74940304c86e43d8e8d44d0d8315086d5596c4
Component: engine
2017-02-09 11:26:20 +08:00
2260389fe6 Use distribution reference
Remove forked reference package. Use normalized named values
everywhere and familiar functions to convert back to familiar
strings for UX and storage compatibility.

Enforce that the source repository in the distribution metadata
is always a normalized string, ignore invalid values which are not.
Update distribution tests to use normalized values.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 3a1279393faf78632bf169619d407e584da84b66
Component: engine
2017-02-07 11:08:37 -08:00
03aaf44639 Merge pull request #30187 from thaJeztah/show-error-on-unsupported-flags
print error if unsupported flags are used
Upstream-commit: f538c4bd3c203a4d49711fd7807cdd4bb4182e70
Component: engine
2017-02-04 22:43:51 +01:00
07cd3d04be print error if unsupported flags are used
Docker 1.13 and up allows a client to communicate
with older daemons. As a result, flags may be
present that are not supported by the older daemon.

The client already _hides_ flags that are not
supported yet, but this doesn't present users
from using those flags.

This change shows an error if a flag is used
that is not supported by the daemon (either
based on the API version, or because experimental
features are not enabled).

Note that for some options, a check is already
in place in the API client. For those
options, this is just a minor enhancement
to more clearly indicate which _flag_ is
not supported.

Before this change;

    DOCKER_API_VERSION=1.24 docker run -d --stop-timeout=30 busybox top
    mjfyt3qpvnq0iwmun3sjwth9i

    echo -e "FROM busybox\nRUN echo foo > bar" |  DOCKER_API_VERSION=1.24 docker build --squash -
    "squash" requires API version 1.25, but the Docker server is version 1.24

After this change;

    DOCKER_API_VERSION=1.24 docker run -d --stop-timeout=30 busybox top
    "--stop-timeout" requires API version 1.25, but the Docker daemon is version 1.24

    echo -e "FROM busybox\nRUN echo foo > bar" | DOCKER_API_VERSION=1.24 docker build --squash -
    "--squash" requires API version 1.25, but the Docker daemon is version 1.24

    echo -e "FROM busybox\nRUN echo foo > bar" | docker build --squash -
    "--squash" is only supported on a Docker daemon with experimental features enabled

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 34148978bd0f71692e2584add60018e10b8ff68d
Component: engine
2017-02-03 16:59:20 -08:00
e6c5fda6f5 Merge pull request #29414 from cpuguy83/plugin_upgrade
Add docker plugin upgrade
Upstream-commit: fa49c076d44365f77f392b72fd181db0524a18fb
Component: engine
2017-02-03 15:27:48 -08:00
28da29ca6e Add docker plugin upgrade
This allows a plugin to be upgraded without requiring to
uninstall/reinstall a plugin.
Since plugin resources (e.g. volumes) are tied to a plugin ID, this is
important to ensure resources aren't lost.

The plugin must be disabled while upgrading (errors out if enabled).
This does not add any convenience flags for automatically
disabling/re-enabling the plugin during before/after upgrade.

Since an upgrade may change requested permissions, the user is required
to accept permissions just like `docker plugin install`.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 03c694973968f63743ed53cef83d0b7455695081
Component: engine
2017-02-03 16:21:12 -05:00
0cda3fd8df update incorrect comments of CheckpointList
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 98ffe52fbc953ec2fce0d3b6c3b2405188b96cd5
Component: engine
2017-02-04 00:41:35 +08:00
7505453e38 more descriptive error fo checkpoint ls for non existent containers
Signed-off-by: Krasi Georgiev <krasi@vip-consult.solutions>
Upstream-commit: 8ddfd2f75928be5feda8bd8327a5e9dd60b85cf2
Component: engine
2017-02-02 00:42:29 +02:00
9655371ac7 Merge pull request #28627 from yongtang/28624-docker-plugin-ls
Add `--filter enabled=true` for `docker plugin ls`
Upstream-commit: 4c1b40b9d4a301edc5874e59edcec0f015490fec
Component: engine
2017-02-01 16:52:00 +01:00
b7000a9be6 Add capability filter to docker plugin ls
This fix adds `--filter capability=[volumedriver|authz]` to `docker plugin ls`.

The related docs has been updated.

An integration test has been added.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 99d91ada97334116b26b34a0fdcfa83cce73cda3
Component: engine
2017-01-27 07:32:22 -08:00
e827bea430 Merge pull request #30144 from dnephin/add-secrets-to-stack-deploy
Add secrets to stack deploy
Upstream-commit: 5706d8206bd41fca36ed634f80fe85f5ffbed71b
Component: engine
2017-01-26 14:54:04 -08:00
947241845a Add --filter enabled=true for docker plugin ls
This fix adds `--filter enabled=true` to `docker plugin ls`,
as was specified in 28624.

The related API and docs has been updated.

An integration test has been added.

This fix fixes 28624.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: a66e0dc349dad2d45685846a95fe1d6da967a46d
Component: engine
2017-01-26 13:16:11 -08:00
7b1358ff88 Fix ImageDelete type
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 64978c136575287115cca261ea29c1953c8059d8
Component: engine
2017-01-26 14:07:44 -05:00
bc911a640c Merge pull request #28409 from dnephin/swagger-gen-more
Generate more types from the swagger spec
Upstream-commit: a69c4129e086e4e7b86cce7d2682685dfdc6f2d2
Component: engine
2017-01-26 10:35:34 -08:00
5ed83fcbc5 Add integration test for stack deploy with secrets.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 6ec84ef76df30663d5728f903b314f4486587135
Component: engine
2017-01-26 11:33:15 -05:00
c249c5ced8 Don't use AutoRemove on older daemons
Docker 1.13 moves the `--rm` flag to the daemon,
through an AutoRemove option in HostConfig.

When using API 1.24 and under, AutoRemove should not be
used, even if the daemon is version 1.13 or above and
"supports" this feature.

This patch fixes a situation where an 1.13 client,
talking to an 1.13 daemon, but using the 1.24 API
version, still set the AutoRemove property.

As a result, both the client _and_ the daemon
were attempting to remove the container, resulting
in an error:

    ERRO[0000] error removing container: Error response from daemon:
    removal of container ce0976ad22495c7cbe9487752ea32721a282164862db036b2f3377bd07461c3a
    is already in progress

In addition, the validation of conflicting options
is moved from `docker run` to `opts.parse()`, so
that conflicting options are also detected when
running `docker create` and `docker start` separately.

To resolve the issue, the `AutoRemove` option is now
always set to `false` both by the client and the
daemon, if API version 1.24 or under is used.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 0ea7b143b0a8366799c83a955be676aaf1345214
Component: engine
2017-01-15 01:59:57 +01:00
fe46c62362 Add SecretUpdate method to client
closes #28678

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Update cli/command/service/update_test.go

Fixes test build error:

  secretAPIClientMock does not implement "github.com/docker/docker/client".SecretAPIClient (missing SecretUpdate method)

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 77b8465d7e68ca102d7aae839c7b3fe0ecd28398
Component: engine
2017-01-13 09:51:05 -08:00
8f27f74ad0 Update docs and code to use application/x-tar in the build API
At the "Build image from Dockerfile" section in the API docs
the Content-Type header is missing.
In addition, some parts in the code are still setting the
Content-Type header to application/tar while it was changed
to application/x-tar since 16th September 2015.

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: b1996728aaeaa147c2045c8be79373d59ce7117a
Component: engine
2017-01-10 06:40:06 +02:00
701de0a381 Merge pull request #29226 from yongtang/28535-prune-until-follow-up
Add `--filter until=<timestamp>` for `docker container/image prune`
Upstream-commit: f1fdbeca2a39c7189b1ca8db4e4543fe77ff1150
Component: engine
2017-01-09 17:58:01 +01:00
06b5f5c249 check both source_image_tag and target_image_tag for 'docker image tag'
Signed-off-by: wefine <wang.xiaoren@zte.com.cn>
Upstream-commit: a041697cabb934e875a1e7f8adea15495209b347
Component: engine
2017-01-07 04:55:53 +08:00
0c3b3bfadc Add --filter until=<timestamp> for docker container/image prune
This fix is a follow up for comment
https://github.com/docker/docker/pull/28535#issuecomment-263215225

This fix provides `--filter until=<timestamp>` for `docker container/image prune`.

This fix adds `--filter until=<timestamp>` to `docker container/image prune`
so that it is possible to specify a timestamp and prune those containers/images
that are earlier than the timestamp.

Related docs has been updated

Several integration tests have been added to cover changes.

This fix fixes #28497.

This fix is related to #28535.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 58738cdee327f5de481dcf7d3d377374cbb5f13a
Component: engine
2017-01-04 14:16:42 -08:00
f43a9bc718 Convert ContainerTopOKResponse from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 16bdbaaa3357dc1be7d74a283a3ed8d0d861a461
Component: engine
2017-01-03 11:47:47 -05:00
c049133b66 Generate ImageDeleteResponse from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 5988b84e4fd9a512e3e8f98b3cfd7c030a4f013e
Component: engine
2017-01-03 11:47:47 -05:00
0a6e02b356 Generate ImageHistory from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: b462c93edb44790ca309e3721950cb23be5d7d62
Component: engine
2017-01-03 11:47:44 -05:00
483e5a0688 Generate ContainerChanges from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: b83d9bf6a9d92731573631ebd077a00e3f60c0cd
Component: engine
2017-01-03 09:35:40 -05:00
478844dff8 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>
Upstream-commit: 3d86b0c79b16334ce5836c0315e4c310b84c2e17
Component: engine
2016-12-23 13:29:58 -08:00