Commit Graph

5181 Commits

Author SHA1 Message Date
ff053f79c8 Merge pull request #1124 from vdemeester/using-cli-interface-everywhere-possible
Use command.Cli interface instead of concrete type…
Upstream-commit: 805b34127a
Component: cli
2018-06-14 16:43:15 +02:00
ea955bc056 Use command.Cli interface instead of concrete type…
… wherever it's possible. Should make it even easier to test and use
another implementation.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 88068b9dd7
Component: cli
2018-06-14 16:26:47 +02:00
bc1f18ae47 Export Push and Save
As we did for `Pull`, it will be helpful to expose the push and save
implementation.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: e43c7920ea
Component: cli
2018-06-14 15:48:21 +02:00
8be83cb75e Merge pull request #479 from Tim15/init-option
Add --init option to `docker service create`
Upstream-commit: 70db8dee74
Component: cli
2018-06-14 13:58:52 +02:00
ea934f5313 Add --init option to docker service create
Signed-off-by: Timothy Higinbottom <timhigins@gmail.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: ff13f03def
Component: cli
2018-06-14 13:50:12 +02:00
004c784b07 Merge pull request #1122 from thaJeztah/bump_golang_1.10.3
Bump Golang to 1.10.3
Upstream-commit: 722d08f076
Component: cli
2018-06-14 08:30:15 +02:00
a3010b79b8 Merge pull request #1111 from tiborvass/experimental-buildkit
Support for experimental BuildKit
Upstream-commit: 2daec78609
Component: cli
2018-06-13 18:21:41 -07:00
d94fa1b676 build: address some review nits
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: b3a5c153d5
Component: cli
2018-06-13 22:40:31 +00:00
9bd0104a83 build: change --no-console to --console=[true|false|auto]
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 5a103e1844
Component: cli
2018-06-13 21:07:11 +00:00
d2ef5d2bef build: ensure temporary folder is removed in error case
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 00792d1704
Component: cli
2018-06-13 18:32:29 +00:00
b8a5c63caf vendor: update docker/docker to c752b0991e31ba9869ab6a0661af57e9423874fb
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 6c60bb4436
Component: cli
2018-06-13 18:32:29 +00:00
93d874bdbf vendor: update buildkit and fsutil
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 8945270cba
Component: cli
2018-06-13 18:32:29 +00:00
fe7ea0fc10 build: skip moby.buildkit.trace Aux message to be future proof
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: aef42093b8
Component: cli
2018-06-13 18:32:28 +00:00
a8a3e02093 build: fix lint issues + refactor
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 5919e8a30f
Component: cli
2018-06-13 18:32:28 +00:00
61312d5fa4 build: simplify Close logic in WriteTempDockerfile
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 15674d9ee9
Component: cli
2018-06-13 18:32:28 +00:00
bba5c7c5cf build: add experimental --no-console flag to support non-tty human-readable output with buildkit
Unfortunately, this is for now the only way to see the output of RUN commands when using buildkit.
It is equivalent to `DOCKER_BUILDKIT=1 docker build . 2>&1 | cat`

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: ed75f6202b
Component: cli
2018-06-13 18:32:28 +00:00
58b5fdcfda formatter: fix TestDiskUsageContextFormatWrite expected output
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 584d59d8f5
Component: cli
2018-06-13 18:32:28 +00:00
67e3360010 build: setting DOCKER_BUILDKIT environment variable to any non-empty string enables the use of buildkit
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: b2b3f9c461
Component: cli
2018-06-13 18:32:28 +00:00
278bdeaf9d build: fix output handling with buildkit (quiet option, redirects)
With this patch the following become true even with buildkit enabled:
1. `docker build -q .` only outputs the created image's sha256 ID.
2. `docker build -q .` outputs as if no `-q` was specified, if error occurred
3. `docker build . &> out` outputs JSON (instead of TTY characters)

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 640cbb8d2f
Component: cli
2018-06-13 18:32:28 +00:00
250764fab8 build: fix -f handling with buildkit
This commit brings a more pedantic change in the following ambiguous case:
cat Dockerfile | docker build -f otherDockerfile -

The legacy builder does not error out and prefers the Dockerfile from stdin
while the buildkit-based one errors out.

Note that this is only in the case where stdin is a Dockerfile (not an archive)

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 82f0e1e5d8
Component: cli
2018-06-13 18:32:28 +00:00
b17401d002 Bump Golang to 1.10.3
go1.10.3 (released 2018/06/05) includes fixes to the go command, and the
crypto/tls, crypto/x509, and strings packages. In particular, it adds minimal
support to the go command for the vgo transition. See the Go 1.10.3 milestone
on our issue tracker for details;
https://github.com/golang/go/issues?q=milestone%3AGo1.10.3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 1c71c957cb
Component: cli
2018-06-11 11:13:13 -07:00
6467f7f59f Merge pull request #1121 from vdemeester/gotestyourself-with-tools
Update gotestyourself to gotest.tools
Upstream-commit: 4cb3c70f36
Component: cli
2018-06-11 14:49:20 +02:00
1a5dac4574 build: error out if buildkit is on and stdin is used for both dockerfile and context
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 89e102474c
Component: cli
2018-06-09 20:51:34 +00:00
dcc459a896 build: Add support for using dockerfile from stdin with buildkit
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 5314a8fc06
Component: cli
2018-06-09 20:51:34 +00:00
0565bb3955 build: Add support for using context from stdin with buildkit
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: e0b3921a03
Component: cli
2018-06-09 20:51:34 +00:00
2dccbba621 build: use a separate upload request for early progress
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 8cf213bd0c
Component: cli
2018-06-09 20:51:34 +00:00
1d7ec4c7d5 system: add buildcache formatting
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: b19294ee42
Component: cli
2018-06-09 20:51:34 +00:00
f1e0dd5b11 build: basic buildkit progress support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 0f97642915
Component: cli
2018-06-09 20:51:34 +00:00
a173c54ac8 build: add experimental buildkit base
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 656fe85c74
Component: cli
2018-06-09 20:51:30 +00:00
3c1e80ab62 Merge pull request #1116 from vdemeester/vendor-bump-moby
Bump moby version (and its dependencies)
Upstream-commit: 75c1bb1f33
Component: cli
2018-06-08 21:35:58 -07:00
e92ec69f61 Update tests to use gotest.tools 👼
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 2c4de4fb5e
Component: cli
2018-06-08 18:24:26 +02:00
a7c8326a15 Replace gotestyourself by gotest.tools
github.com/gotestyourself/gotestyourself moved to gotest.tools with
version 2.0.0. Moving to that one, bumping it to v2.1.0.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: dd9478a1f7
Component: cli
2018-06-08 18:23:38 +02:00
d697e2a9fb Bump mergo to v0.3.5
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 48ed659bc6
Component: cli
2018-06-08 17:15:12 +02:00
17705eb1b4 Fix #1113 "Segfault on --help with --tlsverify if no ca certificate is present"
Errors were not checked while initializing the docker client in the help command

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Upstream-commit: f4b0780e20
Component: cli
2018-06-08 16:14:48 +02:00
bfd82b2547 Bump moby version (and its dependencies)
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: b1065767cd
Component: cli
2018-06-08 11:26:10 +02:00
5ea7988613 Mark @thajeztah as a MAINTAINER…
… discovered recently that our very own Sebastiaan was not even listed
in the maintainers, so fixing this mistake !

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 9fda91bed4
Component: cli
2018-06-07 19:52:40 +02:00
61e3e1ddea Merge pull request #1104 from vdemeester/show-me-your-secret
Add more example to the full-example tests
Upstream-commit: 90f8ce8a5d
Component: cli
2018-06-05 16:44:06 +02:00
9bf4d4a535 Merge pull request #948 from simonferquel/k8s-watch-stack-status
K8s: more robust stack error detection on deploy
Upstream-commit: eaa9149e29
Component: cli
2018-06-04 10:42:42 +02:00
d9ce9238d8 Merge pull request #1106 from silvin-lubecki/fix-orchestrator-flag-persistent
Add a "top-level" annotation to hide persistent flags
Upstream-commit: 2014e991ee
Component: cli
2018-06-01 23:32:40 +02:00
0e64c4ed59 Merge pull request #1105 from vdemeester/1044-compress-stream-friend
Fix panics when --compress and --stream are used together
Upstream-commit: d1cc8c731e
Component: cli
2018-06-01 23:00:01 +02:00
a87a3769f8 Fix panics when --compress and --stream are used together
Warns that `-compress` has no effect when used together with the
expremintal `--stream` flag.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 8b3dc39fce
Component: cli
2018-06-01 18:34:00 +02:00
d1ccf01fd1 Merge pull request #1101 from silvin-lubecki/filter-stack-service
Fix service filtering by name on Kubernetes
Upstream-commit: 7db15a4553
Component: cli
2018-06-01 15:50:34 +02:00
6f7cfb3c58 Merge pull request #1094 from thaJeztah/hide_checkpoint_on_windows
Hide experimental checkpoint features on Windows
Upstream-commit: 63ad0a0e88
Component: cli
2018-06-01 15:49:51 +02:00
2d6b52f5ec Merge pull request #1097 from vdemeester/x-objects
Allow `x-*` extension on 3rd level objects
Upstream-commit: eb54d3e5c0
Component: cli
2018-06-01 15:48:04 +02:00
14b4abdabd Fix service filtering by name on Kubernetes to mimic Swarm filtering
*  Kubernetes native filtering (server side) is an exact match, now filtering on name is made client-side to add prefix-matching

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Upstream-commit: b1ff199167
Component: cli
2018-06-01 15:43:02 +02:00
cc8e8442e8 Added a "top-level" annotation to hide persistent flags in all sub-commands, excepting some specific commands, while printing help
Fixes issue #1099

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Upstream-commit: c003ed1f35
Component: cli
2018-06-01 15:13:40 +02:00
fd04115881 Add more example to the full-example tests
Configs and Secrets were note present, some labels on volumes and
networks too.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 55426d9396
Component: cli
2018-06-01 14:16:18 +02:00
a76ed6f917 YAML docs: add os_type property on flags and (sub)commands
This patch adds an `os_type` property in the generated YAML docs, both for
commands, and for flags;

Note that the ostype annotation on flags can have multiple values set,
however, multiple values are currently not used (and unlikely will).

To simplify usage of the os_type property in the YAML, and for consistency with
the same property for commands, we're only using the first ostype that's set.

```yaml
command: docker checkpoint create
short: Create a checkpoint from a running container
long: Create a checkpoint from a running container
usage: docker checkpoint create [OPTIONS] CONTAINER CHECKPOINT [flags]
pname: docker checkpoint
plink: docker_checkpoint.yaml
options:
- option: checkpoint-dir
  value_type: string
  description: Use a custom checkpoint storage directory
  deprecated: false
  experimental: false
  experimentalcli: false
  kubernetes: false
  swarm: false
- option: leave-running
  value_type: bool
  default_value: "false"
  description: Leave the container running after checkpoint
  deprecated: false
  experimental: false
  experimentalcli: false
  kubernetes: false
  swarm: false
deprecated: false
min_api_version: "1.25"
experimental: true
experimentalcli: false
kubernetes: false
swarm: false
os_type: windows
```

```yaml
command: docker container start
short: Start one or more stopped containers
long: Start one or more stopped containers
usage: docker container start [OPTIONS] CONTAINER [CONTAINER...] [flags]
pname: docker container
plink: docker_container.yaml
options:
- option: attach
  shorthand: a
  value_type: bool
  default_value: "false"
  description: Attach STDOUT/STDERR and forward signals
  deprecated: false
  experimental: false
  experimentalcli: false
  kubernetes: false
  swarm: false
- option: checkpoint
  value_type: string
  description: Restore from this checkpoint
  deprecated: false
  experimental: true
  experimentalcli: false
  kubernetes: false
  swarm: false
  os_type: linux
- option: checkpoint-dir
  value_type: string
  description: Use a custom checkpoint storage directory
  deprecated: false
  experimental: true
  experimentalcli: false
  kubernetes: false
  swarm: false
  os_type: linux
- option: detach-keys
  value_type: string
  description: Override the key sequence for detaching a container
  deprecated: false
  experimental: false
  experimentalcli: false
  kubernetes: false
  swarm: false
- option: interactive
  shorthand: i
  value_type: bool
  default_value: "false"
  description: Attach container's STDIN
  deprecated: false
  experimental: false
  experimentalcli: false
  kubernetes: false
  swarm: false
deprecated: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: be035a0272
Component: cli
2018-05-31 22:31:31 +02:00
ee64293c17 Mark checkpoint feature as Linux-only, and homogenize error messages
This patch adds annotations to mark the checkpoint commands as Linux only, which
hides them if the daemon is running a non-matching operating-system type;

Before:

    docker

    Usage:	docker COMMAND

    A self-sufficient runtime for containers

    ...

    Management Commands:
      config      Manage Docker configs
      container   Manage containers
      image       Manage images

After:

    docker

    Usage:	docker COMMAND

    A self-sufficient runtime for containers

    ...

    Management Commands:
      checkpoint  Manage checkpoints
      config      Manage Docker configs
      container   Manage containers
      image       Manage images

This change also prints errors when attempting to use checkpoint commands or
flags if the feature is not supported by the Daemon's operating system;

    $ docker checkpoint --help
    docker checkpoint is only supported on a Docker daemon running on linux, but the Docker daemon is running on windows

    $ docker checkpoint create --help
    docker checkpoint create is only supported on a Docker daemon running on linux, but the Docker daemon is running on windows

    $ docker checkpoint ls --help
    docker checkpoint ls is only supported on a Docker daemon running on linux, but the Docker daemon is running on windows

    $ docker checkpoint rm --help
    docker checkpoint rm is only supported on a Docker daemon running on linux, but the Docker daemon is running on windows

    $ docker container start --checkpoint=foo mycontainer
    "--checkpoint" requires the Docker daemon to run on linux, but the Docker daemon is running on windows

    $ docker container start --checkpoint-dir=/foo/bar mycontainer
    "--checkpoint-dir" requires the Docker daemon to run on linux, but the Docker daemon is running on windows

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 1df6b68111
Component: cli
2018-05-31 22:25:06 +02:00
0e3e1012ac Allow x-* extension on 3rd level objects
As for top-level key, any 3rd-level key which starts with `x-` will be
ignored by compose. This allows for users to:
* include additional metadata in their compose files
* create YAML anchor objects that can be re-used in other parts of the config

This matches a similar feature in the swagger spec definition:
https://swagger.io/specification/#specificationExtensions

This means a composefile like the following is valid

```
verison: "3.7"
services:
  foo:
    image: foo/bar
    x-foo: bar
network:
  bar:
    x-bar: baz
```

It concerns services, volumes, networks, configs and secrets.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 6bcfa8806c
Component: cli
2018-05-31 13:38:58 +02:00