Commit Graph

140 Commits

Author SHA1 Message Date
5d994cf1a3 Merge pull request #32244 from Microsoft/jjh/panicfix
Windows - fix panic and stderr output when service
Upstream-commit: a96de091d644db1c31b699a7a22d9ef63b376560
Component: engine
2017-04-01 20:00:59 +02:00
75453ad8e7 Windows - fix panic and stderr
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 141a83b820140fac130840b2a0ea9df75ab4e55d
Component: engine
2017-03-31 09:51:50 -07:00
f66bd50c2b Merge pull request #28696 from jlhawn/deprecate_graph_flag
Deprecate --graph flag; Replace with --data-root
Upstream-commit: 1ecaed0a99331ff6140e0a714e1b50d466597775
Component: engine
2017-03-31 10:51:15 +02:00
890e256320 Merge pull request #32174 from KarthikNayak/32113
Dockerd: enable CORS when only `--api-cors-header` is used
Upstream-commit: 59aed5ab36b1b5b360aa230effbefd757e889329
Component: engine
2017-03-30 11:13:52 -04:00
719f2c6960 Add conflict check for flags, and update deprecation versions
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: df7a72cffa7f28c67fb25eecd113dc21822afcc0
Component: engine
2017-03-30 12:21:05 +02:00
dcff175aff Remove constant for "config-file" flag
None of the daemon flags use a constant for the
flag name.

This patch removes the constant for consistency

Also removes a FIXME, that was now in the wrong
location, and added a long time ago in
353b7c8ec77b30fa83dac5ec0778193f6de8b437,
without a lot of context (and probably no longer really relevant).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 9894576fb7e11d9536e09ca04193b845a33b9dec
Component: engine
2017-03-30 12:01:00 +02:00
fd940e1e8e Deprecate --graph flag; Replace with --data-root
Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 261ef1fa27c4dfefa5f686b0a4ef354a43040e58
Component: engine
2017-03-30 11:24:56 +02:00
487d9cf34a Merge pull request #31830 from dnephin/refactor-cli-state
Small cleanup now that we have multiple details about the server stored on the cli
Upstream-commit: bce494f7a2ce0e1a2c6563b2e32e5a8bacb128ba
Component: engine
2017-03-29 13:36:32 +02:00
2b108da4a1 Dockerd: enable CORS when only --api-cors-header is used
Even though the flag `--api-enable-cors` is deprecated in favor of
`--api-cors-header`. Using only `--api-cors-header` does not enable
CORS.

Make changes to 'cmd/dockerd/daemon.go' to enable cors if either of
the above flags is set.

Signed-off-by: Karthik Nayak <Karthik.188@gmail.com>
Upstream-commit: f0f673f4d50ac072e4c7a236d2a318632c4fa89c
Component: engine
2017-03-28 18:09:14 +05:30
1faeba234d Merge pull request #31668 from Microsoft/jjh/nopidfileasservice
Windows: no pidfile when service
Upstream-commit: b47c50cf11a48c068e8794af1cd2bfebdae90995
Component: engine
2017-03-23 17:10:35 -04:00
30a11974ed Merge pull request #31930 from anusha-ragunathan/authz-disable
When authz plugin is disabled, remove from authz middleware chain.
Upstream-commit: bbce24997c7a31454edd1d3d979823582bcdd95d
Component: engine
2017-03-22 14:17:38 -07:00
2034662b7a When authz plugin is disabled, remove from authz middleware chain.
When the daemon is configured to run with an authorization-plugin and if
the plugin is disabled, the daemon continues to send API requests to the
plugin and expect it to respond. But the plugin has been disabled. As a
result, all API requests are blocked. Fix this behavior by removing the
disabled plugin from the authz middleware chain.

Tested using riyaz/authz-no-volume-plugin and observed that after
disabling the plugin, API request/response is functional.

Fixes #31836

Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
Upstream-commit: 38de272bd4dfea945985b7031cd353ac5f6507c5
Component: engine
2017-03-22 12:07:39 -07:00
7bf0179b13 update "docker daemon" deprecation message for new version scheme
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: ba76a0c91212d47ae797848802595eef92fa07fa
Component: engine
2017-03-22 00:21:15 +01:00
5ed1f03370 Create a new ServerType struct for storing details about the server on the client.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 41522439859b5d62651e71a424c03f96be26aec3
Component: engine
2017-03-20 12:48:25 -04:00
8021eb2bf2 Improve error handling of commands run against unsupported daemon
The current error-handling only checked for version annotations
on the subcommand itself, but did not check the top-level command.

This patch always traverses the command path (parents), and
prints an error if the command is not supported.

Before this change:

    $ docker service
    Usage:	docker service COMMAND

    Manage services

    Options:
          --help   Print usage

    Commands:
      create      Create a new service
      inspect     Display detailed information on one or more services
      ls          List services
      ps          List the tasks of one or more services
      rm          Remove one or more services
      scale       Scale one or multiple replicated services
      update      Update a service

    Run 'docker service COMMAND --help' for more information on a command.

    $ docker service ls
    ID                  NAME                MODE                REPLICAS            IMAGE

After this change:

    $ DOCKER_API_VERSION=1.12 docker service
    docker service requires API version 1.24, but the Docker daemon API version is 1.12

    $ DOCKER_API_VERSION=1.12 docker service ls
    docker service ls requires API version 1.24, but the Docker daemon API version is 1.12

    $ DOCKER_API_VERSION=1.24 docker plugin --help
    docker plugin requires API version 1.25, but the Docker daemon API version is 1.24

    $ DOCKER_API_VERSION=1.25 docker plugin upgrade --help
    docker plugin upgrade requires API version 1.26, but the Docker daemon API version is 1.25

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 15d63f1c5ba40a0937a935c866c384c953c79b16
Component: engine
2017-03-16 13:45:50 +01: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
5f9634b1f6 Windows: no pidfile when service
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: a8e144dab4ec12eb5111df26abc87f7939faa1c3
Component: engine
2017-03-08 15:18:30 -08:00
b34943b2d7 cmd: docker: fix TestDaemonCommand
In more recent versions of Cobra, `--help` parsing is done before
anything else resulting in TestDaemonCommand not actually passing. I'm
actually unsure if this test ever passed since it appears that !daemon
is not being run as part of the test suite.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
Upstream-commit: dd7159060f60ea04007c069df189a29fda2c655f
Component: engine
2017-03-05 15:26:49 +11:00
31865190c5 'docker daemon' deprecation message doesn't use the new versioning scheme
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: 5a9cee7bb57e7da7f2793fbb290498bba0531105
Component: engine
2017-03-03 17:26:49 +08:00
19d262d100 Merge pull request #31054 from darrenstahlmsft/WaitOOBE
Windows: Wait for OOBE to prevent crashing during host update
Upstream-commit: 7f0b833621f61072d3176d224be02ea5089761f9
Component: engine
2017-02-16 11:18:25 -05:00
d0f9d01ec6 Windows: Wait for OOBE to prevent crashing during host update
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: e128a65685dafd640e32118eb1903581489f7e31
Component: engine
2017-02-15 14:01:54 -08:00
32586ce540 Merge pull request #28638 from yongtang/28626-improve-error-handling
Improve error handling of experimental features in non-experimental mode
Upstream-commit: abe6a073c72107d54187d3bba4385c49d343366d
Component: engine
2017-02-15 11:00:03 -08:00
6affde1e32 Merge pull request #29673 from vdemeester/extract-daemon-config
Extract daemon configuration and discovery to their own package
Upstream-commit: f3a8886d8890d6797a568ab316baf9400ee2e1e1
Component: engine
2017-02-13 09:11:13 -08:00
97ab54822f Additional experimental features in non-experimental mode error handling
This fix is the follow up of the last commit.
In this fix:
1. If any of the parents of a command has tags, then this command's
`Args` (Args validation func) will be wrapped up. The warpped up func
will check to see if the feature is supported or not. If it is not supported,
then a not supported message is generated instead.

This fix is related to 28626.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 8421fc634907a68889b0f20c13b0cf135f0817c6
Component: engine
2017-02-10 17:05:10 -08:00
3662885f94 Improve error handling of experimental features in non-experimental mode
This fix tries to address several issues raised in 28626 where
run against a non-experimental daemon may not generate correct
error message:
1. Incorrect flags were not checked against the supported features:
   ```
   $ docker stack --nonsense
   unknown flag: --nonsense
   ```
2. Subcommands were not checked against the supported features:
   ```
   $ docker stack ls
   Error response from daemon: This node is not a swarm manager...
   ```

This fix address the above mentioned issues by:
1. Add a pre-check for FlagErrorFunc
2. Recursively check if a feature is supported for cmd and its parents.

This fix fixes 28626.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 9f6fea8e7bd3e64edab2bc5bac337b4118ea97df
Component: engine
2017-02-10 16:54:19 -08:00
b0ef747023 review code about cmd/* and fix some easy typos :D
Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>
Upstream-commit: 437e81cd69bf1649d45650a335e121d9dfb2ddf7
Component: engine
2017-02-10 15:52:33 +08:00
dd8010e320 Extract daemon configuration and discovery to their own package
This also moves some cli specific in `cmd/dockerd` as it does not
really belong to the `daemon/config` package.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: db63f9370e26d725357c703cbaf9ab63cc7b6d0a
Component: engine
2017-02-08 09:53:38 +01: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
401f8d10fa Windows: Add service dependency ConDrv
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: b2a7f6abb379e96eb611c27a5bec10c3be854a75
Component: engine
2017-01-17 10:55:25 -08:00
8b3646ee75 plugingetter: Avoid all caps for constant declarations
Go style calls for mixed caps instead of all caps:
https://golang.org/doc/effective_go.html#mixed-caps

Change LOOKUP, ACQUIRE, and RELEASE to Lookup, Acquire, and Release.

This vendors a fork of libnetwork for now, to deal with a cyclic
dependency issue. The change will be upstream to libnetwork once this is
merged.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 428600108cce0a11e65ec4ebd9e439e947b55da7
Component: engine
2017-01-04 10:19:04 -08:00
72d129024d Move package cliconfig to cli/config
I felt it made more sence 👼

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: ce964a607ad7395af7b74a0ba1efc5ab3cb15790
Component: engine
2016-12-25 20:31:52 +01: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
433a6ae35a Merge pull request #29314 from vdemeester/no-more-utils
Remove the utils package
Upstream-commit: b9ee31ae027bbd62477fea3f58023c90f051db00
Component: engine
2016-12-22 15:21:05 +01:00
8534bae85a Change -tlsverify to --tlsverify (Bug Fix: #29521)
Signed-off-by: Jaivish Kothari <janonymous.codevulture@gmail.com>
Upstream-commit: f25e5ceeca74107f7860556a94f05ed61a5442f2
Component: engine
2016-12-19 18:03:57 +05:30
d363742779 return directly without ifs in remaining packages
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Upstream-commit: 2c187a24e0003f2f0ab90b85876e668f2b6210d4
Component: engine
2016-12-14 23:28:27 +02:00
38517bb088 Move debug functions to cli/debug package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: ce375503477c82a76ce8530e73655fbbf5046834
Component: engine
2016-12-12 09:33:58 +01:00
32d2829610 exit with status 1 if help is called on an invalid command.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: bb7601a3ffdc78bbe7efe7e77a196e09cf3607c7
Component: engine
2016-11-23 15:13:58 -05:00
4d1ac89cc0 Swap usage of LazyDLL and LoadDLL to LazySystemDLL.
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: 22c83c567f379dfd475ecd35665e1cc9e5b9c314
Component: engine
2016-11-22 14:57:11 -08:00
40d5a75060 Merge pull request #28611 from vieux/fix_golint
fix a few golint errors
Upstream-commit: 96f50e9b7087bad25cb38e2985c26b509be0c403
Component: engine
2016-11-19 07:16:44 -05:00
68a4c9aae2 Merge pull request #28524 from aluzzardi/experimental-routes
router: Return explicit error rather than 404 for experimental.
Upstream-commit: c3fab6d47345f0d79efd88d0ea0495dd70f0e9f5
Component: engine
2016-11-18 18:49:15 -08:00
c148947fe6 fix a few golint errors
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: 9c559e6d0b7190b4698de59e692a047beba017fd
Component: engine
2016-11-18 18:32:02 -08:00
84fb1a0844 router: Return explicit error rather than 404 for experimental.
Instead of not adding experimental routes at all, fail with an explicit
message if the daemon is not running in experimental mode.

Added the `router.Experimental` which does this automatically.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: 3976a33c1a578827da3726bec3927cc058fe326a
Component: engine
2016-11-17 15:51:47 -08:00
47077e4caf error on cli when trying to use experimental feature with non experimental daemon
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: 98bb08fe38d6faabb639b31ea34aac2ea65f519d
Component: engine
2016-11-17 14:52:01 -08:00
2e39dde1e5 refactor help func in CLI
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: bf95472105e5dad55314cfff599abea5b81b134a
Component: engine
2016-11-17 10:54:10 -08:00
43c58c892c Skip cli initialization for daemon command
Cli initialization pings back to remote API and
creates a deadlock if socket is already being
listened by systemd.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 5b0a52f7dcd04017a1def7326f8adbb8547ebe89
Component: engine
2016-11-16 13:19:45 -08:00
aac63267fa Show experimental flags and subcommands if enabled
Signed-off-by: John Stephens <johnstep@docker.com>
Upstream-commit: d67aa065ef9f295949ed507fc3d67f29fd56fcdb
Component: engine
2016-11-11 17:43:06 -08:00
8ed32ee4ec Merge pull request #28274 from Microsoft/jjh/acl
Windows: create daemon root with ACL
Upstream-commit: 2712bb26e33eea46b69776b7b8aa6e18da0d3554
Component: engine
2016-11-11 09:20:32 -08:00
ae5c2620b1 Use '.' directly
Signed-off-by: Wang Long <long.wanglong@huawei.com>
Upstream-commit: 2b7f7e9aff9e402daa2c561b561178f46769d1c8
Component: engine
2016-11-11 10:22:32 +08:00
29d6547bdb Windows: create daemon root with ACL
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 46ec4c1ae2700ed638072fd7fb326afc10eded20
Component: engine
2016-11-10 17:51:28 -08:00