Commit Graph

5771 Commits

Author SHA1 Message Date
025a808cd4 fix: docker login autocomplete for zsh
Changed `--user` to `--username`

Signed-off-by: Rohan Verma <hello@rohanverma.net>
(cherry picked from commit 1dc756e8df)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 048af5b37b
Component: cli
2019-07-12 16:10:24 +02:00
87dd848fb9 Add bash completion for events --filter node
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit c1639e1e42)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 7ee8241f71
Component: cli
2019-07-12 16:09:59 +02:00
d352de241a docs: add info for events backlog and scope
1. Adds `docker events` description info on the two scope types of events.
2. Adds `docker events` note in two places about backlog limit of event log.

Further info and background info in Issue 727

Signed-off-by: Bret Fisher <bret@bretfisher.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 988b9a0d96)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 74d51dc13b
Component: cli
2019-07-12 16:08:23 +02:00
2f1c550ef2 Merge pull request #1978 from thaJeztah/18.09_backport_fix_rollback_config_interpolation
[18.09 backport] Fix Rollback config type interpolation
Upstream-commit: ec2ecc1c8b
Component: cli
2019-07-03 23:09:20 +02:00
5f9904bac8 Rollback config type interpolation on fields "parallelism" and "max_failure_ratio" were missing, as it uses the same type as update_config.
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
(cherry picked from commit efdf36fa81)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 23c88a8311
Component: cli
2019-07-03 19:20:08 +02:00
b083df35c8 Merge pull request #1842 from thaJeztah/18.09_bump_buildkit_18.09
[18.09 backport] bump buildkit 05766c5c21a1e528eeb1c3522b2f05493fe9ac47 (docker-18.09 branch)
Upstream-commit: 3a749342a3
Component: cli
2019-06-18 09:49:42 -07:00
005488fdc5 bump tonistiigi/fsutil 2862f6bc5ac9b97124e552a5c108230b38a1b0ca
- tonistiigi/fsutil#54 walker: allow enotdir as enoent

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 278d30bceb
Component: cli
2019-04-20 13:22:11 +02:00
dc984ba0ef bump buildkit 05766c5c21a1e528eeb1c3522b2f05493fe9ac47 (docker-18.09 branch)
full diff: 520201006c..05766c5c21

- moby/buildkit#952 [18.09 backport] Have parser error on dockerfiles without instructions
  - backport of moby/buildkit#771 Have parser error on dockerfiles without instructions

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 65b28186fc
Component: cli
2019-04-20 13:19:07 +02:00
3778127afa Merge pull request #1795 from thaJeztah/18.09_backport_dialstdio_1736
[18.09 backport] dial-stdio: fix goroutine leakage
Upstream-commit: c89750f836
Component: cli
2019-04-02 10:26:42 +02:00
48166d2ecb Merge pull request #1794 from thaJeztah/18.09_backport_fix_stack_watch
[18.09 backport] Fix the stack informer's selector used to track deployment
Upstream-commit: c805ad2964
Component: cli
2019-04-02 10:24:41 +02:00
4f1c087345 dial-stdio: fix goroutine leakage
Fix #1736

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
(cherry picked from commit f8d4c443ba)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: d8c6c830f8
Component: cli
2019-04-02 00:25:24 +02:00
515ac23e13 Fix the stack informer's selector used to track deployment
Old selector was wrong (it watched for the label we applied to child
resources when reconciling the stack, instead of the stack itself)

This should be back-ported to older version of the CLI

Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
(cherry picked from commit 8cd74eb33a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: f89d05edcb
Component: cli
2019-04-01 18:23:43 +02:00
044022b8c7 Merge pull request #1788 from thaJeztah/18.09_backport_annotations
[18.09 backport] fix annotations on --template-driver
Upstream-commit: e1fe8f3c45
Component: cli
2019-03-28 16:50:17 -07:00
8054c5a69b Fix annotation on docker secret create --template-driver
Signed-off-by: Sune Keller <absukl@almbrand.dk>
(cherry picked from commit 217308d96d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 356eda4028
Component: cli
2019-03-29 00:33:02 +01:00
1617714f28 Fix annnotation on docker config create --template-driver
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
(cherry picked from commit 470afe11ed)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 85148aa3f1
Component: cli
2019-03-29 00:32:44 +01:00
7d07a796f3 Merge pull request #1775 from thaJeztah/18.09_backport_ttyexecresize
[18.09 backport] fixes 1492: tty initial size error
Upstream-commit: 19c0311d46
Component: cli
2019-03-28 10:20:48 -07:00
8677ecab79 Merge pull request #1776 from thaJeztah/18.09_backport_upgrade_shellcheck_0.6.0
[18.09 backport] use official shellcheck 0.6.0, and don't patch Dockerfiles in CI
Upstream-commit: 207ff0831d
Component: cli
2019-03-28 10:19:59 -07:00
1b7a5a4e5a Merge pull request #1778 from thaJeztah/18.09_bump_engine
[18.09] bump engine 200b524eff60a9c95a22bc2518042ac2ff617d07 (18.09 branch)
Upstream-commit: 57b27434ea
Component: cli
2019-03-27 08:28:02 -07:00
b3b20effb4 bump engine 200b524eff60a9c95a22bc2518042ac2ff617d07 (18.09 branch)
relevant changes;

- moby/moby#38006 / docker/engine#114 client: use io.LimitedReader for reading HTTP error
- moby/moby#38634 / docker/engine#167 pkg/archive:CopyTo(): fix for long dest filename
  - fixes docker/for-linux#484 for 18.09
- moby/moby#38944 / docker/engine#183 gitutils: add validation for ref
- moby/moby#37780 / docker/engine#55 pkg/progress: work around closing closed channel panic
  - addresses moby/moby#/37735 pkg/progress: panic due to race on shutdown

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 010c234a0d
Component: cli
2019-03-27 10:08:23 +01:00
4dba9e73a5 Update to shellcheck v0.6.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit ff107b313a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 9a5296c8f1
Component: cli
2019-03-26 14:33:39 +01:00
6006ae7e52 Use official shellcheck image
This patch switches the shellcheck image to use the official image
from Docker Hub.

Note that this does not yet update shellcheck to the latest version (v0.5.x);
Shellcheck v0.4.7 added some new checks, which makes CI currently fail, so will
be done in a follow-up PR. Instead, the v0.4.6 version is used in this PR, which
is closest to the same version as was installed in the image before this change;

```
docker run --rm docker-cli-shell-validate shellcheck --version
ShellCheck - shell script analysis tool
version: 0.4.4
license: GNU General Public License, version 3
website: http://www.shellcheck.net
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 388646eab0)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: b59752479b
Component: cli
2019-03-26 14:26:45 +01:00
69d2858460 Do not patch Dockerfiles in CI
When building the Dockerfiles for development, those images are mainly used to
create a reproducible build-environment. The source code is bind-mounted into
the image at runtime; there is no need to create an image with the actual
source code, and copying the source code into the image would lead to a new
image being created for each code-change (possibly leading up to many "dangling"
images for previous code-changes).

However, when building (and using) the development images in CI, bind-mounting
is not an option, because the daemon is running remotely.

To make this work, the circle-ci script patched the Dockerfiles when CI is run;
adding a `COPY` to the respective Dockerfiles.

Patching Dockerfiles is not really a "best practice" and, even though the source
code does not and up in the image, the source would still be _sent_ to the daemon
for each build (unless BuildKit is used).

This patch updates the makefiles, circle-ci script, and Dockerfiles;

- When building the Dockerfiles locally, pipe the Dockerfile through stdin.
  Doing so, prevents the build-context from being sent to the daemon. This speeds
  up the build, and doesn't fill up the Docker "temp" directory with content that's
  not used
- Now that no content is sent, add the COPY instructions to the Dockerfiles, and
  remove the code in the circle-ci script to "live patch" the Dockerfiles.

Before this patch is applied (with cache):

```
$ time make -f docker.Makefile build_shell_validate_image
docker build -t docker-cli-shell-validate -f ./dockerfiles/Dockerfile.shellcheck .
Sending build context to Docker daemon     41MB
Step 1/2 : FROM    debian:stretch-slim
...
Successfully built 81e14e8ad856
Successfully tagged docker-cli-shell-validate:latest

2.75 real         0.45 user         0.56 sys
```

After this patch is applied (with cache)::

```
$ time make -f docker.Makefile build_shell_validate_image
cat ./dockerfiles/Dockerfile.shellcheck | docker build -t docker-cli-shell-validate -
Sending build context to Docker daemon  2.048kB
Step 1/2 : FROM    debian:stretch-slim
...
Successfully built 81e14e8ad856
Successfully tagged docker-cli-shell-validate:latest

0.33 real         0.07 user         0.08 sys
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 166856ab1b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 8997667aa2
Component: cli
2019-03-26 14:26:01 +01:00
5978d67dd6 tty initial size error
Signed-off-by: Lifubang <lifubang@acmcoder.com>
Signed-off-by: lifubang <lifubang@acmcoder.com>
(cherry picked from commit 3fbffc682b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: bcae2c4408
Component: cli
2019-03-26 12:51:27 +01:00
e4b5243fcd moved integration test TestExportContainerWithOutputAndImportImage from moby/moby to docker/cli.
The integration test TestExportContainerWithOutputAndImportImage in moby/moby is the same as TestExportContainerAndImportImage,
except for the output file option. Adding a unit test to cover the output file option of the export command here allows
the removal of the redundant integration test TestExportContainerWithOutputAndImportImage.

Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
(cherry picked from commit fc1e11d46a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 079adf3f23
Component: cli
2019-03-26 12:51:22 +01:00
b13cfeb5ba Merge pull request #1733 from thaJeztah/18.09_backport_dial_stdio_npipe_on_windows
[18.09 backport] dial-stdio: handle connections which lack CloseRead method
Upstream-commit: f6693b0b25
Component: cli
2019-03-21 14:35:47 -07:00
38ac401e28 Merge pull request #1744 from thaJeztah/18.09_backport_docs_fixes
[18.09 backport] various docs fixes
Upstream-commit: ed16a3136b
Component: cli
2019-03-18 17:36:26 +01:00
7a40ed937a Merge pull request #1741 from thaJeztah/18.09_backport_fix_plugin_test
[18.09 backport] Fix: plugin-tests discarding current environment
Upstream-commit: e63ac0ea35
Component: cli
2019-03-18 14:47:32 +01:00
e9e7044d89 Add some spaces for cosmetics and readability reasons.
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
(cherry picked from commit 8401c81b46)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: c1a4358ea4
Component: cli
2019-03-18 13:52:13 +01:00
5def8bca28 Add exit status to docker exec manpage
There's little way of knowing what each exit status means at present
because it's not documented. I'm assuming they are the same as docker
run.

Signed-off-by: Eric Curtin <ericcurtin17@gmail.com>
(cherry picked from commit 23670968cc)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 27ab7cc3d6
Component: cli
2019-03-18 11:16:13 +01:00
8cae313dd6 Corrected max-file option - was incorrectly spelt as max-files
Signed-off-by: Steve Richards <steve.richards@docker.com>
(cherry picked from commit 04f88005c9)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 74bd5f143f
Component: cli
2019-03-18 11:16:11 +01:00
3adaef1e74 Note caveat with detaching using key sequence
This has come up a few times, e.g. https://github.com/moby/moby/issues/20864 and https://github.com/moby/moby/issues/35491

Signed-off-by: Ben Creasy <ben@bencreasy.com>
(cherry picked from commit 767b25fc52)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 8dc400713f
Component: cli
2019-03-18 11:16:08 +01:00
d6ea168f88 Fix typos
Signed-off-by: Michael Käufl <docker@c.michael-kaeufl.de>
(cherry picked from commit 0e469c1d1d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 543f9b32ee
Component: cli
2019-03-18 11:16:05 +01:00
0ddc0b1b54 Fix small typo
Noticed a typo in this markdown file: "instead" instead of "in stead"

Signed-off-by: Ryan Wilson-Perkin <ryanwilsonperkin@gmail.com>
(cherry picked from commit 7a9fc782c5)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 1d314f2227
Component: cli
2019-03-18 11:15:59 +01:00
ab07868a3f 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>
(cherry picked from commit 89bc5fbbae)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 275ab1f063
Component: cli
2019-03-18 11:15:57 +01:00
2b74693bae Update process isolation description for older Windows 10 versions
Signed-off-by: Stefan Scherer <scherer_stefan@icloud.com>
(cherry picked from commit 7229920e2e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 4f6ab11ff4
Component: cli
2019-03-18 11:15:55 +01:00
8fe68b3c25 Fix some typos in manifest.md
Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>
(cherry picked from commit abe1bb9757)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 537309a548
Component: cli
2019-03-18 11:15:52 +01:00
0e8ded3923 docs: add missing ID placeholder for docker node ps
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 24018b9ffd)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 08714b4579
Component: cli
2019-03-18 11:15:50 +01:00
c81fbf531f docs(metrics-addr): Use port 9323, allocated for Docker in prometheus
Signed-off-by: Frederic Hemberger <mail@frederic-hemberger.de>
(cherry picked from commit 89aa2cf9f6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 789a15bc73
Component: cli
2019-03-18 11:15:48 +01:00
e0cf2f4f92 Fixed typo.
Signed-off-by: Anne Henmi <anne.henmi@docker.com>
(cherry picked from commit 4aecd8bda1)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: ce12ac2d14
Component: cli
2019-03-18 11:15:45 +01:00
3803869429 Replace environmental with environment
Signed-off-by: Nir Soffer <nsoffer@redhat.com>
(cherry picked from commit f1f3d3be17)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 4c94a0af75
Component: cli
2019-03-18 11:15:43 +01:00
733325e26f Improve docker image rm documentation
The `docker image rm` command can be used not only
to remove images but also remove tags.

This update improves the documentation to make
this clear.

Signed-off-by: Filip Jareš <filipjares@gmail.com>
(cherry picked from commit 2ba9601ef1)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 0717f261ed
Component: cli
2019-03-18 11:15:39 +01:00
2c6914129c Fix: plugin-tests discarding current environment
By default, exec uses the environment of the current process, however,
if `exec.Env` is not `nil`, the environment is discarded:

e73f489494/src/os/exec/exec.go (L57-L60)

> If Env is nil, the new process uses the current process's environment.

When adding a new environment variable, prepend the current environment,
to make sure it is not discarded.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 6c4fbb7738)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: fc8717799f
Component: cli
2019-03-17 15:47:28 +01:00
8845519dce Merge pull request #1734 from thaJeztah/18.09_backport_fix_test_for_go_1.12
[18.09 backport] Fix test for Go 1.12.x
Upstream-commit: 76f4876129
Component: cli
2019-03-14 16:55:40 +01:00
ea47598cf6 Fix test for Go 1.12.x
After switching to Go 1.12, the format-string causes an error;

```
=== Errors
cli/config/config_test.go:154:3: Fatalf format %q has arg config of wrong type *github.com/docker/cli/cli/config/configfile.ConfigFile
cli/config/config_test.go:217:3: Fatalf format %q has arg config of wrong type *github.com/docker/cli/cli/config/configfile.ConfigFile
cli/config/config_test.go:253:3: Fatalf format %q has arg config of wrong type *github.com/docker/cli/cli/config/configfile.ConfigFile
cli/config/config_test.go:288:3: Fatalf format %q has arg config of wrong type *github.com/docker/cli/cli/config/configfile.ConfigFile
cli/config/config_test.go:435:3: Fatalf format %q has arg config of wrong type *github.com/docker/cli/cli/config/configfile.ConfigFile
cli/config/config_test.go:448:3: Fatalf format %q has arg config of wrong type *github.com/docker/cli/cli/config/configfile.ConfigFile

DONE 1115 tests, 2 skipped, 6 errors in 215.984s
make: *** [Makefile:22: test-coverage] Error 2
Exited with code 2
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit d4877fb225)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 7ea48a16e3
Component: cli
2019-03-13 22:27:00 +01:00
9d70293b5b dial-stdio: Close the connection
This was leaking the fd.

Signed-off-by: Ian Campbell <ijc@docker.com>
(cherry picked from commit 186e7456ac)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 75e9075591
Component: cli
2019-03-13 11:54:11 +01:00
c2cf227965 dial-stdio: handle connections which lack CloseRead method.
This happens on Windows when dialing a named pipe (a path which is used by CLI
plugins), in that case some debugging shows:

    DEBU[0000] conn is a *winio.win32MessageBytePipe
    DEBU[0000] conn is a halfReadCloser: false
    DEBU[0000] conn is a halfWriteCloser: true
    the raw stream connection does not implement halfCloser
In such cases we can simply wrap with a nop function since closing for read
isn't too critical.

Signed-off-by: Ian Campbell <ijc@docker.com>
(cherry picked from commit 8919bbf04d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 69e1094f5a
Component: cli
2019-03-13 11:53:58 +01:00
4e69571cff Merge pull request #1729 from thaJeztah/18.09_backport_e2e_handle_alpine_bump
[18.09 backport] Fixes for e2e testing after Alpine bump
Upstream-commit: 890e29da87
Component: cli
2019-03-12 13:01:46 +01:00
35a6ca7054 e2e: avoid usermod -p by using useradd's --password option
Signed-off-by: Ian Campbell <ijc@docker.com>
(cherry picked from commit 0b0c57871a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 78d52ec5d4
Component: cli
2019-03-12 10:36:15 +01:00
e0218c5780 e2e: Expand useradd's -m otion into --create-home
... for improved readability

Signed-off-by: Ian Campbell <ijc@docker.com>
(cherry picked from commit e854a9cf96)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: c0bbca75af
Component: cli
2019-03-12 10:36:03 +01:00
ba2b4c0c65 e2e Use useradd's --shell option
... in preference to `chsh`, since in recent alpine 3.9.2 images that can fail
with:

    Password: chsh: PAM: Authentication token manipulation error

Which seems to relate to the use of `!` as the password for `root` in `/etc/shadow`gq

Signed-off-by: Ian Campbell <ijc@docker.com>
(cherry picked from commit 5de2d9e8a9)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: b666e9a090
Component: cli
2019-03-12 10:35:23 +01:00