Commit Graph

910 Commits

Author SHA1 Message Date
Ulysses Souza 92013600f9 Refactor plugins' vendor location on --help
- The placement of the vendor is now in the end of the line.
- A '*' is now added as suffix of plugins' top level commands.

Signed-off-by: Ulysses Souza <ulysses.souza@docker.com>
2019-02-21 17:54:11 +01:00
Silvin Lubecki 7f612bfca6
Merge pull request #1529 from lifubang/ttyexecresize
fixes 1492: tty initial size error
2019-02-12 10:31:17 +01:00
Lifubang 3fbffc682b tty initial size error
Signed-off-by: Lifubang <lifubang@acmcoder.com>
Signed-off-by: lifubang <lifubang@acmcoder.com>
2019-02-12 09:14:50 +08:00
Tibor Vass 60e774305d
Merge pull request #1602 from thaJeztah/hide_experimental_deploy
Hide legacy top-level "deploy" command with DOCKER_HIDE_LEGACY_COMMANDS=1
2019-02-08 13:53:12 -08:00
Sebastiaan van Stijn d21d1ce675
Merge pull request #1648 from thaJeztah/hide_builder_and_network
Hide "builder" and "network" commands on old API versions
2019-02-07 18:34:08 +01:00
Silvin Lubecki b1d27091e5
Merge pull request #1515 from sw-pschmied/1514-prevent-replacing-irregular-files
Prevent overwriting irregular files (cp, save, export commands)
2019-02-07 10:05:02 +01:00
Philipp Schmied 7632776b35 Prevent overwriting irregular files (cp, save, export commands)
Signed-off-by: Philipp Schmied <pschmied@schutzwerk.com>
2019-02-07 09:17:35 +01:00
Vincent Demeester 8ef8df81a8
Merge pull request #1655 from thaJeztah/bump_engine
Update docker, swarmkit, containerd v1.2.2
2019-02-06 18:24:05 +01:00
Silvin Lubecki b877ef85b2
Merge pull request #1657 from thaJeztah/compose_credential_spec_fix
compose file: disallow additional properties in credential_spec
2019-02-06 16:21:35 +01:00
John Howard 593acf077b Add --device support for Windows
Adds support for --device in Windows. This must take the form of:
--device='class/clsid'. See this post for more information:

https://blogs.technet.microsoft.com/virtualization/2018/08/13/bringing-device-support-to-windows-server-containers/

Signed-off-by: John Howard <jhoward@microsoft.com>
2019-02-04 08:32:47 -08:00
Sebastiaan van Stijn 1e99ed3ca3
Disallow additional properties in credential_spec
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-02-02 18:27:50 +01:00
Sebastiaan van Stijn d034df736b
Update docker, swarmkit, containerd v1.2.2
Also update the tests to account for the new "Builder" field
in docker info.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-02-02 17:03:12 +01:00
Tonis Tiigi 27b2797f7d Remove docker api dependency from cli/config
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-01-31 21:25:43 +00:00
Silvin Lubecki 2e5639da02
Merge pull request #1564 from ijc/plugins
Basic framework for writing and running CLI plugins
2019-01-31 17:44:46 +01:00
Sebastiaan van Stijn 5486cddbd9
Merge pull request #1617 from simonferquel/pull-secrets
Add support for Kubernetes Pull secrets and Pull policies
2019-01-31 13:37:45 +01:00
Ian Campbell 1c576e9043 Integrate CLI plugins into `docker info`
Fairly straight forward. It became necessary to wrap `Plugin.Err` with a type
which implements `encoding.MarshalText` in order to have that field rendered
properly in the `docker info -f '{{json}}'` output.

Since I changed the type somewhat I also added a unit test for `formatInfo`.

Signed-off-by: Ian Campbell <ijc@docker.com>
2019-01-30 13:45:26 +00:00
Ian Campbell 0ab8ec0e4c Output broken CLI plugins in `help` output.
Signed-off-by: Ian Campbell <ijc@docker.com>
2019-01-30 13:45:26 +00:00
Ian Campbell f912b55bd1 Integrate CLI plugins into `docker help` output.
To do this we add a stub `cobra.Command` for each installed plugin (only when
invoking `help`, not for normal running).

This requires a function to list all available plugins so that is added here.

Signed-off-by: Ian Campbell <ijc@docker.com>
2019-01-30 13:44:06 +00:00
Ian Campbell f1f31abbe5 Add support for running a CLI plugin
Also includes the  scaffolding for finding a validating plugin candidates.

Argument validation is moved to RunE to support this, so `noArgs` is removed.

Signed-off-by: Ian Campbell <ijc@docker.com>
2019-01-30 13:44:04 +00:00
Sebastiaan van Stijn 99fb2c1baa
Hide "builder" and "network" commands on old API versions
- The `/build/prune` endpoint was added in API v1.31
- The `/network` endpoints were added in API v1.21

This patch hides these commands on older API versions

Before this change:

```
DOCKER_API_VERSION=1.0 docker

...

Management Commands:
  builder     Manage builds
  container   Manage containers
  image       Manage images
  manifest    Manage Docker image manifests and manifest lists
  network     Manage networks
  system      Manage Docker
  trust       Manage trust on Docker images
```

After this change

```
DOCKER_API_VERSION=1.0 docker

...

Management Commands:
  container   Manage containers
  image       Manage images
  manifest    Manage Docker image manifests and manifest lists
  system      Manage Docker
  trust       Manage trust on Docker images
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-30 01:06:09 +01:00
Simon Ferquel d184c0908a Add support for pull secrets and policies
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
2019-01-29 18:12:43 +01:00
Silvin Lubecki b258f458cc
Merge pull request #1573 from thaJeztah/fix_proxy_on_create
Fix proxy-configuration being ignored on docker create
2019-01-29 18:11:06 +01:00
Ian Campbell e96240427f Add basic framework for writing a CLI plugin
That is, the helper to be used from the plugin's `main`.

Also add a `helloworld` plugin example and build integration.

Signed-off-by: Ian Campbell <ijc@docker.com>
2019-01-29 11:26:40 +00:00
Ian Campbell 8cf946d1bc Unit test for WithContentTrustFromEnv
I authored this for `contentTrustEnabled` prior to 7f207f3f95, so this now
tests the funcation argument version.

Signed-off-by: Ian Campbell <ijc@docker.com>
2019-01-29 11:26:40 +00:00
Ian Campbell eab40a5974 cli/config: Add a helper to resolve a file within the config dir
Signed-off-by: Ian Campbell <ijc@docker.com>
2019-01-29 11:26:40 +00:00
Ian Campbell 20c19830a9 Move versioning variables to a separate package.
This helps to avoid circular includes, by separating the pure data out from the
actual functionality in the cli subpackage, allowing other code which is
imported to access the data.

Signed-off-by: Ian Campbell <ijc@docker.com>
2019-01-29 11:26:40 +00:00
Ian Campbell c5168117af Push setup of opts and default flagset into SetupRootCommand
I'm shortly going to add a second user (plugins) which want to share some
behaviour.

Signed-off-by: Ian Campbell <ijc@docker.com>
2019-01-29 11:26:21 +00:00
Ian Campbell 38645ca44a Refactor common bits of `SetupRootCommand`
I'm shortly going to add a second user to setup plugins, which will want to
reuse the common bits.

Signed-off-by: Ian Campbell <ijc@docker.com>
2019-01-29 11:26:21 +00:00
Ian Campbell ccef1598b1 Move `disableFlagsInUseLine` from `main` into our `cli` library
... and expose. I would like to use this from another site.

This implies also moving (and exposing) the `visitAll` helper.

Unit test them while I'm here.

Signed-off-by: Ian Campbell <ijc@docker.com>
2019-01-29 11:26:21 +00:00
Ian Campbell 158a766886 Fold `dockerPreRun` into `DockerCli.Initialize`
All of the current callers follow the pattern:

    dockerPreRun(opts)
    err := dockerCli.Initialize(opts) ...

So there is no semantic change into merging the content of `dockerPreRun` into the head of `Initialize`.

I'm about to add a new caller outside of the `cmd/docker` package and this
seems preferable exporting `DockerPreRun`.

Signed-off-by: Ian Campbell <ijc@docker.com>
2019-01-29 11:26:21 +00:00
Simon Ferquel 3126920af1 Add context store config options and expose context commands
This will allow plugins to have custom typed endpoints, as well as
create/remove/update contexts with the exact same results as the main
CLI (thinking of things like `docker ee login https://my-ucp-server
--context ucp-prod)`

Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
2019-01-29 11:19:54 +01:00
Sebastiaan van Stijn cf6c238660
Merge pull request #1615 from simonferquel/handle-v1alpha3
Handle v1alpha3 of Compose on Kubernetes API
2019-01-28 21:02:51 +01:00
Silvin Lubecki 7f207f3f95 Introduce functional arguments to NewDockerCli for a more stable API.
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2019-01-28 14:52:58 +01:00
Silvin Lubecki eb0ba4f8d5 Extract streams helpers from command package to their own package to remove a cyclic dependency from command to internal/containerizedengine
Aliasing old types
* streams.InStream -> streams.In
* streams.NewInStream -> streams.NewIn
* streams.OutStream -> streams.Out
* streams.NewOutStream -> streams.NewOut

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2019-01-28 14:36:00 +01:00
Sebastiaan van Stijn 81e7426e11
Merge pull request #1507 from arcenik/fix/better-error-msg-for-ssh-addr
Updates ssh connhelper error messages
2019-01-28 13:48:14 +01:00
François Scala a07637ae31
Updates ssh connhelper error messages
Signed-off-by: François Scala <arcenik@github.com>
2019-01-25 23:42:13 +01:00
Sebastiaan van Stijn 080f30a60f
Merge pull request #1638 from ijc/separate-client-system-info
Separate client infomation in `docker system info`
2019-01-25 17:32:07 +01:00
Ian Campbell bcb06b5f58 Rework `docker info` output to be more like `docker version`
That is, reindent the two sections by one space.

While the code was done by hand the `.golden` files had the extra space
inserted with emacs' `string-insert-rectangle` macro to (try to) avoid possible
manual errors. The docs were edited the same way.

Signed-off-by: Ian Campbell <ijc@docker.com>
2019-01-25 14:46:26 +00:00
Ian Campbell c9e60ae17a Allow `prettyPrintInfo` to return multiple errors
This allows it to print what it can, rather than aborting half way when a bad
security context is hit.

Signed-off-by: Ian Campbell <ijc@docker.com>
2019-01-25 14:40:33 +00:00
Ian Campbell 62ed1c0c5b Separate client and daemon info in `docker system info`
Right now the only client side info we have is whether debug is enabled, but we
expect more in the future.

We also preemptively prepare for the possibility of multiple errors when
gathering both daemon and client info.

Signed-off-by: Ian Campbell <ijc@docker.com>
2019-01-25 14:38:04 +00:00
Ian Campbell 7913fb6a5e Check json output in existing `docker info` unit tests.
This is in addition to the more specific `formatInfo` unit tests added
previously.

Signed-off-by: Ian Campbell <ijc@docker.com>
2019-01-25 11:55:54 +00:00
Ian Campbell eb714f7c0e Add unit test for `formatInfo`.
Signed-off-by: Ian Campbell <ijc@docker.com>
2019-01-25 11:55:52 +00:00
Simon Ferquel 820b6f1742 Added stack conversion tests
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
2019-01-25 09:58:31 +01:00
Simon Ferquel 2e5981d613 Handle version v1alpha3
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
2019-01-24 20:24:45 +01:00
Silvin Lubecki ebb121ee2d
Merge pull request #1611 from simonferquel/stack-children-atomic
Make child resource creation atomic when creating a k8s stack
2019-01-24 11:34:29 +01:00
Vincent Demeester 4d5f8ea8c7
Merge pull request #1519 from silvin-lubecki/export-stack-commands
Export stack commands
2019-01-23 10:35:16 +01:00
Simon Ferquel e16a875408 Make child resource creation atomic when creating a k8s stack
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
2019-01-22 11:25:41 +01:00
Simon Ferquel 005578e317 Context Switch: documentation alignment
Last batch of modifications to the context switch implementation missed
some documentation updates. This is an update to the CLI reference and
the store implementation Godoc.

Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
2019-01-21 09:24:12 +01:00
Sebastiaan van Stijn 91bc4ddde2
Fix: proxy-configuration being ignored on docker create
Proxies configured in config.json were only taking effect
when using `docker run`, but were being ignored when
using `docker create`.

Before this change:

    echo '{"proxies":{"default":{"httpProxy":"httpProxy","httpsProxy":"httpsProxy","noProxy":"noProxy","ftpProxy":"ftpProxy"}}}' > config.json
    docker inspect --format '{{.Config.Env}}' $(docker --config=./ create busybox)
    [PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin]

With this change applied:

    echo '{"proxies":{"default":{"httpProxy":"httpProxy","httpsProxy":"httpsProxy","noProxy":"noProxy","ftpProxy":"ftpProxy"}}}' > config.json
    docker inspect --format '{{.Config.Env}}' $(docker --config=./ create busybox)
    [NO_PROXY=noProxy no_proxy=noProxy FTP_PROXY=ftpProxy ftp_proxy=ftpProxy HTTP_PROXY=httpProxy http_proxy=httpProxy HTTPS_PROXY=httpsProxy https_proxy=httpsProxy PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin]

Reported-by: Silvano Cirujano Cuesta <Silvanoc@users.noreply.github.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-19 12:33:33 +01:00
Silvin Lubecki cf0271ace4 Expose all stack commands to be used by downstream projects.
Factorize orchestrator switch among stack commands.

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2019-01-16 14:47:50 +01:00