Commit Graph

826 Commits

Author SHA1 Message Date
Tibor Vass 3e8c41beb0 build: update session support detection
Avoid testing for session support in non-buildkit builder to support
servers that falsely report as `1.39` compatible

Signed-off-by: Tibor Vass <tibor@docker.com>
2018-10-22 20:52:56 +00:00
Sebastiaan van Stijn 2e385015f7
Merge pull request #1451 from tiborvass/builder-prune-filter-unused-for
builder/prune: rename max-age filter to unused-for in help output
2018-10-17 17:55:44 +02:00
Brian Goff a2a7a7cc00
Merge pull request #1443 from acmcodercom/defaulttcpschema
fixes #1441 set default schema to tcp for docker host
2018-10-16 20:58:11 -07:00
Tibor Vass c9ce6dc656 builder/prune: rename max-age filter to unused-for in help output
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-10-17 00:35:10 +00:00
Lifubang beed8748c0 add test case TestNewAPIClientFromFlagsForDefaultSchema
Signed-off-by: Lifubang <lifubang@acmcoder.com>
2018-10-16 15:34:54 +08:00
Lifubang 2431dd1448 set default schema to tcp for docker host
Signed-off-by: Lifubang <lifubang@acmcoder.com>
2018-10-16 10:32:03 +08:00
Lifubang 99f336a580 err message improve when ssh fail
Signed-off-by: Lifubang <lifubang@acmcoder.com>
2018-10-15 16:42:14 +08:00
Sebastiaan van Stijn b9a1a21fe2
Merge pull request #1426 from kolyshkin/go111-pr1316
Bump Go to 1.11.1
2018-10-11 20:19:20 +02:00
Kir Kolyshkin 906c2d161a gofmt with go-1.11
gofmt/goimports changed some heuristics in 1.11 and the code is now
formatted slightly differently.

No functional change, just whitespace.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-10-11 01:54:38 -07:00
Kir Kolyshkin 51848bf3bb cli/registry: fix a Debugf statement
Fix this warning from go-1.11

> cli/registry/client/fetcher.go:234: Debugf format %s has arg
> repoEndpoint of wrong type client.repositoryEndpoint

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-10-11 01:13:13 -07:00
Tibor Vass bbd01fe3df build: only show buildkit-specific flags if buildkit is enabled
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-10-10 21:09:22 +00:00
Tibor Vass ab50c2f2b2
Merge pull request #1419 from AkihiroSuda/dfssh
build: add SSH agent socket forwarder (`docker build --ssh $SSHMOUNTID=$SSH_AUTH_SOCK`)
2018-10-09 13:43:27 -07:00
Li Yi 814ced4b30 Using strings.Builder instead of string appending
Signed-off-by: Li Yi <denverdino@gmail.com>
2018-10-09 10:38:21 +08:00
Akihiro Suda db7399a016 build: add SSH agent socket forwarder (`docker build --ssh $SSHMOUNTID=$SSH_AUTH_SOCK`)
Unlike `docker build --secret`, `docker build --ssh` allows the build container to
use SSH keys with passphrases.

  $ eval $(ssh-agent)
  $ ssh-add ~/.ssh/id_rsa
  (Input your passphrase here)
  $ docker build --ssh default=$SSH_AUTH_SOCK ...

This feature requires the daemon with `CapExecMountSSH` build capability (moby/moby#37973) .

Currently, the official Dockerfile frontend does not provide the syntax for using the SSH forwarder.

However, the experimental `RUN --mount=type=ssh` syntax can be enabled by using
the Dockerfile frontend image built with the `BUILDTAGS="dfrunmount dfssh"`, via the `# syntax =` "shebang".

The Dockerfile for the Dockerfile frontend is available at  github.com/moby/buildkit/frontend/dockerfile/cmd/dockerfile-frontend)
The pre-built image is also available as `tonistiigi/dockerfile:ssh20181002` .

An example Dockerfile with `RUN --mount=type=ssh`:

  # syntax = tonistiigi/dockerfile:ssh20181002
  FROM alpine
  RUN apk add --no-cache openssh-client
  RUN mkdir -p -m 0700 ~/.ssh && ssh-keyscan gitlab.com >> ~/.ssh/known_hosts
  RUN --mount=type=ssh ssh git@gitlab.com | tee /hello
  # "Welcome to GitLab, @GITLAB_USERNAME_ASSOCIATED_WITH_SSHKEY" should be printed here

More info available at moby/buildkit#608, moby/buildkit#655

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-10-05 19:56:32 +09:00
Akihiro Suda 846c38cbd7 bump up buildkit
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-10-05 18:14:03 +09:00
Sebastiaan van Stijn 608b6632b0
Merge pull request #1407 from mindaugasrukas/transform
Allow to transform any source type into the target struct
2018-10-03 10:06:32 +02:00
Daniel Hiltgen a4aba23b85
Remove unused helath check func
During the refactoring for 18.09 the activate/update flows no longer
restart the engine explicitly but let the user do that when they're ready,
so the health check logic is no longer required.

Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
(cherry picked from commit f2b2061cc3)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-10-02 20:52:34 +02:00
Mindaugas Rukas 83fd688fa2 Allow to transform any source type into the target struct
Signed-off-by: Mindaugas Rukas <momomg@gmail.com>
2018-10-02 16:06:08 +03:00
Daniel Hiltgen 4a888d3031 Refine how metadata dir is handled
This is a follow up PR to #1381 to address some of the review comments
we didn't get to.

Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
(cherry picked from commit c12e23a4c1)
Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
2018-10-01 14:28:11 -07:00
Andrew Hsu d7ae94b885 use gotest.tools/fs for TestActivateExpiredLicenseDryRun
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
(cherry picked from commit a7488d1bcd)
Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
2018-09-28 14:50:52 -07:00
Daniel Hiltgen d486baebfc Expose licensing details before loading
Help the user understand which license they're about
to load in case they have multiple licenses they need to
figure out.

Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
(cherry picked from commit 5a97a93ae1)
Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
2018-09-28 14:37:02 -07:00
Tõnis Tiigi 00c0c7e12f
Merge pull request #1345 from AkihiroSuda/fix-kill-warning
connhelper: try sending SIGTERM before SIGKILL
2018-09-28 08:22:13 -07:00
Sebastiaan van Stijn 3e4e232e0d
Merge pull request #1195 from olljanat/34795-npipe-mount-type
Allow npipe volume type on stack file
2018-09-28 10:57:09 +02:00
Olli Janatuinen 0704d9a031 Allow npipe volume type on stack file
Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
2018-09-27 18:47:20 +03:00
Silvin Lubecki 7d313cf865
Merge pull request #1385 from dhiltgen/revamp_master
Forward port #1381 to master
2018-09-26 15:29:33 +02:00
Sebastiaan van Stijn ec3daea021
Fix substitution with non-empty env-var
Due to a typo, substitution would not work if the given
environment-variable was set.

Given the following docker compose file;

```yaml
version: "3.7"

services:
  app:
    image: nginx:${version:-latest}
```

Deploying a stack with `$version` set would ignore the `$version`
environment variable, and use the default value instead;

```bash
version=alpine docker stack deploy -c docker-compose.yml foobar

Creating network foobar_default
Creating service foobar_app

docker service ls

ID                  NAME                MODE                REPLICAS            IMAGE               PORTS
rskkjxe6sm0w        foobar_app          replicated          1/1                 nginx:latest
```

This patch also fixes "soft default" not detecting empty environment variables,
only non-set environment variables.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-09-25 22:20:25 +02:00
Daniel Hiltgen 2f23c97d17 Fix lint glitches
Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
(cherry picked from commit 6004d74b1f)
Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
2018-09-21 15:43:28 -07:00
Daniel Hiltgen b7ec4a42d9 Review comments
Address code review comemnts and purge additional dead code.

Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
(cherry picked from commit f250152bf4)
Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
2018-09-21 15:43:00 -07:00
Daniel Hiltgen f07f51f4c8 Refined engine implementations
Adapt the CLI to the host install model for 18.09.

Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
(cherry picked from commit 342afe44fb)
Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
2018-09-21 15:41:25 -07:00
Michael Crosby eacb812c26 Install binaries on host for upgrade
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit cfec8027ed)
Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
2018-09-21 15:40:35 -07:00
Vincent Demeester 54c19e67f6
Merge pull request #1378 from clnperez/manifest-inspect-insecure-fix
fix insecure manifest inspect with restrictive certs perms
2018-09-20 18:57:30 +02:00
Christy Norman d57adbc034 fix insecure manifest inspect with restrictive certs perms
If, for some reason, the certs directory has permissions that are
inaccessible by docker, we should still be able to fetch manifests using
the `insecure` flag.

Since the cli doesn't access the engine's list of insecure registries,
the registry client should make a singleton list of the registry being queried with the
`insecure` flag.

Closes #1358

Signed-off-by: Christy Norman <christy@linux.vnet.ibm.com>
2018-09-20 10:51:29 -05:00
Arash Deshmeh e9dc2293b1 refactor stack list command unit tests to table-driven
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-09-19 22:13:03 -04:00
Arash Deshmeh fc1e11d46a 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>
2018-09-18 12:30:49 -04:00
Sebastiaan van Stijn b4180e8757
Merge pull request #1371 from jhowardmsft/jjh/importlcow
LCOW: --platform on import (already in API)
2018-09-14 13:00:20 +02:00
Tibor Vass a90b99edfc system/df: allow -v with --format
This allows to provide more information for build cache disk usage.

Signed-off-by: Tibor Vass <tibor@docker.com>
2018-09-13 23:14:58 +00:00
John Howard b55a0b681f LCOW: --platform on import (already in API)
Signed-off-by: John Howard <jhoward@microsoft.com>
2018-09-13 15:04:04 -07:00
Sebastiaan van Stijn 1921a6c051
Merge pull request #1354 from nashasha1/fix/some-typo
Fix some typo
2018-09-12 14:53:38 +02:00
Sebastiaan van Stijn bd906df601
Merge pull request #1352 from Lihua93/fix/typo
Typo fix
2018-09-12 14:28:05 +02:00
Sebastiaan van Stijn 82dff32bb4
Merge pull request #1362 from vdemeester/engine-only-linux
Add `docker engine` commands only on Linux…
2018-09-11 16:52:01 +02:00
Silvin Lubecki 2eb9b0cba2
Merge pull request #1361 from vdemeester/contains-containerized
Remove containerizedengine package dependency from docker/cli/command…
2018-09-11 15:54:13 +02:00
Vincent Demeester a3a955f204
Add `docker engine` commands only on Linux…
… this is, for now, the only platform that is supported

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-09-11 15:23:22 +02:00
Vincent Demeester 2d344b2f61
Remove containerizedengine package dependency from docker/cli/command…
… this removes a whole lot of dependencies from people depending on docker/cli…

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-09-11 14:46:30 +02:00
Sebastiaan van Stijn 11ef349c58
Merge pull request #1326 from shin-/compose-json-annotations
Allow marshalling of Compose config to JSON
2018-09-11 14:40:21 +02:00
Benoit Sigoure 7e9e2c10bc cli/config/configfile: Atomically rewrite the config file when saving.
The config file was being truncated first, which created a window during
which it was empty, causing concurrent uses of the `docker` command to
potentially fail with:
  WARNING: Error loading config file: /var/lib/jenkins/.docker/config.json: EOF
  Error response from daemon: Get https://registry/v2/foo/manifests/latest: no basic auth credentials

Signed-off-by: Benoit Sigoure <tsunanet@gmail.com>
2018-09-10 13:43:24 -07:00
Joffrey F e7788d6f9a Allow marshalling of Compose config to JSON
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-09-10 11:16:05 -07:00
Xiaodong Zhang f8e04011e4 Fix some typo
Signed-off-by: Xiaodong Zhang <a4012017@sina.com>
2018-09-07 17:18:00 +08:00
Akihiro Suda acbb0eb6da connhelper: try sending SIGTERM before SIGKILL
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-09-07 18:13:35 +09:00
Lihua Tang ca5e453180 Typo fix
Signed-off-by: Lihua Tang <lhtang@alauda.io>
2018-09-07 13:28:02 +08:00
Akihiro Suda a22853e64d connhelper: fix cmd.Wait() race
Fix #1336

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-09-06 01:28:50 +09:00