Commit Graph

6121 Commits

Author SHA1 Message Date
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
Sebastiaan van Stijn a17f67e456
Merge pull request #1628 from simonferquel/context-switch-plugin-and-desktop
Context switch - Plugin and Docker Desktop integration
2019-01-29 12:20:46 +01: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 a3a30faffd
Merge pull request #1619 from albers/completion-context
Bash completion for `docker context` command family
2019-01-29 11:04:11 +01:00
Simon Ferquel e9b7db5b4c Vendoring update for pull secrets and policies
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
2019-01-29 10:03:32 +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
Vincent Demeester f95ca8e1ba
Merge pull request #1633 from silvin-lubecki/refactor-docker-cli-construction
Introduce functional arguments to NewDockerCli for a more stable API.
2019-01-28 15:39:34 +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
Sebastiaan van Stijn ffa55abe9c
Merge pull request #1636 from thaJeztah/bump_golang_1.11.5
Bump Golang 1.11.5 (CVE-2019-6486)
2019-01-24 14:28:32 +01:00
Simon Ferquel c863dbabf7 Vendoring update for v1alpha3
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
2019-01-24 11:43:52 +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
Sebastiaan van Stijn 0e9d1d3b07
Bump Golang 1.11.5 (CVE-2019-6486)
See the milestone for details;
https://github.com/golang/go/issues?q=milestone%3AGo1.11.5+label%3ACherryPickApproved

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-24 02:50:10 +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
Harald Albers 884d0783bd Add bash completion for global `--context|-c` option
Signed-off-by: Harald Albers <github@albersweb.de>
2019-01-22 22:27:01 +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
Sebastiaan van Stijn 89bc5fbbae
Improve `docker image rm` reference docs
Copies the improved description from the man page
to the online reference docs.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-21 16:15:45 +01:00
Sebastiaan van Stijn 01a591477c
Merge pull request #1444 from filipjares/master
Improve `docker image rm` documentation
2019-01-21 16:02:09 +01:00
Sebastiaan van Stijn 37af67fea8
Merge pull request #1624 from JoeWrightss/patch-2
Fix some typos in manifest.md
2019-01-21 11:35:09 +01:00
Sebastiaan van Stijn afa178deae
Merge pull request #1627 from StefanScherer/update-windows10-process-isolation
Update process isolation description for older Windows 10 versions
2019-01-21 11:34:04 +01:00
Vincent Demeester fec5a52188
Merge pull request #1614 from simonferquel/context-docs-alignment
Context Switch: documentation alignment
2019-01-21 09:51:15 +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
Stefan Scherer 7229920e2e
Update process isolation description for older Windows 10 versions
Signed-off-by: Stefan Scherer <scherer_stefan@icloud.com>
2019-01-21 08:27:07 +01:00
Harald Albers 33e0bce89f Complete paused containers on `docker stop`
Signed-off-by: Harald Albers <github@albersweb.de>
2019-01-20 21:59:47 +01:00
Harald Albers 41bd8dad8c Add bash completion for the `context` command family
Signed-off-by: Harald Albers <github@albersweb.de>
2019-01-20 21:10:33 +01:00
zhoulin xie abe1bb9757 Fix some typos in manifest.md
Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>
2019-01-20 01:20:34 +08: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
Sebastiaan van Stijn 48bd4c6deb
Merge pull request #1501 from simonferquel/use-context-commands
Fast context switch: commands
2019-01-15 18:11:38 +01:00
Sebastiaan van Stijn af98c738dd
Merge pull request #1610 from vdemeester/update-code-owners
Remove myself from codeowners 😅
2019-01-15 17:34:37 +01:00
Jean Rouge b039db985a Make it possible to override the volume mounts and shell for the dev container
Through the `DOCKER_CLI_MOUNTS` and `DOCKER_CLI_SHELL` env variables. Also
allows setting the dev container name through the `DOCKER_CLI_CONTAINER_NAME`
env var.

The motivation for allowing overriding the volume mounts is the same as for
moby/moby#37845, namely that I/O perf on native mounted
disks on non-Linux (notably Mac OS) is just terrible, thus making it a real
pain to develop: one has to choose between re-building the image after every
single change (eg to run a test) or just work directly inside the same
container (eg with vim, but even then one would have to re-configure their dev
container every time it gets destroyed - containers, after all, are not
supposed to be long-lived).

Allowing to override DOCKER_CLI_MOUNTS makes it easy for everyone
to decide what their volume/syncing strategy is; for example
one can choose to use [docker-sync](https://github.com/EugenMayer/docker-sync).

As for the shell, it's nice to be able to use bash instead of the more
bare-bones `ash` if preferred.

Finally, being able to name the container can come in handy for easier
scripting on the host.

This patch won't change anything for anyone who doesn't set these env variables
in their environment.

Signed-off-by: Jean Rouge <rougej+github@gmail.com>
2019-01-14 10:40:30 -08:00
Olli Janatuinen 1b8d1e23c5 Add compose schema version 3.8
Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
2019-01-14 18:18:17 +02:00
Sebastiaan van Stijn a6e37bd666
Merge pull request #1595 from JoeWrightss/patch-1
Fix some spelling errors
2019-01-13 14:55:11 +01:00
Vincent Demeester 355a441712
Merge pull request #1603 from thaJeztah/fix_makefile_help
Fix some missing targets in "make help"
2019-01-11 09:53:08 +01:00
JoeWrightss 9c9ce7f4c2 Fix some spelling errors
Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>
2019-01-11 15:49:02 +08:00
Simon Ferquel 591385a1d0 Fast Context Switch: commands
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
2019-01-10 22:25:43 +01:00
Vincent Demeester d054d47dbe
Remove myself from codeowners 😅
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2019-01-10 17:32:07 +01:00
Sebastiaan van Stijn f5280d60ee
Merge pull request #1430 from AkihiroSuda/non-recursive-bind
support --mount type=bind,bind-nonrecursive,...
2019-01-10 16:37:11 +01:00
Sebastiaan van Stijn cbb699ab9c
Makefile: make help: fix newline wrapping, and missing targets
This patch adds support for multiple newlines and removes the 1-space
indentation of wrapped lines.

Given these targets:

```Makefile
.PHONY: foobar
foobar: ## runs the foobar lorum ipsum.\nand so pn\nand so on
	echo foobar
```

Before this change, the output of `make help` was

```
foobar               runs the foobar lorum ipsum.
                      and so pn\nand so on
```

After this change, the output is:

```
foobar               runs the foobar lorum ipsum.
                     and so pn
                     and so on
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-10 13:30:03 +01:00