Commit Graph

164 Commits

Author SHA1 Message Date
68022c25ce Add --add-host for docker build
Signed-off-by: Tony Abboud <tdabboud@hotmail.com>
Upstream-commit: 1c579ffcc5
Component: cli
2017-02-20 17:32:28 -05:00
6416340b1c why there are so many mistakes in our repo (up to /cmd)
Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>
Upstream-commit: d5e4c0d0be
Component: cli
2017-02-17 00:32:48 +08:00
b92dc0df94 Merge pull request #30851 from chchliang/networktest
add testcase check connect.EndpointConfig not nil
Upstream-commit: d0602ae8d8
Component: cli
2017-02-13 10:58:02 -05:00
7448bd1807 remove redundant colon introduced by mistake
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 2c8cac3bd6
Component: cli
2017-02-13 10:16:57 +08:00
1737a52139 remove redundant code and better error msg
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: bb22446a68
Component: cli
2017-02-11 09:22:07 +08:00
c28cd54770 remove unused headers in secret_create.go
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: a8f833a646
Component: cli
2017-02-11 00:16:48 +08:00
481e937f5b add test case check connect.EndpointConfig not nil
Signed-off-by: chchliang <chen.chuanliang@zte.com.cn>
Upstream-commit: c5a66caf93
Component: cli
2017-02-09 11:26:20 +08:00
4e65e92118 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: b741d2e9b5
Component: cli
2017-02-07 11:08:37 -08:00
f2121255f8 Merge pull request #30187 from thaJeztah/show-error-on-unsupported-flags
print error if unsupported flags are used
Upstream-commit: bc452bbf95
Component: cli
2017-02-04 22:43:51 +01:00
b140741526 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: 0ae3a20be6
Component: cli
2017-02-03 16:59:20 -08:00
e642d5b024 Merge pull request #29414 from cpuguy83/plugin_upgrade
Add docker plugin upgrade
Upstream-commit: 31c487d86f
Component: cli
2017-02-03 15:27:48 -08:00
b725dc869d 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: e301053ff5
Component: cli
2017-02-03 16:21:12 -05:00
34cc546fd5 update incorrect comments of CheckpointList
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 9d18236794
Component: cli
2017-02-04 00:41:35 +08:00
a5f3b7bb71 more descriptive error fo checkpoint ls for non existent containers
Signed-off-by: Krasi Georgiev <krasi@vip-consult.solutions>
Upstream-commit: ba79205e30
Component: cli
2017-02-02 00:42:29 +02:00
0b2383479d Merge pull request #28627 from yongtang/28624-docker-plugin-ls
Add `--filter enabled=true` for `docker plugin ls`
Upstream-commit: c086c9f89c
Component: cli
2017-02-01 16:52:00 +01:00
e34b24e143 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: e38bc0d03e
Component: cli
2017-01-27 07:32:22 -08:00
bc6638815e Merge pull request #30144 from dnephin/add-secrets-to-stack-deploy
Add secrets to stack deploy
Upstream-commit: 477652e2b5
Component: cli
2017-01-26 14:54:04 -08:00
e8abd684ad 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: 9a06063fea
Component: cli
2017-01-26 13:16:11 -08:00
57501b17a7 Fix ImageDelete type
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 2d7a37e91c
Component: cli
2017-01-26 14:07:44 -05:00
3fa334d048 Merge pull request #28409 from dnephin/swagger-gen-more
Generate more types from the swagger spec
Upstream-commit: 540ba12eb4
Component: cli
2017-01-26 10:35:34 -08:00
0e5b51f734 Add integration test for stack deploy with secrets.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 26816a911a
Component: cli
2017-01-26 11:33:15 -05:00
90947b7653 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: 36315fa14b
Component: cli
2017-01-15 01:59:57 +01:00
755844d0cf 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: 266db2ecda
Component: cli
2017-01-13 09:51:05 -08:00
11ca819f5a 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: 0247b1509c
Component: cli
2017-01-10 06:40:06 +02:00
2f558e3c01 Merge pull request #29226 from yongtang/28535-prune-until-follow-up
Add `--filter until=<timestamp>` for `docker container/image prune`
Upstream-commit: 047b90542b
Component: cli
2017-01-09 17:58:01 +01:00
9009e924ca check both source_image_tag and target_image_tag for 'docker image tag'
Signed-off-by: wefine <wang.xiaoren@zte.com.cn>
Upstream-commit: b71687e054
Component: cli
2017-01-07 04:55:53 +08:00
27d4e010cc 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: 337483496b
Component: cli
2017-01-04 14:16:42 -08:00
875d2b1b22 Convert ContainerTopOKResponse from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 9eda7f4daf
Component: cli
2017-01-03 11:47:47 -05:00
b3c70d598c Generate ImageDeleteResponse from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: f7e58c8c9b
Component: cli
2017-01-03 11:47:47 -05:00
c5e636a36d Generate ImageHistory from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 09bd661979
Component: cli
2017-01-03 11:47:44 -05:00
bff364bed9 Generate ContainerChanges from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 0a623b251f
Component: cli
2017-01-03 09:35:40 -05:00
b70a86e634 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: 66f7194250
Component: cli
2016-12-23 13:29:58 -08:00
546db3cfed Merge pull request #29599 from anusha-ragunathan/refcount
Enforce zero plugin refcount during disable, not remove.
Upstream-commit: 4b933cc26d
Component: cli
2016-12-22 15:38:54 -08:00
dcbf69e684 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>
Upstream-commit: fa7cceeb4a
Component: cli
2016-12-22 13:26:53 -08:00
b3b552a24e Merge pull request #29565 from yuexiao-wang/fix-typo-tls
Change tls to TLS
Upstream-commit: 3f9924077a
Component: cli
2016-12-22 12:10:09 +01:00
61085eb58c Merge pull request #29527 from allencloud/change-minor-mistake
change minor mistake of spelling
Upstream-commit: fe406bb866
Component: cli
2016-12-21 13:15:00 -05:00
76e4b27bec Remove unused var 'errTLSConfigUnavailable' (#29626)
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: fe5937d0a7
Component: cli
2016-12-21 06:41:14 -05:00
7d6defc8cf Change tls to TLS
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: d044b55ee0
Component: cli
2016-12-20 22:08:07 +08:00
5821bc8a55 change minor mistake of spelling
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 693328f346
Component: cli
2016-12-20 21:05:19 +08:00
d3f8310844 Merge pull request #29456 from cpuguy83/fix_client_events_race
Fixes a race condition in client events monitoring
Upstream-commit: 368e309073
Component: cli
2016-12-16 17:07:43 -08:00
b2aa751ffb 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>
Upstream-commit: bcb7147ae5
Component: cli
2016-12-16 10:11:53 -05:00
6853898689 Merge pull request #29104 from duglin/Issue29084
Fix processing of unset build-args during build
Upstream-commit: 50d32cdc08
Component: cli
2016-12-07 17:18:55 -08:00
f55c5f0598 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>
Upstream-commit: 259859289b
Component: cli
2016-12-07 07:41:55 -08:00
2f898f42c6 Merge pull request #28535 from yongtang/28497-prune-until
Convert DanglingOnly to Filters for `docker image prune`
Upstream-commit: 7ca372f95e
Component: cli
2016-12-06 11:03:45 +01:00
808190cd07 Merge pull request #28963 from vieux/refactor_plugin_install
refactor plugin install
Upstream-commit: cff6855751
Component: cli
2016-12-05 12:00:29 -08:00
c2a0302e05 api/types/container,client: gofmt
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Upstream-commit: ee4988f4b2
Component: cli
2016-12-05 17:00:36 +02:00
11738d5e98 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>
Upstream-commit: b3c4bacff2
Component: cli
2016-12-02 20:08:49 -08:00
cc2b3e61e8 refactor plugin install
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: 7520858943
Component: cli
2016-12-02 15:23:08 -08:00
78311eeeaf 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>
Upstream-commit: 47f0fde2cf
Component: cli
2016-12-02 11:33:29 -08:00
0f0f90ed78 Merge pull request #29026 from yuexiao-wang/fix-client-test
Optimize the log info for client test
Upstream-commit: f11c4529cb
Component: cli
2016-12-01 16:30:07 +01:00