Compare commits

...

1155 Commits

Author SHA1 Message Date
6a2c058cd8 Merge pull request #357 from jose-bigio/17.12_version
[17.12] bump version to 17.12-ce-rc4
2017-12-20 09:41:32 -06:00
6819d0ec05 Merge pull request #361 from jose-bigio/17.12_chng_log
[17.12] update changelog for 17.12.0-ce-rc4
2017-12-20 09:41:07 -06:00
740d71bf6a Merge pull request #367 from seemethere/cherry_pick_engine_35812
[17.12] daemon, plugin: follow containerd namespace conventions
2017-12-20 09:40:27 -06:00
b6799f808c update changelog for 17.12.0-ce-rc4
Signed-off-by: jose-bigio <jose.bigio@docker.com>
2017-12-19 16:32:03 -08:00
f8b1976d4c daemon, plugin: follow containerd namespace conventions
Follow the conventions for namespace naming set out by other projects,
such as linuxkit and cri-containerd. Typically, they are some sort of
host name, with a subdomain describing functionality of the namespace.
In the case of linuxkit, services are launched in `services.linuxkit`.
In cri-containerd, pods are launched in `k8s.io`, making it clear that
these are from kubernetes.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
(cherry picked from commit 521e7eba86df25857647b93f13e5366c554e9d63)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2017-12-19 23:56:30 +00:00
aad5f42ada Merge pull request #366 from seemethere/cherry_pick_engine_35805
[17.12] Ensure containers are stopped on daemon startup
2017-12-19 16:49:04 -06:00
59c59ce2f5 Merge pull request #365 from seemethere/bump_swarmkit_17_12
[17.12] bump swarmkit to 7598f7a
2017-12-19 12:26:45 -08:00
65b3c804b5 Ensure containers are stopped on daemon startup
When the containerd 1.0 runtime changes were made, we inadvertantly
removed the functionality where any running containers are killed on
startup when not using live-restore.
This change restores that behavior.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit e69127bd5ba4dcf8ae1f248db93a95795eb75b93)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2017-12-19 20:23:41 +00:00
fcbcbec6b1 Merge pull request #362 from thaJeztah/17.12-backport-fix_container_zombies
[17.12] backport fix container zombies
2017-12-19 10:37:49 -08:00
ee3330bc06 Merge pull request #360 from thaJeztah/17.12-backport-33107
[17.12] Windows: Case-insensitive filename matching against builder cache
2017-12-19 10:35:44 -08:00
ddc114ea2b Merge pull request #358 from thaJeztah/17.12-backport-docs-and-completion
[17.12] backport docs and completion
2017-12-19 10:34:37 -08:00
52f2c25c69 bump swarmkit to 7598f7a
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2017-12-19 18:11:40 +00:00
7f829d4736 Merge pull request #359 from thaJeztah/17.12-backport-image-shortid
[17.12] Remove support for referencing images by 'repository:shortid'
2017-12-18 14:30:45 -08:00
332e30b02e Fix some missing synchronization in libcontainerd
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 647cec4324186faa3183bd6a7bc72a032a86c8c9)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-16 01:22:18 -08:00
0a4c60553a Fix error handling for kill/process not found
With the contianerd 1.0 migration we now have strongly typed errors that
we can check for process not found.
We also had some bad error checks looking for `ESRCH` which would only
be returned from `unix.Kill` and never from containerd even though we
were checking containerd responses for it.

Fixes some race conditions around process handling and our error checks
that could lead to errors that propagate up to the user that should not.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit e55bead518e4c72cdecf7de2e49db6c477cb58eb)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-16 01:22:06 -08:00
b827146463 Fix #512 Bash autocompletion works incorrect with inspect
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit a2d0b6e122)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-15 13:41:14 -08:00
2802af349a Windows: Case-insensitive filename matching against builder cache
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit 7caa30e8937b65ad9fd61a8b811bba470d22809f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-15 02:05:31 -08:00
0ba5b1beec Updated deprecation status for "repository:shortid"
The `repository:shortid` syntax for referencing images is very little used,
collides with with tag references can be confused with digest references.

The `repository:shortid` notation was deprecated in Docker 1.13, and scheduled
for removal in Docker 17.12.

This patch updates the deprecation status for this feature.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 1a21ca12a6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-15 01:41:00 -08:00
e4e75fe503 Remove support for referencing images by 'repository:shortid'
The `repository:shortid` syntax for referencing images is very little used,
collides with with tag references can be confused with digest references.

The `repository:shortid` notation was deprecated in Docker 1.13 through
5fc71599a0b77189f0fedf629ed43c7f7067956c, and scheduled for removal
in Docker 17.12.

This patch removes the support for this notation.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a942c92dd77aff229680c7ae2a6de27687527b8a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-15 01:40:50 -08:00
b63dd43fb3 Add support for generic resources to bash completion
Adds bash completion for
- `service create --generic-resource`
- `service update --generic-resource-(add|rm)`
- `dockerd --node-generic-resource`

Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 8ec80eec67)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-15 01:09:47 -08:00
c01b9b9177 Fixed #750
Signed-off-by: Kotaro Yoshimatsu <kotaro.yoshimatsu@gmail.com>
(cherry picked from commit db05d8ad79)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-14 20:28:06 -08:00
03845511e3 Fix "on-failure" restart policy being documented as "failure"
Commit ddadd3db49 refactored
the markdown documentation, but accidentally changed
`on-failure` to `failure`.

This patch corrects this change.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 43217d7332)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-14 20:27:57 -08:00
13ce294474 bump version to 17.12-ce-rc4
Signed-off-by: jose-bigio <jose.bigio@docker.com>
2017-12-14 12:11:37 -08:00
80c8033ede Merge pull request #353 from jose-bigio/17.12_version
[17.12] Bump version to 17.12.0-ce-rc3
2017-12-13 16:35:33 -08:00
5a77b12973 Merge pull request #355 from jose-bigio/17.12_changelog
[17.12] update changelog for 17.12.0-ce-rc3
2017-12-13 16:35:15 -08:00
df19150f28 update changelog for 17.12.0-ce-rc3
Signed-off-by: jose-bigio <jose.bigio@docker.com>
2017-12-13 16:32:57 -08:00
3083961ff0 Merge pull request #356 from jose-bigio/17.12_backport_network_partition
[17.12] backport network partition to 7dd202d11b2078c063fefc614c9fb9e4615da0e1
2017-12-13 16:31:06 -08:00
b18ab30d0e Merge pull request #352 from thaJeztah/17.12-docs-cherry-picks
[17.12] docs cherry picks
2017-12-13 16:17:41 -08:00
c69b9c5296 Merge pull request #350 from thaJeztah/17.12-backport-use-commit-instead-of-version
[17.12] Use commit-sha instead of tag for containerd
2017-12-13 16:06:51 -08:00
6eb0519584 Merge pull request #349 from thaJeztah/17.12-backport-disallow-v1-registries
[17.12] Disallow using legacy (V1) registries
2017-12-13 16:03:59 -08:00
a6dd5c1211 Bump libnetwork to 7dd202d11b2078c063fefc614c9fb9e4615da0e1
Signed-off-by: jose-bigio <jose.bigio@docker.com>
2017-12-13 15:15:19 -08:00
0b9f58dd38 bump version to 17.12-ce-rc3
Signed-off-by: jose-bigio <jose.bigio@docker.com>
2017-12-13 13:10:05 -08:00
d191b0309f Merge pull request #351 from thaJeztah/17.12-backport-35613-update-go-gelf-v2-for-bugfix
[17.12] backport 35613 update go gelf v2 for bugfix
2017-12-13 13:00:13 -08:00
a8731dffeb Merge pull request #348 from thaJeztah/17.12-backport-compose-add-name-to-network
[17.12] Fix external networks
2017-12-13 12:56:10 -08:00
a77efd829e Fix anchors to "Storage driver options"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 630f8b1254)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-13 09:58:33 -08:00
7b688ab54a Correct references to --publish long syntax in docs
This is the same issue as described at docker/docker.github.io#5370

Signed-off-by: Lachlan Cooper <lachlancooper@gmail.com>
(cherry picked from commit 90f44e564b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-13 09:58:25 -08:00
228adfcd40 Update docs and completion-scripts for deprecated features
- the `--disable-legacy-registry` daemon flag was removed
- duplicate keys with conflicting values for engine labels
  now produce an error instead of a warning.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a119e39f0c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-13 09:56:01 -08:00
02f4c4289a Update Graylog2/go-gelf vendoring. Fixes #35613
Signed-off-by: Ghislain Bourgeois <ghislain.bourgeois@gmail.com>
(cherry picked from commit f9f3c49302fc80e586e3cb10af43114929556b47)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-12 16:41:18 -08:00
f4f23ddb6b Fix vendoring of go-gelf to point to specific commit ID
Signed-off-by: Ghislain Bourgeois <ghislain.bourgeois@gmail.com>
(cherry picked from commit 5bc11021250e39e71ca9edf62ce5c33f15c3756f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-12 16:41:11 -08:00
ae0095d51f Use commit-sha instead of tag for containerd
The `docker info` command compares the installed version
of containerd using a Git-sha. We currently use a tag for
this, but that tag is not returned by the version-API of
containerd, resulting in the `docker info` output to show:

    containerd version: 89623f28b87a6004d4b785663257362d1658a729 (expected: v1.0.0)

This patch changes the `v1.0.0` tag to the commit that
corresponds with the tag, so that the `docker info` output
does not show the `expected:` string.

This should be considered a temporary workaround; the check
for the exact version of containerd that's installed was needed
when we still used the 0.2.x branch, because it did not have
stable releases yet.

With containerd reaching 1.0, and using SemVer, we can likely
do a comparison for "Major" version, or make this a "packaging"
issue, and remove the check entirely (we can still _print_ the
version that's installed if we think it's usefule).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 2c8018f4bd7f48bf8f35770dea68f81b9591bb58)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-12 16:36:49 -08:00
0d895d041d Disallow using legacy (V1) registries
Interacting with v1 registries was deprecated in Docker 1.8.3, disabled by default
in Docker 17.06, and scheduled for removal in Docker 17.12.

This patch disallows enabling V1 registry through the `--disable-legacy-registry`
option, and the `"disable-legacy-registry": false` option in the daemon configuration
file. The actual V1 registry code is still in place, and will be removed separately.

With this patch applied:

    $ dockerd --disable-legacy-registry=false
    ERROR: The '--disable-legacy-registry' flag has been removed. Interacting with legacy (v1) registries is no longer supported

Or, when setting through the `daemon.json` configuration file

    $ mkdir -p /etc/docker/
    $ echo '{"disable-legacy-registry":false}' > /etc/docker/daemon.json
    $ dockerd
    ERROR: The 'disable-legacy-registry' configuration option has been removed. Interacting with legacy (v1) registries is no longer supported

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 8d6df8a0addc9a37b48c5a1827dd3f65f2ed57cf)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-11 19:37:11 -08:00
29cb745e30 Fix external networks
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 9da2602f38)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-11 19:33:06 -08:00
f9cde631a2 Merge pull request #347 from seemethere/cherry_pick_packaging_70
[17.12] Pass VERSION to engine static builds
2017-12-11 16:20:25 -08:00
264ab31364 Pass VERSION to engine static builds
VERSION file does not exist anymore for moby/moby so we need to
compensate

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
(cherry picked from commit c411321b8870101c227b03e64930260984c862fd)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2017-12-12 00:17:04 +00:00
5d7e8f3778 Merge pull request #345 from jose-bigio/17.12_bump
[17.12] Bump version to 17.12.0-ce-rc2
2017-12-11 13:34:57 -08:00
74e076ab06 Merge pull request #346 from jose-bigio/17.12_changelog
[17.12] update changelog for 17.12.0 rc2
2017-12-11 13:34:26 -08:00
184c27d785 Merge pull request #342 from thaJeztah/17.12-backport-vendor-archive
[17.12] vendor: update archive/tar
2017-12-11 13:32:05 -08:00
33d771ed94 Update to 17.12 changelog for rc2
Signed-off-by: jose-bigio <jose.bigio@docker.com>
2017-12-11 11:27:18 -08:00
50e759c017 Bump version to 17.12.0-ce-rc2
Signed-off-by: jose-bigio <jose.bigio@docker.com>
2017-12-11 10:34:24 -08:00
bde1eb8281 Merge pull request #340 from seemethere/cherry_pick_version_packaging
[17.12] Defaults Makefile VERSION variable to 0.0.0-dev
2017-12-11 10:08:35 -08:00
fb8384a555 Merge pull request #343 from thaJeztah/17.12-backport-update-api-changelog
[17.12] Update API version-history for 1.35
2017-12-08 20:46:27 -08:00
86127edfd5 Merge pull request #341 from seemethere/cherry_pick_fix_f27
[17.12] Do not terminate on missing build-ids
2017-12-08 20:15:20 -08:00
d2b3575a03 Merge pull request #344 from andrewhsu/tt
[17.12] skip DockerTrustSuite tests for 17.12
2017-12-08 18:00:29 -08:00
d256539bf4 update integration-cli tests for stderr output
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
(cherry picked from commit 250b84ee88)
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2017-12-08 16:49:02 -08:00
fbfecebc0a Blacklist tests, will be rewritten later on
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
(cherry picked from commit 4e81e4fa4e)
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
(cherry picked from commit ec6b0a1a4a)
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2017-12-08 16:49:01 -08:00
f73a0ff35c Update API version-history for 1.35
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 8a9d926b553345be530ddc51374c9817fcbea784)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-07 16:21:40 -08:00
5f5c42593a vendor: update archive/tar
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 13954b0a6282d919c91626a23967377c19ee7aa2)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-07 16:20:52 -08:00
fcde1eb2b7 Do not terminate on missing build-ids
Relates to an upgrade in `rpm` to `14.4.0`, where missing build-ids now
cause builds to self-terminate. May be needed in other distros if/when
the `rpm` package is updated in those repos.

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
(cherry picked from commit dcd681da54f2c2b2286cc09d053dd6cb865d3f98)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2017-12-08 00:11:46 +00:00
b52085fc2e Defaults Makefile VERSION variable to 0.0.0-dev (#67)
When building we should default to a dummy version unless otherwise
specified so we don't get ourselves confused over what is official and
what is not.

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
(cherry picked from commit ffcd040b5c3bd4f81e1d1f11c32f9bb81e235ed1)

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2017-12-07 22:58:01 +00:00
ee2f9437b6 Merge pull request #337 from andrewhsu/v12
[17.12] bump version to 17.12.0-ce-rc1
2017-12-06 23:33:02 -08:00
8e51e59c8a bump version to 17.12.0-ce-rc1
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2017-12-06 23:29:37 -08:00
a4b9862912 Merge pull request #335 from vieux/CHANGELOG-17.12
[17.12] add changelog for 17.12.0-ce-rc1
2017-12-06 22:50:06 -08:00
718cc1a071 changelog for 17.12.0-ce-rc1
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2017-12-06 22:48:27 -08:00
704b884e52 Merge component 'engine' from git@github.com:moby/moby master 2017-12-07 02:18:48 +00:00
521d1c4f0b Merge component 'cli' from git@github.com:docker/cli master 2017-12-07 01:55:54 +00:00
9b5e4afbf7 Merge pull request #35698 from anshulpundir/vndr
Vendor swarmkit to 4429c763
Upstream-commit: a023a599913439f0a08adffc3f242ce187fd8bdd
Component: engine
2017-12-06 17:53:46 -08:00
c6d5cb9ce0 Merge pull request #35589 from keloyang/close-fd
Close pipe in chrootarchive.invokeUnpack when cmd.Start()/json.NewEncoder failed
Upstream-commit: cefb33700cf0931a6e3f9ea2cb0a122148d10e49
Component: engine
2017-12-06 17:48:02 -08:00
d7a82cda3b Merge pull request #736 from tiborvass/platform-version
Add platform and its components to docker version output
Upstream-commit: ace5417954
Component: cli
2017-12-06 17:31:05 -08:00
b8234e6bfc Sort component details in template
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 7138d6e301
Component: cli
2017-12-07 02:04:10 +01:00
aa9a4c4bff Add platform and its components to docker version output
The Server section of version output is now composed of an Engine
component and potentially more, based on what the /version endpoint
returns.

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 5f4c5f8bb6
Component: cli
2017-12-07 02:04:10 +01:00
29d0c2b494 vendor moby api to get new version types
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: fe3941af7d
Component: cli
2017-12-07 02:04:10 +01:00
96784302eb Merge pull request #35705 from tiborvass/platform-version
api: generalize version information to any platform component
Upstream-commit: a1be987ea9e03e5ebdb1b415a7acdd8d6f0aaa08
Component: engine
2017-12-06 16:43:38 -08:00
6046d5cbe8 Merge pull request #35677 from fcrisciani/netdb-debug-tool
Netdb debug tool
Upstream-commit: 58dec54d1ffef1ac989399acf3b8e107aa55c2a2
Component: engine
2017-12-06 16:30:11 -08:00
c3ea8d4b44 Merge pull request #726 from albers/completion-log-opt-line-only
Add bash completion for `--log-opt line-only`
Upstream-commit: 8053cf67e0
Component: cli
2017-12-06 16:04:26 -08:00
499d1359a4 Merge pull request #730 from BretFisher/729-fix-zsh-node-and-stack-names
Fixing zsh column finding in nodes and stacks.
Upstream-commit: 143f9f0336
Component: cli
2017-12-06 16:03:20 -08:00
00a55a319d Fix windows
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: cb8283a6e95f33a93fab0044ca4306cf468faf8c
Component: engine
2017-12-06 23:23:55 +01:00
947ed56f66 Adjust swagger definitions
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 87ebfa11f66d2109054ad3024217a5101b45aa8c
Component: engine
2017-12-06 23:23:55 +01:00
3916dafe17 api: generalize version information to any platform component
This change adds a Platform struct with a Name field and a general
Components field to the Version API type. This will allow API
consumers to show version information for the whole platform and
it will allow API providers to set the versions for the various
components of the platform.

All changes here are backwards compatible.

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 9152e63290e4a4e586b811cce39082efc649b912
Component: engine
2017-12-06 23:23:55 +01:00
e8e8613267 Merge pull request #35514 from thaJeztah/disable-overlay-without-d_type
Remove support for overlay/overlay2 without d_type
Upstream-commit: bd8a9c25ee257384ca24cf32e61b6b0ef71f521d
Component: engine
2017-12-06 14:13:58 -08:00
9d2c3018e2 Merge pull request #733 from thaJeztah/sync-runc
Bump runc to b2567b37d7b75eb4cf325b77297b140ea686ce8f
Upstream-commit: ddec67c34e
Component: cli
2017-12-06 16:46:33 -05:00
7661258841 Merge pull request #35721 from dnephin/fix-swagger-spec-errors
Fix codegen problems in swagger spec
Upstream-commit: 7f4cf43637067d27a1035d4ff412710ead82bbab
Component: engine
2017-12-06 13:36:52 -08:00
dced91d6f0 Merge pull request #734 from shin-/schema_35_build_shm_size
Add shm_size property to build configuration in Compose schema
Upstream-commit: 4a4db7f20c
Component: cli
2017-12-06 13:35:14 -08:00
02ebcae82d Merge pull request #35146 from masaeedu/27919-removemultitypes
Change multi-type parameters to single type
Upstream-commit: 7db57f7fcac33583403d1d4ccf52b1c27f7e0ad1
Component: engine
2017-12-06 16:22:17 -05:00
da56fc4967 Vendoring netlink library
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
Upstream-commit: 2e75d329773920713e63049ad1a00dfb64abf3c0
Component: engine
2017-12-06 13:19:57 -08:00
8afbe15ccf Vendoring of libnetwork
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
Upstream-commit: c1e1fb6fa5204bb7014ca9ebab9fe1804c1eb957
Component: engine
2017-12-06 13:19:56 -08:00
4d38282082 Add option to enable networkDB debug
Add a new configuration option to allow the enabling
of the networkDB debug. The option is only parsed using the
reload event. This will protect the daemon on start or restart
if the option is left behind in the config file

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
Upstream-commit: a97e45794ea8318a08daf763a5b63b04184a886b
Component: engine
2017-12-06 13:19:47 -08:00
f0f2c2b953 Add missing additionalProperties marker on mount definitions
Signed-off-by: Joffrey F <joffrey@docker.com>
Upstream-commit: 88bbaca294
Component: cli
2017-12-06 12:37:38 -08:00
31d8edcd80 Add shm_size property to build configuration in Compose schema
Signed-off-by: Joffrey F <joffrey@docker.com>
Upstream-commit: e49f14cf36
Component: cli
2017-12-06 12:34:12 -08:00
a505f09c7f Validate/sanitize swarmkit spec name.
Signed-off-by: Anshul Pundir <anshul.pundir@docker.com>
Upstream-commit: 739c4cc6b2bab5c3e27656e0a95d858901ecf6b4
Component: engine
2017-12-06 11:55:04 -08:00
c9781de504 Bump runc to b2567b37d7b75eb4cf325b77297b140ea686ce8f
To match what's used in Moby

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 669b8507be
Component: cli
2017-12-06 11:09:36 -08:00
0aafcdcf36 Merge pull request #732 from ndeloof/8917
closes #8917 introduce `—workdir` option for docker exec
Upstream-commit: 86653f4d57
Component: cli
2017-12-06 10:51:33 -08:00
8f42e63aa7 Merge pull request #711 from dnephin/compose-add-name-to-network
Support network.name in the compose schema
Upstream-commit: 30755cf340
Component: cli
2017-12-06 10:44:03 -08:00
3ef7b79d93 Fix codegen problems in swagger spec
Code generation does't support multiple types

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 3648d883556e59392e3e5a05ef5de1b56b68c6fc
Component: engine
2017-12-06 13:38:45 -05:00
7b947af7df update docker/docker for ExecConfig WorkingDir support
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Upstream-commit: 798ec76223
Component: cli
2017-12-06 19:04:42 +01:00
8f8bda1238 Merge pull request #35708 from schomatis/fix-set-up-dev-env-link
Fix link in Contributing doc
Upstream-commit: d9dbca2e19bde080f9485dc8973e9e6d571e2ee3
Component: engine
2017-12-06 10:04:01 -08:00
378c0c6887 Merge component 'engine' from git@github.com:moby/moby master 2017-12-06 17:04:14 +00:00
4a137d3ed6 Annotate worker option for 1.35 API
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Upstream-commit: 8dc88ea7b5
Component: cli
2017-12-06 17:24:01 +01:00
d02e9392a1 Because the option takes an argument, a special treatment is required in the preceding case
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Upstream-commit: da6b8cb5de
Component: cli
2017-12-06 17:24:01 +01:00
5deca4bbe1 introduce —workdir option for docker exec
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Upstream-commit: 591a1273fd
Component: cli
2017-12-06 17:24:01 +01:00
c898dfbd95 Support network.name in the compose schema.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: d0b8aa7701
Component: cli
2017-12-06 10:05:24 -05:00
928454da48 Merge pull request #35714 from jhhwang4195/master
fixed typo (reliablity -> reliability)
Upstream-commit: 040033b89a201c8bb28fb847db994481d4a7f401
Component: engine
2017-12-06 06:00:54 -06:00
41a5926818 Merge pull request #35661 from ndeloof/8917
introduce `workingdir` option for docker exec
Upstream-commit: 5e5fadb3c0201553929d4a6ea8dc8f9d8a1e56fe
Component: engine
2017-12-06 12:40:25 +01:00
1ffad27f0c Merge pull request #35376 from KingEmet/master
Permit a broader range of errors from mirror endpoints when determining whether to fall back
Upstream-commit: 4055bfb3d3031de7077406ddf0f7e529c47852a9
Component: engine
2017-12-06 01:23:00 -08:00
2990f42efe test case to check « exec » works as expected
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Upstream-commit: 39d5ace6e1c8f3f7a008fcdf328592bfa799a243
Component: engine
2017-12-06 07:42:57 +01:00
8d97955cea Merge pull request #35603 from ericsoderstrom/master
Update docs to reflect working directory name change.
Upstream-commit: a235469f456d6eb869b98c6ede19f2a0763d5580
Component: engine
2017-12-06 10:15:16 +09:00
0ec86524ed fixed typo (reliablity -> reliability)
Signed-off-by: Jihyun Hwang <jhhwang@telcoware.com>
Upstream-commit: 518c50c9b21225ee991d5147cccb687ea8640afc
Component: engine
2017-12-06 09:51:53 +09:00
70c95e6ecb Change TestSwarmServiceTTY to only verify running containers since with swarmkit#b187b24 service deletions/scale-downs don't directly remove the container.
Signed-off-by: Anshul Pundir <anshul.pundir@docker.com>
Upstream-commit: c5c779adc8c207cfb77a9115450f3e4f1783b26e
Component: engine
2017-12-05 14:51:14 -08:00
e96b772de5 Swarmkit vendoring.
Signed-off-by: Anshul Pundir <anshul.pundir@docker.com>
Upstream-commit: 9fdbb32fcee24410c64c7897c0d9667202aa7e4f
Component: engine
2017-12-05 14:27:49 -08:00
52db2af288 Merge component 'engine' from git@github.com:moby/moby master 2017-12-05 22:20:02 +00:00
8024cf3175 Merge pull request #35695 from boucher/upgrade-criu
Update CRIU version in the shell Dockerfile
Upstream-commit: c7dd58ffbf268680653b2905f6cd08a1eaf4d9c8
Component: engine
2017-12-05 15:49:02 -06:00
dfe161a946 Merge pull request #35707 from crosbymichael/ctd-1.0
Update to containerd v1.0.0
Upstream-commit: 7a14e267d6496b4843aca6170876e7cf53d71f58
Component: engine
2017-12-05 14:02:23 -06:00
cf5224adb2 Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2017-12-05 19:13:46 +00:00
8ca0b6eb11 Merge component 'engine' from git@github.com:moby/moby master 2017-12-05 19:13:41 +00:00
9ece0a8dbe Merge pull request #35700 from cpuguy83/plugin_store_rm_test
Add test to check for plugin mounts on remove
Upstream-commit: 27506b353002a2263e753f267e130f133b12c0fc
Component: engine
2017-12-05 10:54:04 -08:00
a394769cf9 Merge component 'cli' from git@github.com:docker/cli master 2017-12-05 18:48:42 +00:00
a369ceccde Merge pull request #724 from dungeonmaster18/723-auto-complete-command
Added auto complete command for fluentd-sub-second-precision.
Upstream-commit: ea854237aa
Component: cli
2017-12-05 10:29:39 -08:00
4d1f5d1e42 Merge pull request #35529 from dungeonmaster18/subsecond-precision-config
Added SubSecondPrecision to config option.
Upstream-commit: 3461289bf0e9147afc88cd829acc0bb8b64e1053
Component: engine
2017-12-05 10:14:14 -08:00
abf2603ea4 Fix link in Contributing doc
Signed-off-by: Lucas Molas <lmolas@fundacionsadosky.org.ar>
Upstream-commit: 1f0572fd1a28d2b5b4566156fa449bb709362b38
Component: engine
2017-12-05 12:31:02 -03:00
d27e345310 Fix event filters
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: a27abc619cc18ead61fa89f652871fac1b318658
Component: engine
2017-12-05 09:55:33 -05:00
e1f6e66d66 Update containerd to v1.0.0
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 18a53d03740220aa72e454929ad1d1d6b695888e
Component: engine
2017-12-05 09:44:42 -05:00
12e67ce519 Added SubSecondPrecision flag in fluentd logger
Signed-off-by: dungeonmaster18 <umesh4257@gmail.com>
Upstream-commit: a1ebda09bab5bf22d96a15e71618c4a0ac08bb55
Component: engine
2017-12-05 17:21:57 +05:30
a5a325a05f Fixing zsh column finding in nodes and stacks.
Signed-off-by: Bret Fisher <bret@bretfisher.com>
Upstream-commit: 8b6d6fa974
Component: cli
2017-12-05 01:03:25 -05:00
dfd519caff Add test to check for plugin mounts on remove
Ensures that when a plugin is removed that it doesn't interfere with
other plugins mounts and also ensures its own mounts are cleaned up.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 5017b5bef55c31db4c04c8058ef7db8597b11341
Component: engine
2017-12-04 22:01:14 -05:00
0c8a47d019 Allow existing setups to continue using d_type
Even though it's highly discouraged, there are existing
installs that are running overlay/overlay2 on filesystems
without d_type support.

This patch allows the daemon to start in such cases, instead of
refusing to start without an option to override.

For fresh installs, backing filesystems without d_type support
will still cause the overlay/overlay2 drivers to be marked as
"unsupported", and skipped during the automatic selection.

This feature is only to keep backward compatibility, but
will be removed at some point.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 0a4e793a3da9ba6d20bccfb83f7c48e20a76d895
Component: engine
2017-12-04 18:41:25 -08:00
327b80ad82 Merge pull request #35537 from sargun/vfs-use-copy_file_range
Have VFS graphdriver use accelerated in-kernel copy
Upstream-commit: 4047cede65862aa0ea5616297d7c0f3b12526ad4
Component: engine
2017-12-04 19:34:56 -06:00
e4dde67875 Remove support for overlay/overlay2 without d_type
Support for running overlay/overlay2 on a backing filesystem
without d_type support (most likely: xfs, as ext4 supports
this by default), was deprecated for some time.

Running without d_type support is problematic, and can
lead to difficult to debug issues ("invalid argument" errors,
or unable to remove files from the container's filesystem).

This patch turns the warning that was previously printed
into an "unsupported" error, so that the overlay/overlay2
drivers are not automatically selected when detecting supported
storage drivers.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 0abb8dec3f730f3ad2cc9a161c97968a6bfd0631
Component: engine
2017-12-04 17:10:20 -08:00
403fcf5047 Perform fsmagic detection on driver's home-dir if it exists
The fsmagic check was always performed on "data-root" (`/var/lib/docker`),
not on the storage-driver's home directory (e.g. `/var/lib/docker/<somedriver>`).

This caused detection to be done on the wrong filesystem in situations
where `/var/lib/docker/<somedriver>` was a mount, and a different
filesystem than `/var/lib/docker` itself.

This patch checks if the storage-driver's home directory exists, and only
falls back to `/var/lib/docker` if it doesn't exist.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: f9c8fa305e1501d8056f8744cb193a720aab0e13
Component: engine
2017-12-04 17:10:07 -08:00
8a469be8e0 fix golint errors
Signed-off-by: Jake Sanders <jsand@google.com>
Upstream-commit: e04375fb8c2f08da158cce21c1591d39d2e68242
Component: engine
2017-12-04 16:44:03 -08:00
cf1d97228e Merge pull request #65 from seemethere/fix_debian_jessie_aarch64
Adds libudev-dev to jessie aarch64 build
Upstream-commit: 6e901d8febcb7c308035952baa760779ab097806
Component: packaging
2017-12-04 16:33:41 -08:00
6ada520445 Update CRIU github repository
Signed-off-by: Ross Boucher <rboucher@gmail.com>
Upstream-commit: f01d2029bbee7327b324ee501a97100ad5506fbf
Component: engine
2017-12-04 18:51:08 -05:00
57c8d64422 Adds libudev-dev to jessie aarch64 build
Failed out otherwise:

```
---> Making bundle: dynbinary (in bundles/dynbinary)
Building: bundles/dynbinary-daemon/dockerd-17.09.0-dev
Package libudev was not found in the pkg-config search path.
```

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 4d8e8855d1008f4705ea6db17e5cd5bc90bd2d81
Component: packaging
2017-12-04 23:36:16 +00:00
2ee063b98e CRIU needs a newer version to work with the updates pulled in by containerd 1.0
Signed-off-by: Ross Boucher <rboucher@gmail.com>
Upstream-commit: 7ffae3d51a452a63c49f8544953a8b0f9781a5e0
Component: engine
2017-12-04 17:45:04 -05:00
7287b1b196 Merge pull request #64 from seemethere/jenkinsfile_label
Change label to one that actually exists
Upstream-commit: 1991b032cb64827c595ad652e6b94b2e49402527
Component: packaging
2017-12-04 13:49:36 -08:00
f28070bdef Merge pull request #35693 from crosbymichael/ctd-rc0
Update containerd to rc0 +
Upstream-commit: 20a42b1f5616b07df524965383528711d24cf6ea
Component: engine
2017-12-04 16:49:29 -05:00
a9ea77004e Change label to one that actually exists
Seems `docker-edge` was removed as label on jenkins.dockerproject.org.

This removes that label and just puts the x86_64 label

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 6765382587e31a93b1e65d2d169b00a42d183ee2
Component: packaging
2017-12-04 21:48:42 +00:00
8d18b0cfab Merge pull request #704 from albers/completion--platform
Add bash completion for `--platform`
Upstream-commit: 83cdc0f1bd
Component: cli
2017-12-04 13:19:37 -08:00
d76f409f13 Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2017-12-04 21:07:48 +00:00
f70de4cf86 Merge component 'engine' from git@github.com:moby/moby master 2017-12-04 21:07:45 +00:00
8f588eed28 Add aarch64 support (#35)
* add aarch64 support

* use go 1.9 for arm64 support

* fixtypo

* add backports on jessie

* fix path

* delet yakkety

* rm golang-go

* use arm64v8/ images

* fix error made in merge

* remove double architecture

* use arm64v8/

* use go 1.8.5

* Update aarch64 builds to 1.9.2

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 03eac425534002445e666ce0352f1c666151dc89
Component: packaging
2017-12-04 11:53:11 -08:00
8b1197a568 Fix nonewmountns for containerd options
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 97b0a9d5f195c7daf16cf9dcfb6c4d62044163fe
Component: engine
2017-12-04 14:17:30 -05:00
08c25433ac Bump containerd to cc969fb42f427a68a8cc6870ef47f17
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: ad2b34f2056ca7d6edab17967a797fb19bf4ed5a
Component: engine
2017-12-04 14:14:42 -05:00
cbec60ecae Merge pull request #35687 from tiborvass/add-derek-bot
project: try alexellis/derek bot to manage PRs and issues
Upstream-commit: d94164867c2df977ceb8d9df3d90364d0a682d05
Component: engine
2017-12-04 09:54:02 -08:00
d47afe4a42 project: try alexellis/derek bot to manage PRs and issues
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 123cb9590739a517caa6821a92d9becb2f723547
Component: engine
2017-12-04 16:11:41 +01:00
14e1e40a4e Add bash completion for --log-opt line-only
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 0798d71f38
Component: cli
2017-12-04 10:05:37 +01:00
c4fbbf057e Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2017-12-04 06:57:03 +00:00
47fdbea6d3 Merge component 'engine' from git@github.com:moby/moby master 2017-12-04 06:57:00 +00:00
bf78150b9b Merge pull request #35600 from nictuku/go_option
Set a go_package on api/types/swarm/runtime to make it Bazel compatible
Upstream-commit: 7ef9266ba090a3230355c39352dddf41aeb5b726
Component: engine
2017-12-01 17:30:12 -08:00
31daed866f Merge pull request #62 from andrewhsu/al
no need to detect arch for alpine image
Upstream-commit: 33ee027e04a43651f953bbc080eb020b84fd53cc
Component: packaging
2017-12-01 15:42:51 -08:00
b2d74e0a1a Merge pull request #63 from andrewhsu/j
set VERSION when building packages
Upstream-commit: d467fd1d6abc13be714896f89218a8e6ca047162
Component: packaging
2017-12-01 15:42:33 -08:00
395b31b896 no need to detect alpine image
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
Upstream-commit: 1b5ac32b06cb05ee61ea1b72e2147e983194ea73
Component: packaging
2017-12-01 15:39:00 -08:00
7534a636c1 Merge pull request #60 from andrewhsu/192
use golang 1.9.2
Upstream-commit: ca48d4109ee2326ed16bbcedfdd8691747b252ab
Component: packaging
2017-12-01 15:35:18 -08:00
469adac6a0 set VERSION when building packages
Setting to something that will not be confused with a version number
that will ever be released. Also, this is required for the deb packages
to build properly

Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
Upstream-commit: 0de78bd1251958a9d8916c3944b8f51d0ffb49b7
Component: packaging
2017-12-01 15:19:41 -08:00
9b80ff5665 use pre-compiled golang arm64 toolset
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
Upstream-commit: 30c250b285e758b295e010eee64b726cdac0e7be
Component: packaging
2017-12-01 14:56:19 -08:00
5016fee3dc Merge pull request #35578 from thaJeztah/fix-portbindings-swagger
Fix PortBindings definition in Swagger
Upstream-commit: ac68411f85a1c4540c0d4f5b7db86b0b0422f025
Component: engine
2017-12-01 17:46:38 -05:00
9a7838eb22 Merge pull request #35422 from pradipd/lbfix
Move load balancer sandbox creation/deletion into libnetwork
Upstream-commit: 4bb2c2402df88f0e3e8c47499fc2de5182719e00
Component: engine
2017-12-01 14:08:48 -08:00
29875cbb85 use golang 1.9.2
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
Upstream-commit: 0c04ba6701d462b173ed63bdcd9a55c0e95d8ce1
Component: packaging
2017-12-01 13:59:10 -08:00
f1232b72bc Merge pull request #61 from seemethere/fix_jenkinsfile
Make Jenkinsfile actually function
Upstream-commit: b53c9642495f3c09e2c95791ab6108fe8733fe2b
Component: packaging
2017-12-01 13:58:39 -08:00
3cd9275696 Make directory references absolute
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: bca63242a9c166a944619019da6e0b50f03b4233
Component: packaging
2017-12-01 21:52:00 +00:00
b63d8b8465 Remove fancy github context notifiers
They don't function correctly and they're not worth it

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 3f5a6f288ad7e134abb4ac99e56cbbca17bfae88
Component: packaging
2017-12-01 21:47:49 +00:00
e57d9082bb Merge pull request #57 from seemethere/add_tests
Adds initial Jenkinsfile
Upstream-commit: 20ac959f7f135b20c45b56d8dd50353a0e3a5e52
Component: packaging
2017-12-01 13:17:46 -08:00
5b5e980ec3 Adds initial Jenkinsfile.
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 31a08611f6b87f71d673ab254471826eed225858
Component: packaging
2017-12-01 21:16:46 +00:00
20a2865e53 Fix setting mtimes on directories
Previously, the code would set the mtime on the directories before
creating files in the directory itself. This was problematic
because it resulted in the mtimes on the directories being
incorrectly set. This change makes it so that the mtime is
set only _after_ all of the files have been created.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Upstream-commit: 77a2bc3e5bbc9be3fe166ed8321b7cd04e7bd097
Component: engine
2017-12-01 09:12:43 -08:00
f62beecbb7 Added auto complete command for fluentd-sub-second-precision
Signed-off-by: dungeonmaster18 <umesh4257@gmail.com>
Upstream-commit: d5271568a2
Component: cli
2017-12-01 18:39:41 +05:30
148bfd3114 introduce workingdir option for docker exec
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Upstream-commit: 19f2749d3906707717aeec9da27c499bcdc07da8
Component: engine
2017-12-01 09:06:07 +01:00
6a8cf843af Merge component 'engine' from git@github.com:moby/moby master 2017-12-01 04:12:05 +00:00
559fcde9d4 Disambiguate mirror -> other endpoint fallbacks from V2 -> V1
Signed-off-by: Jake Sanders <jsand@google.com>
Upstream-commit: 305801f58f22c9a26bc05eaa800e399afb212fe3
Component: engine
2017-11-30 20:01:03 -08:00
5f26edda74 Merge component 'cli' from git@github.com:docker/cli master 2017-12-01 03:52:40 +00:00
b611814dc6 Merge pull request #35628 from ikarpovich/35626-le-line-only-legacy
Logentries line-only logopt fix to maintain backwards compatibility
Upstream-commit: 3a9ab941adcc7a39c3ea8c52e3c215cdddb2fe67
Component: engine
2017-11-30 15:48:56 -08:00
f67476ad43 Merge pull request #35645 from crosbymichael/ctd-10
Update containerd to pre-1.0 rc commit
Upstream-commit: 3eb7314519714e0392a4863d6cd4beb3a4b206e8
Component: engine
2017-11-30 15:22:01 -08:00
b8226cb988 Adding test for creating service multiple times.
Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
Upstream-commit: 791d88b8538b4949153d346ec738139aa6d15280
Component: engine
2017-11-30 13:03:44 -08:00
19fca6eb66 docker changes corresponding to libnetwork changes.
Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
Upstream-commit: 41071d6648fe5b4649354e806543b9520af45383
Component: engine
2017-11-30 13:03:30 -08:00
553ad48935 vndr libnetwork 64ae58878fc8f95e4a167499d654e13fa36abdc7
Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
Upstream-commit: 7de313ac4ec2084aca6c91efc3124b9dbffc5f1a
Component: engine
2017-11-30 13:02:56 -08:00
a8cf119f39 Merge pull request #35516 from mlaventure/reduce-race-on-exit
Add missing lock in ProcessEvent
Upstream-commit: 9d00efb533d3561220d169a86ca9ff965f9a6b2c
Component: engine
2017-11-30 11:30:51 -08:00
4d4ec05575 Merge pull request #35533 from AliyunContainerService/supress-warning-healthcheck-none
Suppress warning when NONE was set for healthcheck
Upstream-commit: 29d6aef3930bf2ba815e27f4507f035a7fb5ba6c
Component: engine
2017-11-30 11:06:05 -08:00
a620b9f6fd Merge pull request #35496 from cpuguy83/add_timeouts_to_splunk_post
Set timeout on splunk batch send
Upstream-commit: 88e36dcc76c08d13fd83f91fa7dbe4a6ff4c83b8
Component: engine
2017-11-30 09:47:48 -08:00
4a8c6447a6 Merge pull request #719 from vdemeester/test-secret-config-indempotence
Add unit tests on config/secret indempotence in stack deploy
Upstream-commit: 6b63d7b96a
Component: cli
2017-11-30 08:39:56 -08:00
87f648cd90 Merge pull request #35618 from kolyshkin/mkdir-all
Fix MkdirAll* and its usage
Upstream-commit: 72e45fd54e13256c813fdb39b18e26a0de980733
Component: engine
2017-11-30 11:19:29 -05:00
9d718a77b7 Merge pull request #35614 from mlaventure/remove-exec-bypid
Remove ByPid from ExecCommands
Upstream-commit: edbf7d8ed41a88d34dd9ad249ac94f095e0d3385
Component: engine
2017-11-30 11:17:42 -05:00
d99ad61b69 Update containerd to 6bff39c643886dfa3d546e83a90a5
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: c2cb302d1701e0de35930671f61e5d267fcb3e01
Component: engine
2017-11-30 11:16:25 -05:00
ad76847e4b Update daemon code for containerd API changes
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: aa3ce07c41e0da9331f0659f28fed7f35846556c
Component: engine
2017-11-30 09:55:03 -05:00
c4cb5e12ad Logentries line-only logopt fix to maintain backwards compatibility
Changed logic to ignore empty value

Fixes #35626

Signed-off-by: Igor Karpovich <igor@karpovich.me>
Upstream-commit: 27a5b878c149fd70ca1e0beebda58edcc19abc73
Component: engine
2017-11-30 13:03:16 +00:00
9818aadf77 Add unit tests on config/secret indempotence in stack deploy
Related PR : https://github.com/docker/cli/pull/509

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 5ed399e588
Component: cli
2017-11-30 09:45:32 +01:00
617fb8ceb7 Merge pull request #702 from albers/completion-log--until
Add bash completion for `logs --until`
Upstream-commit: b45a49c83f
Component: cli
2017-11-30 09:40:08 +01:00
3c7ba9bf1b Add bash completion for --platform
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 15f78417b9
Component: cli
2017-11-30 09:29:15 +01:00
a88b24bfeb Merge pull request #35483 from thaJeztah/disallow-nfs-backing-for-overlay
Disallow overlay/overlay2 on top of NFS
Upstream-commit: bdd9668b489c65eb1ef7272d38ad877ffda2041c
Component: engine
2017-11-29 19:24:58 -08:00
1072fa08f7 Merge pull request #35634 from fcrisciani/fix-net-not-found
Restore error type in FindNetwork
Upstream-commit: e0b3ddd4377b9539e6112e57777f4c7b1d0bfc08
Component: engine
2017-11-29 16:26:26 -08:00
d9f34cfcb3 Update containerd to 59bd1967112885c4d49e510e55701
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 5bd902b5cfbb360915b02fc2a787ae9e1c183405
Component: engine
2017-11-29 19:15:14 -05:00
3e4063cddb Merge pull request #35501 from cpuguy83/lock_while_stopping_healthcheck
Fix some issues with locking on the container
Upstream-commit: 3d80a692d146e10282bacc0dd2698ffd32dcdaae
Component: engine
2017-11-30 09:01:31 +09:00
006ed302fe Merge pull request #35527 from thaJeztah/feature-detect-overlay2
Detect overlay2 support on pre-4.0 kernels
Upstream-commit: 11e07e7da6023b872788b1e05f83e147f0984fb2
Component: engine
2017-11-29 13:51:26 -08:00
02055337d8 Merge pull request #694 from riyazdf/trust-inspect
docker trust inspect
Upstream-commit: d921d5cc39
Component: cli
2017-11-29 11:33:53 -08:00
ea17d4a2f5 Restore error type in FindNetwork
The error type libnetwork.ErrNoSuchNetwork is used in the controller
to retry the network creation as a managed network though the manager.
The change of the type was breaking the logic causing the network to
not being created anymore so that no new container on that network
was able to be launched
Added unit test

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
Upstream-commit: 51cea0a53c2fd36832277402e9faac81bfb4abd4
Component: engine
2017-11-29 11:22:57 -08:00
f8c7f6621d Use default inspect formatting, remove omitempty, update docs
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: a9428285f0
Component: cli
2017-11-29 10:52:35 -08:00
b1e7ee7a82 support multiple arguments to trust inspect
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 1eb87cc096
Component: cli
2017-11-29 10:52:34 -08:00
7e9b53fd42 add docker trust inspect command for JSON viewing
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: cd38d39d0d
Component: cli
2017-11-29 10:52:34 -08:00
9b7953e812 Merge pull request #718 from dnephin/fix-e2e-docker-build
Fix e2e build test
Upstream-commit: 1b4f2d3b73
Component: cli
2017-11-29 10:30:31 -08:00
a79583a886 Merge pull request #677 from albers/completion-log-opts
Add new log driver options to bash completion
Upstream-commit: 4f009541cb
Component: cli
2017-11-29 10:01:19 -08:00
fe41a825e2 Merge pull request #678 from albers/completion-build--stream
Add bash completion for experimental `build --stream`
Upstream-commit: c428561b63
Component: cli
2017-11-29 10:00:23 -08:00
264f9d5a4f Merge pull request #701 from albers/completion-trust-sign--local
Add bash completion for `trust sign --local`
Upstream-commit: e5d49c0199
Component: cli
2017-11-29 09:44:53 -08:00
40b8aa0152 Merge pull request #467 from estesp/chown-flag-docs
Add docs for Dockerfile ADD/COPY --chown flag
Upstream-commit: 12765c318f
Component: cli
2017-11-29 09:28:30 -08:00
29f2890225 Fix e2e build test
The build output changed in 17.11

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 16cd84024c
Component: cli
2017-11-29 11:02:40 -05:00
cbde088d23 Merge pull request #716 from vdemeester/bump-go
Bump Go to 1.9.2
Upstream-commit: 8abb266043
Component: cli
2017-11-29 09:42:58 -05:00
1433c3b1eb Bump Go to 1.9.2
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 6859a7387b
Component: cli
2017-11-29 09:16:03 +01:00
5a1411dbf0 Merge pull request #35606 from cbirajdar/master
added more awesome and notable women to names-generator.go
Upstream-commit: c8441b186e8bc5d7994a922782cc3b6e2c462893
Component: engine
2017-11-28 21:37:17 -08:00
1901e3d893 Merge pull request #35619 from Microsoft/jjh/testrunservicingcontainer
Disable TestRunServicingContainer on RS4+ builds
Upstream-commit: 99e4eb103d67422ff10809079e2b810cd3dfce99
Component: engine
2017-11-28 21:34:15 -08:00
856222b133 Merge pull request #35620 from fcrisciani/libnetwork-vendoring
Libnetwork vendoring
Upstream-commit: 235c10573612d856300ffeb5c05ac0ca343609a6
Component: engine
2017-11-28 21:11:14 -08:00
bac9dc2670 Merge pull request #35631 from Microsoft/jjh/heightwidth
Windows: Fix width/height swap
Upstream-commit: 29708da9077fc37554bac10b17fe0446bed07af9
Component: engine
2017-11-28 21:02:46 -08:00
87cfb875f7 Merge pull request #34948 from euank/public-mounts
Fix EBUSY errors under overlayfs and v4.13+ kernels
Upstream-commit: 09eb7bcc3624f5bd70135d6d24021b40c1095b46
Component: engine
2017-11-29 12:48:39 +09:00
a0c42a8dee Merge pull request #35622 from asottile/update_integration_cli_docs
Change references from test-integration-cli to test-integration
Upstream-commit: debc1fbee8d86948deed5939bb73f2a175151fb1
Component: engine
2017-11-29 12:47:52 +09:00
7f2221039e Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2017-11-28 18:03:52 -08:00
6be246bf8b Merge component 'engine' from git@github.com:moby/moby master 2017-11-28 18:03:40 -08:00
67203bb69e Merge pull request #429 from RenaudWasTaken/generic-resource
Integrated Generic resource in service create
Upstream-commit: 97b148b440
Component: cli
2017-11-28 18:01:42 -08:00
99c53b25ef Merge component 'cli' from git@github.com:docker/cli master 2017-11-28 17:01:27 -08:00
6d8eeeb431 Merge pull request #35586 from ndeloof/patch-1
`memory` is an int64 (long)
Upstream-commit: 9243c28ba541281eaba43e51658f8dd032679ebc
Component: engine
2017-11-28 16:32:04 -08:00
0569c43fe3 Merge pull request #35632 from anusha-ragunathan/fix-panic
Fix potential panic during plugin set.
Upstream-commit: f943df7d4824424bd648d7a165e89be8a65a952e
Component: engine
2017-11-28 15:50:12 -08:00
877f5d0f1f Fix bug, where copy_file_range was still calling legacy copy
There was a small issue here, where it copied the data using
traditional mechanisms, even when copy_file_range was successful.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Upstream-commit: 0eac562281782257e6f69d58bcbc13fa889f1759
Component: engine
2017-11-28 14:59:56 -08:00
608a03b9d5 Have VFS graphdriver use accelerated in-kernel copy
This change makes the VFS graphdriver use the kernel-accelerated
(copy_file_range) mechanism of copying files, which is able to
leverage reflinks.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Upstream-commit: d2b71b26604370620630d8d3f35aba75ae474f3f
Component: engine
2017-11-28 14:59:56 -08:00
85f5db8154 Fix copying hardlinks in graphdriver/copy
Previously, graphdriver/copy would improperly copy hardlinks as just regular
files. This patch changes that behaviour, and instead the code now keeps
track of inode numbers, and if it sees the same inode number again
during the copy loop, it hardlinks it, instead of copying it.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Upstream-commit: b467f8b2ef21dc2239dcd136a29283ea6c3a0aee
Component: engine
2017-11-28 14:59:56 -08:00
efd7b774aa Detect overlay2 support on pre-4.0 kernels
The overlay2 storage-driver requires multiple lower dir
support for overlayFs. Support for this feature was added
in kernel 4.x, but some distros (RHEL 7.4, CentOS 7.4) ship with
an older kernel with this feature backported.

This patch adds feature-detection for multiple lower dirs,
and will perform this feature-detection on pre-4.x kernels
with overlayFS support.

With this patch applied, daemons running on a kernel
with multiple lower dir support will now select "overlay2"
as storage-driver, instead of falling back to "overlay".

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 955c1f881ac94af19c99f0f7d5635e6a574789f2
Component: engine
2017-11-28 13:55:33 -08:00
b7dabb480c Fix potential panic during plugin set.
Plugin config can have Mounts without a 'Source' field. In such cases,
performing a 'plugin set' on the mount source will panic the daemon. Its
the same case for device paths as well. This detects the case and
returns error.

Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
Upstream-commit: 6572e27df7f3483cfed7a8294c1f6d9cf157809a
Component: engine
2017-11-28 13:06:24 -08:00
2598a6cd6a Added support of Generic resources in compose file
Signed-off-by: Renaud Gaubert <renaud.gaubert@gmail.com>
Upstream-commit: 1ff73f867d
Component: cli
2017-11-28 21:52:09 +01:00
6025db4712 Windows: Fix width/height swap
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: f11f351ae77e4090f0d80e9cccfd77287b1f6b17
Component: engine
2017-11-28 12:19:46 -08:00
00e6357d85 Disable TestRunServicingContainer on RS4+ builds
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 1293303bda56f9f6f5a0d99921a5368e0e527509
Component: engine
2017-11-28 10:29:43 -08:00
405736f2fc Merge pull request #714 from doncicuto/patch-1
Update Flocker plugin link
Upstream-commit: e004dc01d4
Component: cli
2017-11-28 10:20:10 -08:00
77a39cce80 Added support for generic resource update
Signed-off-by: Renaud Gaubert <renaud.gaubert@gmail.com>
Upstream-commit: 20a6ff32ee
Component: cli
2017-11-28 18:03:10 +01:00
025793bb76 Added docs for service create
Signed-off-by: Renaud Gaubert <renaud.gaubert@gmail.com>
Upstream-commit: 4a6da88f7a
Component: cli
2017-11-28 18:03:10 +01:00
4ba8859964 Added docs for dockerd
Signed-off-by: Renaud Gaubert <renaud.gaubert@gmail.com>
Upstream-commit: fe07ca70d6
Component: cli
2017-11-28 18:03:10 +01:00
2eb0bb6fa6 Added Generic Resource tests
Signed-off-by: Renaud Gaubert <renaud.gaubert@gmail.com>
Upstream-commit: 51c7cd91cf
Component: cli
2017-11-28 18:03:10 +01:00
6c65651aa2 Updated GenericResource CLI
Signed-off-by: Renaud Gaubert <renaud.gaubert@gmail.com>
Upstream-commit: 7ddd5f3434
Component: cli
2017-11-28 18:03:10 +01:00
f62d716bb0 Revendored swarmkit
Signed-off-by: Renaud Gaubert <renaud.gaubert@gmail.com>
Upstream-commit: 7843aec98c
Component: cli
2017-11-28 18:03:10 +01:00
a94e4ed04a Merge pull request #35572 from arm64b/big-image-imp-test-aarch64
image: skip the import test on AArch64
Upstream-commit: c307e0ce49d63d1b1f479560955dca3956f005ec
Component: engine
2017-11-28 13:51:15 +01:00
0637acf0b1 Update Flocker plugin link
ClusterHQ shutted down at the end of 2016. It seems that ScatterHQ is a group of ClusterHQ former employees that have forked Flocker. It seems that no code has been commited in the last months but if somebody comes to this Docker page it should be referenced to ScatterHQ.

Signed-off-by: Miguel Angel Alvarez Cabrerizo <doncicuto@gmail.com>
Upstream-commit: 3e6e54a90f
Component: cli
2017-11-28 13:51:08 +01:00
94ae8f10c7 Change references from test-integration-cli to test-integration
Signed-off-by: Anthony Sottile <asottile@umich.edu>
Upstream-commit: b6eed3dca2e57705cb75895cad0b5337c79686d9
Component: engine
2017-11-27 19:01:14 -08:00
016b82fbf3 image: skip the import test on AArch64
The commit '0a13f827a10d3bf61744d9b3f7165c5885a39c5d' introduces an
import test for CVE-2017-14992, it uses a 8GB image to make sure we
don't revert CVE-2017-14992, but unfortunately this test can't finish
in 5-min on AArch64, as a fact, in most cases we have to crate a very
big image to make the test effective on AArch64, but this will result
in a test panic, so now we skip it order to avoid termination of others
tests followed.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Upstream-commit: 6395b8b3dcc43be6750e0d90d9bab0a83e4eb20b
Component: engine
2017-11-28 01:48:49 +00:00
2ddb9ceeba Merge pull request #35528 from thaJeztah/ignore-empty-graphdirs
Skip empty directories on prior graphdriver detection
Upstream-commit: 9ae697167c8b90b40d5248e99a8f0a0fc304637e
Component: engine
2017-11-27 17:37:39 -08:00
bc89af9929 Simplify/fix MkdirAll usage
This subtle bug keeps lurking in because error checking for `Mkdir()`
and `MkdirAll()` is slightly different wrt to `EEXIST`/`IsExist`:

 - for `Mkdir()`, `IsExist` error should (usually) be ignored
   (unless you want to make sure directory was not there before)
   as it means "the destination directory was already there"

 - for `MkdirAll()`, `IsExist` error should NEVER be ignored.

Mostly, this commit just removes ignoring the IsExist error, as it
should not be ignored.

Also, there are a couple of cases then IsExist is handled as
"directory already exist" which is wrong. As a result, some code
that never worked as intended is now removed.

NOTE that `idtools.MkdirAndChown()` behaves like `os.MkdirAll()`
rather than `os.Mkdir()` -- so its description is amended accordingly,
and its usage is handled as such (i.e. IsExist error is not ignored).

For more details, a quote from my runc commit 6f82d4b (July 2015):

    TL;DR: check for IsExist(err) after a failed MkdirAll() is both
    redundant and wrong -- so two reasons to remove it.

    Quoting MkdirAll documentation:

    > MkdirAll creates a directory named path, along with any necessary
    > parents, and returns nil, or else returns an error. If path
    > is already a directory, MkdirAll does nothing and returns nil.

    This means two things:

    1. If a directory to be created already exists, no error is
    returned.

    2. If the error returned is IsExist (EEXIST), it means there exists
    a non-directory with the same name as MkdirAll need to use for
    directory. Example: we want to MkdirAll("a/b"), but file "a"
    (or "a/b") already exists, so MkdirAll fails.

    The above is a theory, based on quoted documentation and my UNIX
    knowledge.

    3. In practice, though, current MkdirAll implementation [1] returns
    ENOTDIR in most of cases described in #2, with the exception when
    there is a race between MkdirAll and someone else creating the
    last component of MkdirAll argument as a file. In this very case
    MkdirAll() will indeed return EEXIST.

    Because of #1, IsExist check after MkdirAll is not needed.

    Because of #2 and #3, ignoring IsExist error is just plain wrong,
    as directory we require is not created. It's cleaner to report
    the error now.

    Note this error is all over the tree, I guess due to copy-paste,
    or trying to follow the same usage pattern as for Mkdir(),
    or some not quite correct examples on the Internet.

    [1] https://github.com/golang/go/blob/f9ed2f75/src/os/path.go

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 516010e92d56cfcd6d1e343bdc02b6f04bc43039
Component: engine
2017-11-27 17:32:12 -08:00
ccb264e334 Libnetwork vendoring
- removed support for Solaris
- networkdb fixed race on node management

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
Upstream-commit: 2e5d5c1d325662ac56de4772e4e1fe3a9c7a2d19
Component: engine
2017-11-27 14:57:45 -08:00
dcbc5aef35 Merge pull request #35612 from ikarpovich/35610-le-line-only
Logentries driver line-only=true []byte output fix
Upstream-commit: c75c45b18858cf34669b43e8cec25f70bd5803ea
Component: engine
2017-11-27 14:33:02 -08:00
44cd9b0708 Remove ByPid from ExecCommands
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 6f3e86e906a8955d3dc3ddc2a6be51b17e7a097f
Component: engine
2017-11-27 14:27:40 -08:00
03d850d672 idtools.MkdirAs*: error out if dir exists as file
Standard golang's `os.MkdirAll()` function returns "not a directory" error
in case a directory to be created already exists but is not a directory
(e.g. a file). Our own `idtools.MkdirAs*()` functions do not replicate
the behavior.

This is a bug since all `Mkdir()`-like functions are expected to ensure
the required directory exists and is indeed a directory, and return an
error otherwise.

As the code is using our in-house `system.Stat()` call returning a type
which is incompatible with that of golang's `os.Stat()`, I had to amend
the `system` package with `IsDir()`.

A test case is also provided.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 2aa13f86f0c9cf3ed58a648a7b1506d4b06f3589
Component: engine
2017-11-27 13:25:44 -08:00
5c33ebfbc1 Merge pull request #33892 from thaJeztah/bump-golang-19
Bump Go to 1.9.2
Upstream-commit: c672fbd69cb2b375011867860b3f46220655d3fe
Component: engine
2017-11-27 11:44:06 -08:00
9a7fb33c58 Merge pull request #35579 from dnephin/fix-layer-dne
Fix layer DNE with duplicate layers
Upstream-commit: 9fe48f081dafbff467643ce1119c7963f57d9ee8
Component: engine
2017-11-27 09:40:54 -08:00
c3f989d26b This fixes casting of log message []byte into string with --log-opt line-only=true
Signed-off-by: Igor Karpovich <igor@karpovich.me>
Upstream-commit: 440e50b6c702b5e13fff9424ef656b6bb6a259f0
Component: engine
2017-11-27 14:26:53 +00:00
249ba5d150 added more awesome and notable women to names-generator.go
Signed-off-by: Chetan Birajdar <birajdar.chetan@gmail.com>
Upstream-commit: 7c50d394808da05ebe40966246ae3c03a443fb1a
Component: engine
2017-11-26 21:40:02 -08:00
6b9bdea9e7 Update docs to reflect working directory name change.
Signed-off-by: Eric Soderstrom <ericsoderstrom@gmail.com>
Upstream-commit: f72ece01866ffc1df7c9b33a89ed243c42468bd4
Component: engine
2017-11-26 13:12:16 -08:00
59e5477bf3 Set a go_package on api/types/swarm/runtime to make it Bazel compatible
Signed-off-by: Yves Junqueira <yves.junqueira@gmail.com>
Upstream-commit: 44f61e0f860447e198ca044f1cbdac73c5aa2bbf
Component: engine
2017-11-25 04:26:16 -08:00
52ebdfbe5d Close pipe in chrootarchive.invokeUnpack when cmd.Start()/json.NewEncoder failed.
Signed-off-by: y00316549 <yangshukui@huawei.com>
Upstream-commit: f5f8f008608e579e9164647910ef6f976e91e297
Component: engine
2017-11-24 13:41:08 +08:00
c7f0d04c5e Merge pull request #33731 from runcom/rt-fix-update
container: update real-time resources
Upstream-commit: dfe2c023a34de3e1731e789f4344ef4d85070bc6
Component: engine
2017-11-23 18:30:22 -08:00
b02966efb1 Merge pull request #35563 from soccerGB/driveroptionpersist
Added support for persisting Windows network driver specific options …
Upstream-commit: 1f3f111b4577b29613b0ffef8f001679c2a62d6f
Component: engine
2017-11-23 16:31:46 -08:00
a737bf6704 Fix layer DNE with duplicate layers.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 936ef0c4c97737066ae1e028f04b5188022a91b8
Component: engine
2017-11-23 15:41:59 -05:00
8a8ecdb59d Merge pull request #709 from dnephin/e2e-docker-build
Add e2e test for docker build
Upstream-commit: 6476524c74
Component: cli
2017-11-23 13:54:41 -05:00
c34d673f0c Merge pull request #689 from thaJeztah/remove-daemon-subcommand
Remove deprecated "daemon" subcommand
Upstream-commit: 227dfea9e1
Component: cli
2017-11-23 11:10:50 -05:00
12aa8ed3d8 memory is an int64 (long)
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Upstream-commit: 5ad85b1d4d69806754d1814f019b03b57e40d6da
Component: engine
2017-11-23 14:24:43 +01:00
dd75028635 Merge pull request #35576 from tophj-ibm/add-main-to-image-tests
[integration] add main_test for image test
Upstream-commit: fe8aac6f5ae413a967adb0adad0b54abdfb825c4
Component: engine
2017-11-22 14:42:56 -08:00
7830091c4b graphdriver/overlay{,2}: remove 'merged' on umount
This removes and recreates the merged dir with each umount/mount
respectively.
This is done to make the impact of leaking mountpoints have less
user-visible impact.

It's fairly easy to accidentally leak mountpoints (even if moby doesn't,
other tools on linux like 'unshare' are quite able to incidentally do
so).

As of recently, overlayfs reacts to these mounts being leaked (see

One trick to force an unmount is to remove the mounted directory and
recreate it. Devicemapper now does this, overlay can follow suit.

Signed-off-by: Euan Kemp <euan.kemp@coreos.com>
Upstream-commit: af0d589623eff9f8cefced8b527dbd7cf221ce61
Component: engine
2017-11-22 14:32:30 -08:00
cb2dc1cb0b graphdriver/overlay: minor doc comment cleanup
Signed-off-by: Euan Kemp <euan.kemp@coreos.com>
Upstream-commit: 1e214c09524c0cf32c3e8005631bbcf3e1afa506
Component: engine
2017-11-22 14:17:08 -08:00
b88ff8a5c2 container: update real-time resources
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: dca82b9e5c53e96d1e34bec03e78e17feb8d6fdb
Component: engine
2017-11-22 22:21:40 +01:00
db4f5614fc Merge pull request #668 from ilyasotkov/667-secret-config-names
Add "name" field to secrets and configs to allow interpolation in Compose files
Upstream-commit: 8d41ba082b
Component: cli
2017-11-22 13:33:59 -05:00
3ceb534c1b Fix PortBindings definition in Swagger
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: a50cf8aa44f2a5abb5900d39008d075d2e8c2850
Component: engine
2017-11-22 17:55:37 +01:00
9f84ce63a5 [integration] add main_test for image test
Adds a main_test for the image integration test, so we can download
frozen images, and clean up after the image test is ran

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: be83f42612e3be42fcd60726d48d7346befc9449
Component: engine
2017-11-22 11:13:32 -05:00
34cc3d6434 Remove duplication for secrets / configs, combine 3.5 loader tests, remove extraneous error call, regenerate schema correctly
Signed-off-by: Ilya Sotkov <ilya@sotkov.com>
Upstream-commit: ec47003ecb
Component: cli
2017-11-22 13:41:16 +02:00
3d2eab6bf0 Add tests for secret.name in compose files.
Signed-off-by: Ilya Sotkov <ilya@sotkov.com>
Upstream-commit: 1f10b31017
Component: cli
2017-11-22 13:18:05 +02:00
2dae51fa3d Add secret.name and config.name in compose.
Signed-off-by: Ilya Sotkov <ilya@sotkov.com>
Upstream-commit: 4f7f3d2f61
Component: cli
2017-11-22 13:18:05 +02:00
26b47c13d1 Merge pull request #35467 from kolyshkin/dup-mnt
Fix "duplicate mount point" when --tmpfs /dev/shm is used
Upstream-commit: d032264e1365a1cea621b7105e1ca521cb4218ef
Component: engine
2017-11-22 12:13:06 +01:00
4a5f32be3b Merge pull request #35541 from thaJeztah/remove-deprecated-mkdirallas
Remove uses of deprecated MkdirAllAs(), MkdirAs()
Upstream-commit: 84b1f813a4ada3c19eea84f9e98c56c0768d9da2
Component: engine
2017-11-22 17:49:37 +09:00
e6fc3af770 Added support for persisting Windows network driver specific options over reboot or service restart
Signed-off-by: Cheng-mean Liu <soccerl@microsoft.com>
Upstream-commit: cef1578ac46e02d05c86621505631b3be7ca9d72
Component: engine
2017-11-21 14:11:12 -08:00
86481c358f Merge pull request #35559 from thaJeztah/remove-testutil
Remove unused "testutil" package
Upstream-commit: ce452fb72ffcdb7605ce98bde9302238f47c63c5
Component: engine
2017-11-21 21:00:04 +01:00
605885e518 Bump Go to 1.9.2
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: d6e1cc32d309ee237342975388e729570343a974
Component: engine
2017-11-21 20:57:02 +01:00
7ed4a89d21 Merge pull request #35554 from darrenstahlmsft/RevendorHcsshim
Update hcsshim to v0.6.7 for go1.9 support
Upstream-commit: fb89afb6898fc830b8f660931f54145f85b971c7
Component: engine
2017-11-21 20:55:40 +01:00
6a9797ecaa Add e2e test for docker build
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 7adb4c4b1e
Component: cli
2017-11-21 13:24:37 -05:00
b26b223eb7 Fix some issues with locking on the container
- Fix OOM event updating healthchecks and persisting container state
without locks
- Fix healthchecks being updated without locks on container stop

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 972cb4978795029131697bd3b3746e321eec5c13
Component: engine
2017-11-21 12:41:43 -05:00
c9b8719b0b Merge pull request #59 from seemethere/add_f27
Adds packaging for Fedora 27
Upstream-commit: 3519a3532cf9da379db073452a3f55c7d894961a
Component: packaging
2017-11-21 09:39:51 -06:00
a653d42fdb Skip empty directories on prior graphdriver detection
When starting the daemon, the `/var/lib/docker` directory
is scanned for existing directories, so that the previously
selected graphdriver will automatically be used.

In some situations, empty directories are present (those
directories can be created during feature detection of
graph-drivers), in which case the daemon refuses to start.

This patch improves detection, and skips empty directories,
so that leftover directories don't cause the daemon to
fail.

Before this change:

    $ mkdir /var/lib/docker /var/lib/docker/aufs /var/lib/docker/overlay2
    $ dockerd
    ...
    Error starting daemon: error initializing graphdriver: /var/lib/docker contains several valid graphdrivers: overlay2, aufs; Please cleanup or explicitly choose storage driver (-s <DRIVER>)

With this patch applied:

    $ mkdir /var/lib/docker /var/lib/docker/aufs /var/lib/docker/overlay2
    $ dockerd
    ...
    INFO[2017-11-16T17:26:43.207739140Z] Docker daemon                                 commit=ab90bc296 graphdriver(s)=overlay2 version=dev
    INFO[2017-11-16T17:26:43.208033095Z] Daemon has completed initialization

And on restart (prior graphdriver is still picked up):

    $ dockerd
    ...
    INFO[2017-11-16T17:27:52.260361465Z] [graphdriver] using prior storage driver: overlay2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 1262c57714e694193be6bbcbed83e859dc246c2f
Component: engine
2017-11-21 15:42:04 +01:00
6063e62a1f Remove unused "testutil" package
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 47af9f625d3f9e94729ec5aee4abcce813914d07
Component: engine
2017-11-21 15:09:23 +01:00
d0d7235731 Remove deprecated MkdirAllAs(), MkdirAs()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 38b3af567f676c4c35e80e493aa97b7346ae75e4
Component: engine
2017-11-21 13:53:54 +01:00
9282ca8404 Minor refactor in idtools
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: ce66470f5404872db2cbaa7fbd59970700144be2
Component: engine
2017-11-21 13:49:58 +01:00
d4007aa747 Update idtools tests to test non-deprecated functions
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 9aba019b72611119578ea32adb03fa49f73da522
Component: engine
2017-11-21 13:47:17 +01:00
4e6f892dc4 Merge pull request #708 from dnephin/update-cobra
Update spf13/cobra, fixes usages in generated man pages
Upstream-commit: 2d0e2d22ca
Component: cli
2017-11-21 10:51:25 +01:00
c051f4a135 Merge pull request #35547 from thaJeztah/fix-make-test
Fix "make test" failing on missing "test-unit"
Upstream-commit: dc7ba2ca3ba7abd1aa4dbbcb3c42dace1b6d3545
Component: engine
2017-11-21 10:49:38 +01:00
6e7cb1931d Fix "duplicate mount point" when --tmpfs /dev/shm is used
This is a fix to the following issue:

$ docker run --tmpfs /dev/shm busybox sh
docker: Error response from daemon: linux mounts: Duplicate mount point '/dev/shm'.

In current code (daemon.createSpec()), tmpfs mount from --tmpfs is added
to list of mounts (`ms`), when the mount from IpcMounts() is added.
While IpcMounts() is checking for existing mounts first, it does that
by using container.HasMountFor() function which only checks container.Mounts
but not container.Tmpfs.

Ultimately, the solution is to get rid of container.Tmpfs (moving its
data to container.Mounts). Current workaround is to add checking
of container.Tmpfs into container.HasMountFor().

A unit test case is included.

Unfortunately we can't call daemon.createSpec() from a unit test,
as the code relies a lot on various daemon structures to be initialized
properly, and it is hard to achieve. Therefore, we minimally mimick
the code flow of daemon.createSpec() -- barely enough to reproduce
the issue.

https://github.com/moby/moby/issues/35455

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 1861abdc4a31efad202a5c3d89a895bb7a62799a
Component: engine
2017-11-20 18:48:27 -08:00
69bca6d97b container.NetworkMounts(): don't lookup mounts twice
The code in question looks up mounts two times: first by using
HasMountFor(), and then directly by looking in container.MountPoints.
There is no need to do it twice.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: eab3ac3e70a510b97f9399efd13e3dc01a07c413
Component: engine
2017-11-20 18:48:27 -08:00
63aefcb844 Update hcsshim to v0.6.7 for go1.9 support
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: 0bee8049c78c635b8a38064483e4c3c788779345
Component: engine
2017-11-20 16:29:01 -08:00
3cf67e0ba5 Merge pull request #35517 from stevvooe/protect-the-health-status
container: protect the health status with mutex
Upstream-commit: 9de84a78d76ed2ffe386fe21466f7401cf5d2e9d
Component: engine
2017-11-20 21:51:47 +01:00
325141c0ef Merge pull request #35495 from simonferquel/isolation-validation
Added validation of isolation settings on daemon.verifyContainerSettings
Upstream-commit: a9aeb18a0996eed4b3402ba0431269d46f5ad497
Component: engine
2017-11-20 12:09:40 -08:00
276378cfb9 Fix "make test" failing on missing "test-unit"
Commit dbf580be57a4bb854d7ce20d313e3a22ea337be5 removed
this helper script because it's no longer used in CI.

However, the "make test" target in the Makefile still
called this helper, resulting it to fail.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: a17071e88f15625a6be19f80c697ab1c3471381b
Component: engine
2017-11-20 19:12:25 +01:00
408fe754a6 Merge pull request #705 from scipio3000/patch-1
Docs - Typo in volume plugin doc
Upstream-commit: 10e04c4b72
Component: cli
2017-11-20 18:55:51 +01:00
5289d7ae1c Disable adding [flags] to UseLine in man pages
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 5b4af39b8d
Component: cli
2017-11-20 12:48:10 -05:00
1da9654cd5 Update spf13/cobra
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: c01f642800
Component: cli
2017-11-20 12:42:11 -05:00
454988ca17 Merge pull request #35542 from masaeedu/patch-1
Fix consumes MIME type for NetworkConnect
Upstream-commit: 4f4a0279084921756d2b2157ad272610d7adc0ae
Component: engine
2017-11-20 18:13:26 +01:00
c23d72ffe9 Docs - Typo in volume plugin doc
There is a typo in the `plugins_volume.md#volumedriverpath` section.
The `/VolumeDriver.Path` response (v1) should be `Mountpoint`and not `Mountpoin`.

Signed-off-by: scipio3000 <gunther@gameslabs.net>
Signed-off-by: Günther Jungbluth <gunther@gameslabs.net>
Upstream-commit: e575b8e756
Component: cli
2017-11-20 15:56:09 +01:00
38076c34e8 Added validation of isolation settings on daemon.verifyContainerSettings
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
Upstream-commit: e6bfe9cdcb32e97f38b53781eb1f9d7bd2ef5971
Component: engine
2017-11-20 10:34:20 +01:00
be9497fbf4 Fix consumes MIME type for NetworkConnect
This route expects `application/json`. Sending a content type header of `application/octet-stream` results in an error.

Signed-off-by: Asad Saeeduddin <masaeedu@gmail.com>
Upstream-commit: 876b32861789a0424557c640622bde47eedd2d98
Component: engine
2017-11-18 22:34:23 -05:00
23f0e9211c Merge pull request #35522 from kolyshkin/gd-custom
graphdriver: custom build-time priority list
Upstream-commit: edc204b1ffd53252649917fe54daa0b8419ed4ec
Component: engine
2017-11-17 15:48:26 -08:00
e533bd8d7a Merge pull request #35526 from brauner/2017-11-16/docker_xfs_quota_userns
skip xfs quota tests when running in user namespace
Upstream-commit: 8124d21d2ad7666e73551fcc317c109c6a02e122
Component: engine
2017-11-17 13:41:58 -05:00
5ddac3b8e8 Merge pull request #700 from rodolfoortiz/patch-1
Fixed misspelling
Upstream-commit: f6395c848c
Component: cli
2017-11-17 19:20:57 +01:00
efb2ed5d5e Add bash completion for logs --until
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 667dead8b7
Component: cli
2017-11-17 18:45:05 +01:00
afb12468a8 Add bash completion for trust sign --local
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: c29459c284
Component: cli
2017-11-17 18:30:38 +01:00
0acfb79b17 Fixed misspelling
Signed-off-by: Rodolfo Ortiz <rodolfo.ortiz@definityfirst.com>
Upstream-commit: c7d8561508
Component: cli
2017-11-17 11:27:49 -06:00
f9712fa620 Merge pull request #426 from simonferquel/service-isolation
--isolation for setting swarm service isolation mode
Upstream-commit: 5e2be6584a
Component: cli
2017-11-17 15:39:43 +01:00
c5471a4a0e Add isolation mode on service update/create and compose files
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
Upstream-commit: 47cf2ea683
Component: cli
2017-11-17 15:31:13 +01:00
7e12c15274 Preparing for compose schema v3.5
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
Upstream-commit: 787e30d57a
Component: cli
2017-11-17 15:30:32 +01:00
94aae8ab65 Skip further checks for quota in user namespaces
Commit 7a1618ced359a3ac921d8a05903d62f544ff17d0 regresses running Docker
in user namespaces. The new check for whether quota are supported calls
NewControl() which in turn calls makeBackingFsDev() which tries to
mknod(). Skip quota tests when we detect that we are running in a user
namespace and return ErrQuotaNotSupported to the caller. This just
restores the status quo.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Upstream-commit: 7e35df0e0484118740dbf01e7db9b482a1827ef1
Component: engine
2017-11-17 12:57:27 +01:00
6937a74b64 Supress warning when NONE was set for healthcheck
Change-Id: I9ebcf49e9e8ac76beb037779ad02ac6020169849
Signed-off-by: Li Yi <denverdino@gmail.com>
Upstream-commit: e987c554c9ff0740b9945e68228b141031bb31c6
Component: engine
2017-11-17 19:43:59 +08:00
3be11a0388 Merge pull request #697 from squeegels/patch-1
Fixed typo under User section
Upstream-commit: d981bfa964
Component: cli
2017-11-17 09:31:06 +01:00
83579492a6 Fixed typo under User section
Signed-off-by: root <root@clientele.co.za>
Signed-off-by: Squeegels <lmscrewy@gmail.com>
Signed-off-by: Squeegels <1674195+squeegels@users.noreply.github.com>
Upstream-commit: 032f676717
Component: cli
2017-11-17 09:47:41 +02:00
0db60dff81 graphdriver: custom build-time priority list
Add a way to specify a custom graphdriver priority list
during build. This can be done with something like

  go build -ldflags "-X github.com/docker/docker/daemon/graphdriver.priority=overlay2,devicemapper"

As ldflags are already used by the engine build process, and it seems
that only one (last) `-ldflags` argument is taken into account by go,
an envoronment variable `DOCKER_LDFLAGS` is introduced in order to
be able to append some text to `-ldflags`. With this in place,
using the feature becomes

  make DOCKER_LDFLAGS="-X github.com/docker/docker/daemon/graphdriver.priority=overlay2,devicemapper" dynbinary

The idea behind this is, the priority list might be different
for different distros, so vendors are now able to change it
without patching the source code.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 17708e72a7ef29fb1d4b03fbded1c5e4c08105fd
Component: engine
2017-11-16 19:43:34 -08:00
a1c54edb95 container: protect the health status with mutex
Adds a mutex to protect the status, as well. When running the race
detector with the unit test, we can see that the Status field is written
without holding this lock. Adding a mutex to read and set status
addresses the issue.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 7db30ab0cdf072956d2ceda833b7de22fe17655c
Component: engine
2017-11-16 15:04:01 -08:00
884d22e3a4 Merge pull request #695 from mistyhacks/update-service-port-syntax
Add info about new port mapping syntax
Upstream-commit: 0fe5dcd2f2
Component: cli
2017-11-16 17:36:44 +01:00
42bb16a0de Merge pull request #35512 from cpuguy83/replace_plugun_integration_with_unit
Replace vol plugin integration test w/ unit test
Upstream-commit: ab90bc296155f341f8315a265b3c6d8112512db2
Component: engine
2017-11-16 17:35:23 +01:00
4d629f82fb Add missing lock in ProcessEvent
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 6c03aa317404703a300ef25c3b5dc18d8e9cc64c
Component: engine
2017-11-15 19:19:26 -08:00
f78101e94a Add info about new port mapping syntax
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: 9ef7caa6fe
Component: cli
2017-11-15 17:58:13 -08:00
e26667240b Merge pull request #693 from eiais/e2e
Add e2e testing for Trust revoke
Upstream-commit: 9022ea549d
Component: cli
2017-11-15 20:39:53 +01:00
ac513c6164 Merge pull request #671 from dnephin/remove-secret-config-duplication
Remove secret/config duplication in cli/compose
Upstream-commit: 801ddee343
Component: cli
2017-11-15 19:29:39 +01:00
9ef2726179 Replace vol plugin integration test w/ unit test
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 00d801dd85b486eb46eff7bd041c33f04e373699
Component: engine
2017-11-15 13:13:22 -05:00
8771152e42 Merge pull request #35429 from dnephin/build-fails-on-long-label
Fix dockerfile parser failing silently on long tokens
Upstream-commit: 7c53e732530642f817c83e1ad303f8f9f7018def
Component: engine
2017-11-15 18:48:50 +01:00
cffc0c967c Merge pull request #35492 from thaJeztah/bump-docker-py
Bump docker-py to 1d6b5b203222ba5df7dedfcd1ee061a452f99c8a
Upstream-commit: a5c679baf66488e89ccf93c2282b96673acbcb0e
Component: engine
2017-11-15 07:31:14 -08:00
55c5f024c9 Merge pull request #35504 from kolyshkin/sep-o2
daemon/graphdriver/register: separate overlay2
Upstream-commit: fa1054843f9a8a32ca33be6b73167069a8344ecf
Component: engine
2017-11-15 09:21:08 -05:00
3647d18f55 Merge pull request #35499 from cpuguy83/erroneous_errors
Cancelation errors should not be logged
Upstream-commit: 7c16e4d41769bcedfd987507ac150f516358a120
Component: engine
2017-11-15 11:34:28 +01:00
ce594a83b1 daemon/graphdriver/register: separate overlay2
Make it possible to disable overlay and overlay2 separately.

With this commit, we now have `exclude_graphdriver_overlay` and
`exclude_graphdriver_overlay2` build tags for the engine, which
is in line with any other graph driver.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: d014be5426c869d429c1a11cad9e76321dd7a326
Component: engine
2017-11-15 00:06:00 -08:00
ae3d074947 Cancelation errors should not be logged
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: b86746d60d4c43dcadd3b95fc4b2da7c03323d84
Component: engine
2017-11-14 20:32:20 -05:00
005014677c Merge pull request #34896 from cpuguy83/store_labels_when_exists
Create labels when volume exists only remotely
Upstream-commit: f62aeae97791b4c2318791a9b621d7da4c17ac32
Component: engine
2017-11-14 17:05:40 -08:00
6ad432f442 Merge pull request #35482 from stevvooe/protect-health-monitor-channel
container: protect health monitor channel
Upstream-commit: e4d0fe84f9ea88b0e0cfd847412c9f29442cc62d
Component: engine
2017-11-14 11:25:14 -08:00
8b37566333 Adds packaging for Fedora 27
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: ca096b9620cf1d8c1d0a34f052e3a3d33840fab3
Component: packaging
2017-11-14 19:13:47 +00:00
cf38fd827e Merge pull request #74 from jamiehannaford/until-logging
Add new CLI option for --until
Upstream-commit: 026c6db6f6
Component: cli
2017-11-14 18:49:46 +01:00
68402034cc Set timeout on splunk batch send
Before this change, if the splunk endpoint is blocked it will cause a
deadlock on `Close()`.
This sets a reasonable timeout for the http request to send a log batch.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 24087399d95d60be4184b9ed3eba56466878b4e1
Component: engine
2017-11-14 12:32:52 -05:00
e9b472f2e1 Add docs
Signed-off-by: Jamie Hannaford <jamie@limetree.org>
Upstream-commit: 0450a2f437
Component: cli
2017-11-14 18:04:10 +01:00
4bd3446b2b Merge pull request #35231 from sargun/add-vfs-quota-support
Add vfs quota support
Upstream-commit: 0defc6981322e16863e068f99b98326394b8cbd0
Component: engine
2017-11-14 15:05:02 +00:00
d8cda430a7 Bump docker-py to 1d6b5b203222ba5df7dedfcd1ee061a452f99c8a
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: d1a0773d3a834a4bfa98deb07ae3f87dd6438da6
Component: engine
2017-11-14 14:17:44 +01:00
15db98f6fa Merge pull request #35465 from cpuguy83/update_containerd
Update containerd to v1 beta3
Upstream-commit: b4fbcd80c796f384eba800d1dc89892ab77c58e5
Component: engine
2017-11-14 14:01:48 +01:00
2cc0ade7cc Merge pull request #35484 from tonistiigi/clear-state
libcontainerd: fix leaking container/exec state
Upstream-commit: 1c99bc481be6abf40d4fd287d1b6634a6108a211
Component: engine
2017-11-14 11:15:30 +01:00
6f6f835501 Merge pull request #35316 from kolyshkin/facepalm
Fix honoring tmpfs-size for user /dev/shm mount
Upstream-commit: f70c715be01f5d5f4a8be4ab1b2c6e1464b478a7
Component: engine
2017-11-14 11:13:59 +01:00
523ff46adb Merge pull request #35456 from dnephin/make-runconfig-copy-deep
[Builder] Make copyRunConfig deep copy
Upstream-commit: f520822453a01673f38ed6b0ce86c52d71e43a0d
Component: engine
2017-11-14 11:12:26 +01:00
7b0db0e401 Merge pull request #691 from PatrickLang/patricklang-user
Docs - Adding note about creating Windows users
Upstream-commit: 50d218bd06
Component: cli
2017-11-14 11:10:56 +01:00
31c1f92623 integration: test case for #35271
This test case is checking that the built-in default size for /dev/shm
(which is used for `--ipcmode` being `private` or `shareable`)
is not overriding the size of user-defined tmpfs mount for /dev/shm.

In other words, this is a regression test case for issue #35271,
https://github.com/moby/moby/issues/35271

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 2e0a98b605fa278ee1f348c68fe7e07aed57b834
Component: engine
2017-11-13 22:08:23 -08:00
ca97ddf678 add e2e testing for trust revoke
Signed-off-by: Kyle Spiers <kyle@spiers.me>
Upstream-commit: 4a93f207a3
Component: cli
2017-11-13 17:18:10 -08:00
146e3d30b9 e2e tests: refactor using fixtures
Signed-off-by: Kyle Spiers <kyle@spiers.me>
Upstream-commit: cbd78572a7
Component: cli
2017-11-13 17:18:04 -08:00
ce5c429be8 libcontainerd: fix leaking container/exec state
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 6c4ce7cb6c62fb82ed2db1d4ee3a02bc5148cdee
Component: engine
2017-11-13 15:48:21 -08:00
2ca8cee39b Disallow overlay/overlay2 on top of NFS
From https://www.kernel.org/doc/Documentation/filesystems/overlayfs.txt:

> The lower filesystem can be any filesystem supported by Linux and does
> not need to be writable. The lower filesystem can even be another
> overlayfs. The upper filesystem will normally be writable and if it
> is it must support the creation of trusted.* extended attributes, and
> must provide valid d_type in readdir responses, so NFS is not suitable.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 90dfb1d0cc59d79ccb272997d735864615010785
Component: engine
2017-11-13 23:24:23 +01:00
10c7697134 container: protect health monitor channel
While this code was likely called from a single thread before, we have
now seen panics, indicating that it could be called in parallel. This
change adds a mutex to protect opening and closing of the channel. There
may be another root cause associated with this panic, such as something
that led to the calling of this in parallel, as this code is old and we
had seen this condition until recently.

This fix is by no means a permanent fix. Typically, bugs like this
indicate misplaced channel ownership. In idiomatic uses, the channel
should have a particular "owner" that coordinates sending and closure.
In this case, the owner of the channel is unclear, so it gets opened
lazily. Synchronizing this access is a decent solution, but a refactor
may yield better results.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 5b55747a523671fa6e626848060460a48d058451
Component: engine
2017-11-13 13:31:28 -08:00
60d1b81b0d Add deepCopyRunConfig for copying buidler runConfig
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 9bcd5d2574fe0c84542d2fa18232c34e2a9c0cac
Component: engine
2017-11-13 14:51:17 -05:00
66527d3a87 Adding note about creating Windows users
Signed-off-by: Patrick Lang <plang@microsoft.com>
Upstream-commit: cc35724c17
Component: cli
2017-11-13 11:43:38 -08:00
293c21ca60 Remove deprecated "daemon" subcommand
The `docker daemon` subcommand was only present for
backward compatibility, but deprecated in v1.13,
and scheduled for removal in v17.12

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: c6a3199236
Component: cli
2017-11-13 19:01:35 +01:00
6a81f7db2e Merge pull request #35473 from charrywanganthony/rm_stringutils
Split and remove pkg/stringutils
Upstream-commit: aea31ab242a1e5f489f1597a726267ed190a3095
Component: engine
2017-11-13 18:10:32 +01:00
2ee46bd08b Merge pull request #685 from eiais/e2e
docker trust sign: add e2e testing
Upstream-commit: 365c525fab
Component: cli
2017-11-13 17:31:42 +01:00
628966a8d4 Bump runc vendor
Updates runc to b2567b37d7b75eb4cf325b77297b140ea686ce8f which removes
some cross-repo dependencies.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: af248a3fe087805907e4b69ab017ef60d44ce093
Component: engine
2017-11-13 08:57:09 -05:00
e18edc6a6b add test for logs
Signed-off-by: Jamie Hannaford <jamie@limetree.org>
Upstream-commit: 9c9303e113
Component: cli
2017-11-13 10:57:44 +01:00
ca631a390a Merge pull request #35470 from thaJeztah/error-on-duplicate-labels
Remove deprecated support for duplicate label-keys
Upstream-commit: d5b9da206ae57255d8de490a7db8eb3ddbb590bd
Component: engine
2017-11-13 10:57:28 +01:00
f9f5db27c1 Fix user mount /dev/shm size
Commit 7120976d74195 ("Implement none, private, and shareable ipc
modes") introduces a bug: if a user-specified mount for /dev/shm
is provided, its size is overriden by value of ShmSize.

A reproducer is simple:

 docker run --rm
	--mount type=tmpfs,dst=/dev/shm,tmpfs-size=100K \
	alpine df /dev/shm

This commit is an attempt to fix the bug, as well as optimize things
a but and make the code easier to read.

https://github.com/moby/moby/issues/35271

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 31d30a985d99a0eef92116a22159727f5c332784
Component: engine
2017-11-12 21:42:59 -08:00
8369aeca8e Split and remove pkg/stringutils
Signed-off-by: Chao Wang <wangchao.fnst@cn.fujitsu.com>
Upstream-commit: 97e406678c8d695ee6eaefce41b83e9e27e239c7
Component: engine
2017-11-13 10:01:11 +08:00
aa1c9fab4f Remove deprecated support for duplicate label-keys
Support for duplicate labels (but different values) was
deprecated in commit e4c9079d091a2eeac8a74a0356e3f348db873b87
(Docker 1.13), and scheduled for removal in 17.12

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 8c6322338c91cdb88b1fef4def393d9a7b670366
Component: engine
2017-11-12 03:11:37 +01:00
6729c4835f Merge pull request #686 from mvasin/patch-1
Fix grammar
Upstream-commit: 48f4003591
Component: cli
2017-11-11 15:45:39 +01:00
7cf0bd287e Fix grammar
Signed-off-by: Mikhail Vasin <michaelvasin@gmail.com>
Upstream-commit: bdd1b1e279
Component: cli
2017-11-11 16:15:15 +03:00
f5ae1accb6 Add e2e testing for docker trust sign
Signed-off-by: Kyle Spiers <kyle@spiers.me>
Upstream-commit: eb025800bd
Component: cli
2017-11-10 14:26:11 -08:00
5aa9076d56 Add unit tests for some convert/service
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: f1cc679618
Component: cli
2017-11-10 16:28:39 -05:00
50743f5357 Remove duplication in compose/convert
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: a68c940f1a
Component: cli
2017-11-10 15:56:11 -05:00
a1783b999b Remove duplication in loader
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 7bd26ed690
Component: cli
2017-11-10 15:56:11 -05:00
9379e66070 Update containerd to v1 beta3
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: d3f934e304d78296e606d6e3a2ca523d249e954c
Component: engine
2017-11-10 15:44:10 -05:00
75f89d26b4 sign test: fix imports
Signed-off-by: Kyle Spiers <kyle@spiers.me>
Upstream-commit: a570e9b355
Component: cli
2017-11-10 11:34:04 -08:00
a754767196 Merge pull request #684 from mistyhacks/fix-spaces-service-create
Remove extra spaces from service creation examples
Upstream-commit: 70da09aac2
Component: cli
2017-11-10 11:18:15 -08:00
d77f572b3a Remove extra spaces from service creation examples
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: 80211acee9
Component: cli
2017-11-10 10:14:56 -08:00
d94b0d4775 Merge pull request #35342 from charrywanganthony/inslice
Copy Inslice() to those parts that use it
Upstream-commit: 97be2a075225945ca7b92d75f85048cfd05a3a71
Component: engine
2017-11-10 07:26:42 -08:00
dcbe5b1182 Add new CLI option for --until
Signed-off-by: Jamie Hannaford <jamie.hannaford@rackspace.com>
Upstream-commit: 6f309316e2
Component: cli
2017-11-10 12:38:08 +01:00
98da414257 Copy Inslice() to those parts that use it
Signed-off-by: Chao Wang <wangchao.fnst@cn.fujitsu.com>
Upstream-commit: 5c154cfac89305f7ca9446854e56700e8a660f93
Component: engine
2017-11-10 13:42:38 +08:00
32672a8e2b Merge pull request #35453 from cpuguy83/update_fsnotify
Update fsnotify to fix deadlock in removing watch
Upstream-commit: dc90c3047e1cc59770395ded86128305e3d24543
Component: engine
2017-11-09 18:29:31 -08:00
8d5384d97c Merge pull request #35454 from cpuguy83/move_env_declaration
COPY should be the last op in the Dockerfile
Upstream-commit: 45e9630b48b99ab86a88dd9a593604810b8400b6
Component: engine
2017-11-10 10:17:21 +09:00
366ab9966c COPY should be the last op in the Dockerfile
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 503b03a3f090550052af960ece2e71d54c1fdf0e
Component: engine
2017-11-09 16:00:28 -05:00
2f7df6c0dd Update fsnotify to fix deadlock in removing watch
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: e8aa22645baf8f8254cc435e772314d4a5dee92c
Component: engine
2017-11-09 15:17:22 -05:00
7918ee610f Create labels when volume exists only remotely
Before this, if a volume exists in a driver but not in the local cache,
the store would just return a bare volume. This means that if a user
supplied options or labels, they will not get stored.

Instead only return early if we have the volume stored locally. Note
this could still have an issue with labels/opts passed in by the user
differing from what is stored, however this isn't really a new problem.

This fixes a problem where if there is a shared storage backend between
two docker nodes, a create on one node will have labels stored and a
create on the other node will not.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 4d8598ad0506b29c12632c1b8ed92eb58fc2f0e2
Component: engine
2017-11-09 15:14:06 -05:00
84fe2b7d9a Fix remote build target as Dockerfile
The test was passing previously because the preamble was already buffered. After
the change to return Scanner.Err() the final read error on the buffer was no
longer being ignored.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: a74cc833450dfc48cc95b2b109cbcb24feff4929
Component: engine
2017-11-09 15:05:26 -05:00
ca892e4f1a Fix dockerfile parser failing silently on long tokens
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 59ad3a36e2684bd36a4b02179949bd17f1406918
Component: engine
2017-11-09 15:03:20 -05:00
2bb50cbf78 Merge pull request #35250 from joppich/patch-1
Update names-generator.go
Upstream-commit: a4bdb304e29f21661e8ef398dbaeb8188aa0f46a
Component: engine
2017-11-09 06:21:02 -08:00
c716c066e5 Merge pull request #35442 from Microsoft/jjh/sysfirmware
Don't special case /sys/firmware in masked paths
Upstream-commit: d4239a6e286f546f5eda507437f643b5a1548c5d
Component: engine
2017-11-08 20:02:01 -08:00
bcc50083eb Merge pull request #35073 from mle-ii/master
Add gelf log driver plugin to Windows build
Upstream-commit: 72e179aa04999c141db96688adabfe5bcdac8293
Component: engine
2017-11-08 14:53:56 -08:00
61e5c2b6ed Merge pull request #35427 from sjeeva/master
fixed special character
Upstream-commit: 9cd6ce18af3444af58544fac3405c01818e0d388
Component: engine
2017-11-08 23:36:01 +01:00
e0e98f749d Don't special case /sys/firmware in masked paths
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: b023a46a074c14d34e09d774c9e847343541a220
Component: engine
2017-11-08 12:10:42 -08:00
6dd3e92796 Merge pull request #679 from thaJeztah/revendor-moby
Bump moby to f4d4f5863156b82ef146b6ff1e845f8dcf019f12
Upstream-commit: 458ce53f18
Component: cli
2017-11-08 14:55:54 -05:00
e52bfcca39 fixed special character
`scope`=<string> local or swarm had special character, which was breaking the Swagger UI

Signed-off-by: Jeeva S. Chelladhurai <sjeeva@gmail.com>
Upstream-commit: a21654c34b741656582b09e09127821311909dcd
Component: engine
2017-11-08 19:17:24 +00:00
8a571d7e05 Bump moby to f4d4f5863156b82ef146b6ff1e845f8dcf019f12
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 5735fff6fc
Component: cli
2017-11-08 17:50:58 +01:00
3e8332108b Merge pull request #34573 from cyphar/dm-dos-prevention-remove-mountpoint
devicemapper: remove container rootfs mountPath after umount
Upstream-commit: bbc4f78ba9c77f5a2e177c69870efed0eb7e8ba2
Component: engine
2017-11-08 17:08:07 +01:00
1fce7e41ce Add bash completion for experimental build --stream
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: c852393bff
Component: cli
2017-11-08 14:32:14 +01:00
ce00560e17 Add --log-opt awslogs-credentials-endpoint to bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 1390ae6022
Component: cli
2017-11-08 14:07:05 +01:00
49cfe581ba Add support for GELF tcp connections to bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: c231c381fe
Component: cli
2017-11-08 13:54:51 +01:00
96ed9e5d58 Merge pull request #35423 from thaJeztah/bump-image-spec
Bump opencontainers/image-spec to v1.0.0
Upstream-commit: f4d4f5863156b82ef146b6ff1e845f8dcf019f12
Component: engine
2017-11-08 09:37:16 +09:00
95cc30e089 devmapper: add a test for mount leak workaround
In order to avoid reverting our fix for mount leakage in devicemapper,
add a test which checks that devicemapper's Get() and Put() cycle can
survive having a command running in an rprivate mount propagation setup
in-between. While this is quite rudimentary, it should be sufficient.

We have to skip this test for pre-3.18 kernels.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
Upstream-commit: 1af8ea681fba1935c60c11edbbe19b894c9b286f
Component: engine
2017-11-08 11:02:11 +11:00
dfd681c198 Merge pull request #35424 from cyphar/tar-split-cve_2017_14992
vendor: update to github.com/vbatts/tar-split@v0.10.2
Upstream-commit: bd8ed57506a82a8ec3d69cd272ef8f5942c4b977
Component: engine
2017-11-07 23:09:38 +01:00
edb2c3c5b1 Merge pull request #575 from eiais/local-flag
trust sign: add --local flag
Upstream-commit: ee0615dc97
Component: cli
2017-11-07 14:15:53 -05:00
22a9ee4f49 image: add import test for CVE-2017-14992
To ensure that we don't revert CVE-2017-14992, add a test that is quite
similar to that upstream tar-split test (create an empty archive with
lots of junk and make sure the daemon doesn't crash).

Signed-off-by: Aleksa Sarai <asarai@suse.de>
Upstream-commit: 0a13f827a10d3bf61744d9b3f7165c5885a39c5d
Component: engine
2017-11-08 05:37:52 +11:00
dbf5fa6264 Merge pull request #35265 from cpuguy83/32609_defreference_voldriver_on_error
Fixup some issues with plugin refcounting
Upstream-commit: 5745a8531e7a52d4db09f2eafde0391b59a13b4b
Component: engine
2017-11-07 09:47:07 -08:00
c18684ecbe internal: testutil: add DevZero helper
This helper acts like /dev/zero (outputs \x00 indefinitely) in an
OS-independent fashion. This ensures we don't need to special-case
around Windows in tests that want to open /dev/zero.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
Upstream-commit: 2f8d3e1c33f77187c68893803018756d43daff15
Component: engine
2017-11-08 03:45:55 +11:00
755085f5c8 Merge pull request #35419 from johnstep/handle-scratch-image-os
Set OS on scratch image and prevent panic if empty
Upstream-commit: 2f22f64d5561dc39e70353566ba4f84f02b980c7
Component: engine
2017-11-07 08:32:27 -08:00
19146bf34e vendor: update to github.com/vbatts/tar-split@v0.10.2
Update to the latest version of tar-split, which includes a change to
fix a memory exhaustion issue where a malformed image could cause the
Docker daemon to crash.

  * tar: asm: store padding in chunks to avoid memory exhaustion

Fixes: CVE-2017-14992
Signed-off-by: Aleksa Sarai <asarai@suse.de>
Upstream-commit: e0ff7cccc3cac73da41ec9ef007b0e4e97c55d01
Component: engine
2017-11-08 02:50:52 +11:00
e49f1e9075 Bump opencontainers/image-spec to v1.0.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: c5ccc7f73fecfa881a8ff9ddc5032892223204ee
Component: engine
2017-11-07 16:16:09 +01:00
72aededa94 Merge pull request #35326 from RenaudWasTaken/swarmkit-revendored
Revendored Swarmkit 
Upstream-commit: eec662bbee7eace06f4fa7088dd2311a03a65858
Component: engine
2017-11-07 06:56:15 -08:00
22f416c376 Merge pull request #670 from dnephin/cleanup-compose-volume-name
Only warn on volume.external.name for version 3.4
Upstream-commit: 025f51ca93
Component: cli
2017-11-07 14:29:22 +01:00
ce8d7a3b24 Merge pull request #474 from jhowardmsft/jjh/apis-for-platform
LCOW: CLI changes to add platform flag - pull, run, create and build
Upstream-commit: 042575aac9
Component: cli
2017-11-07 14:26:31 +01:00
9302e76682 Merge pull request #657 from dnephin/add-test-for-container-cp
Adding unit tests for container cp
Upstream-commit: 21d88629df
Component: cli
2017-11-07 14:22:22 +01:00
7cfb40e0bf Set OS on scratch image and prevent panic if empty
Signed-off-by: John Stephens <johnstep@docker.com>
Upstream-commit: a97817b673cbd3bfaf6e752282c4992ac43ff594
Component: engine
2017-11-06 18:22:15 -08:00
bab1ef9f35 Add quota support to VFS graphdriver
This patch adds the capability for the VFS graphdriver to use
XFS project quotas. It reuses the existing quota management
code that was created by overlay2 on XFS.

It doesn't rely on a filesystem whitelist, but instead
the quota-capability detection code.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Upstream-commit: 7a1618ced359a3ac921d8a05903d62f544ff17d0
Component: engine
2017-11-06 15:53:51 -08:00
127d797434 Only warn on volume.external.name for version 3.4
Also remove use of volume.external.name

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: aea9544db5
Component: cli
2017-11-06 17:04:36 -05:00
aee7705a5f Added NodeGenericResource config tests
Signed-off-by: Renaud Gaubert <renaud.gaubert@gmail.com>
Upstream-commit: 734346a37e0cd5d2576f759d302beed5033ff14e
Component: engine
2017-11-06 21:47:26 +01:00
e5124fd7ef Updated GenericResource CLI
Signed-off-by: Renaud Gaubert <renaud.gaubert@gmail.com>
Upstream-commit: ebe14310b7728cca6d092ff66236577a3f3016d5
Component: engine
2017-11-06 21:47:26 +01:00
ae808b0eb3 Merge pull request #35398 from thaJeztah/fix-api-version-for-until-option
Move "until" option to correct API version
Upstream-commit: b00b1b1c40750dd0239fb30e421686b63b4183bd
Component: engine
2017-11-05 07:23:42 -05:00
f0b2e74732 Merge pull request #35394 from chris-crone/e2e-add-headers
Add missing headers for e2e test image build
Upstream-commit: ee21669f5329733cced55e1c678cd6cee393a6e4
Component: engine
2017-11-05 09:50:54 +01:00
59e0e866f3 Merge pull request #34162 from cpuguy83/move_logread_logic
Move jsonlog read logic
Upstream-commit: edaba571bac5d9dfaaa1b0b7c601ad712cae58d3
Component: engine
2017-11-04 13:53:36 -07:00
63e16f39ad Merge pull request #35244 from joyce/joyce/todo-fixes
fix todo for printing error messages
Upstream-commit: 48694a3f880650a1b41765ab0bebb373d0b73a22
Component: engine
2017-11-04 13:52:45 -07:00
dff2ac1e17 Move json log reading into log file object
This allows much of the read logic to be shared for other things,
especially for the new log driver proposed in
https://github.com/moby/moby/issues/33475

The only logic for reads in the json logger is around decoding log
messages, which gets passed into the log file object.

This also helps with implementing compression as it allows us to
simplify locking strategies.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 16f7cd674902b69b97692de2a83915a1a6be2cdb
Component: engine
2017-11-04 08:31:58 -04:00
70ca1da8d3 Refactor log file writer
Make the `*RotateFileWriter` specifically about writing
`logger.Message`'s, which is what it's used for.

This allows for future changes where the log writer can cache details
about log entries such as (e.g.) the timestamps included in a particular
log file, which can be used to optimize reads.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 52d82b4fbc9f0fe00f63e2df9a3d2a49d4095bda
Component: engine
2017-11-04 08:15:20 -04:00
18aef1e39d Merge pull request #35404 from tonistiigi/stream-ctx-fix
builder: fix long stream sync
Upstream-commit: 2c1043c913b3d2313e5558825f3dc8fc1727042b
Component: engine
2017-11-04 01:07:06 +01:00
b9b2e53e40 builder: fix long stream sync
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: c6703b722e1c0914342d61ca6af77aea93150873
Component: engine
2017-11-03 12:53:17 -07:00
cffa465570 Merge pull request #35399 from justincormack/mask-scsi
Add /proc/scsi to masked paths
Upstream-commit: a8cefcf6af6c6bfa1d60a2d9deb80a01ce008690
Component: engine
2017-11-03 11:58:20 -07:00
6edab5bbbd fix todo for printing error messages
Signed-off-by: Joyce <mail@joycejang.com>
Upstream-commit: 883ab41ce8f5163ba8ce0450ffff1e63c266f23b
Component: engine
2017-11-03 11:35:41 -07:00
61e2a38de5 Add /proc/scsi to masked paths
This is writeable, and can be used to remove devices. Containers do
not need to know about scsi devices.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: a21ecdf3c8a343a7c94e4c4d01b178c87ca7aaa1
Component: engine
2017-11-03 15:12:22 +00:00
84f5991ee5 Move "until" option to correct API version
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 6f34bd6f968be243659ad62976822036f4f4eb17
Component: engine
2017-11-03 16:11:07 +01:00
5de35938b7 Merge pull request #32914 from jamiehannaford/until-logging
Add --until flag for docker logs; closes #32807
Upstream-commit: 68a4552529c2eafb7093dc2bc25e7fc243bf363f
Component: engine
2017-11-03 16:08:30 +01:00
ab9214e3c9 Merge pull request #35368 from dnephin/remove-version-file
Remove version file
Upstream-commit: 47a1786be2a2f1458eea5e39e8e93c375cd6fdaa
Component: engine
2017-11-03 07:58:37 -07:00
7264e2410c Revendored swarmkit
Signed-off-by: Renaud Gaubert <renaud.gaubert@gmail.com>
Upstream-commit: b3960fc1c450961ef3f31d6db21ac237d1b4d99d
Component: engine
2017-11-03 15:43:50 +01:00
fc04cb890d Merge pull request #35365 from Microsoft/jjh/removeduplicateoomscoreadj
Remove duplicate redundant setting of OOMScoreAdj in OCI spec
Upstream-commit: f5c70c5b75238804be39f048eef6aad9cc0cd166
Component: engine
2017-11-03 13:59:51 +00:00
593039ced7 Merge pull request #35383 from thaJeztah/new-misty-handle
Update Misty's GitHub handle
Upstream-commit: 7801be2eee987013cc20148d0335f42bec618835
Component: engine
2017-11-03 12:59:47 +01:00
ca401e539a Merge pull request #35168 from justincormack/update-contributing
First pass updating CONTRIBUTING
Upstream-commit: dfbf0f2e915696740e4d4dd3fb9877f676ead9f0
Component: engine
2017-11-03 12:57:21 +01:00
4aac83aaac First pass updating CONTRIBUTING
This largely removes references to Docker where possible.

The HOWTO guides are still Docker docs and refer to Docker not
moby, so the next step is to rework these as Moby docs and put
them in `docs/` in this repo.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: cecd0de3a9f783b34f75ca5e6394b9a0c123999e
Component: engine
2017-11-03 11:54:55 +00:00
73e10347de Merge pull request #35344 from rhatdan/readonly-/dev
/dev should not be readonly with --readonly flag
Upstream-commit: 7d8affa3ef1ec904c1f10814f17406f39ff55fc9
Component: engine
2017-11-03 12:54:51 +01:00
d055b6f5d3 Merge pull request #35388 from tonistiigi/rlock-fix
cluster: avoid recursive readlock on swarm info
Upstream-commit: 47b3209f687c240dc2841bcfc147b2ffa341a7fe
Component: engine
2017-11-03 18:09:16 +09:00
fc26552dd2 e2e: Add missing headers for build
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: 37553a6963455fc0d5cea1ae218575cc28d3d251
Component: engine
2017-11-03 10:09:06 +01:00
5ead3bed6b Merge pull request #35389 from thaJeztah/improve-containerd-version-parsing
Use containerd API to get version
Upstream-commit: 4063bbd08877af9d2b75b863c2b469e6cb8f4fa9
Component: engine
2017-11-03 18:06:22 +09:00
e3495e0554 Merge pull request #35382 from thaJeztah/fix-api-version
Fix API version
Upstream-commit: a9182202f76be31a7bec510dd00cf24677e58c7e
Component: engine
2017-11-03 09:52:55 +01:00
d2b0c1cba5 Merge pull request #35375 from cpuguy83/update_dockerpy
Update docker-py commit
Upstream-commit: f5a2f3b40c46979e45559f75c37dfc85f97335a6
Component: engine
2017-11-02 18:42:18 -07:00
4a715bb927 Use containerd API to get version
The `docker info` code was shelling out to obtain the
version of containerd (using the `--version` flag).

Parsing the output of this version string is error-prone,
and not needed, as the containerd API can return the
version.

This patch adds a `Version()` method to the containerd Client
interface, and uses this to get the containerd version.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: fec2b144feaaa18998ec2ed34c9bc843c4c29abd
Component: engine
2017-11-03 01:46:58 +01:00
304c69a1ec cluster: avoid recursive readlock on swarm info
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: ee1be71e9dc52db8a7ac951ba96f18a5c894806a
Component: engine
2017-11-02 16:34:00 -07:00
9136cbe399 temporarily move docker-py tests for faster feedback
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 073dd7ab39da342793c30c08192a8005498e0ffd
Component: engine
2017-11-02 18:05:38 -04:00
cbad1c68f7 Update docker-py commit
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 16d83571f5f8f833aca123874cbb34ff023df995
Component: engine
2017-11-02 18:02:52 -04:00
0cd754e14e Merge pull request #34224 from estesp/no-chown-nwfiles-outside-metadata
Only chown network files within container metadata
Upstream-commit: 462d79165f48f838102d4206af70e64c1e3d6a6d
Component: engine
2017-11-02 15:00:42 -07:00
633f82e30c Merge pull request #664 from thaJeztah/new-misty-handle
Update Misty's GitHub handle
Upstream-commit: e2ada663d2
Component: cli
2017-11-02 17:57:08 +01:00
fd4c48b1d3 Update Misty's GitHub handle
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 14b1535dfe
Component: cli
2017-11-02 16:50:38 +01:00
9f6163c9a9 Update Misty's GitHub handle
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 30b4b5640e7117fc38755a7d5aae0d9a872efaaf
Component: engine
2017-11-02 16:46:37 +01:00
3e0fab4d2e /dev should not be readonly with --readonly flag
/dev is mounted on a tmpfs inside of a container.  Processes inside of containers
some times need to create devices nodes, or to setup a socket that listens on /dev/log
Allowing these containers to run with the --readonly flag makes sense.  Making a tmpfs
readonly does not add any security to the container, since there is plenty of places
where the container can write tmpfs content.

I have no idea why /dev was excluded.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Upstream-commit: 5f3bd2473ee2a1b9f37ba0130e934133d0e01f89
Component: engine
2017-11-02 10:28:51 -04:00
c2ca3d9c02 Merge pull request #35371 from thaJeztah/remove-version-matrix
Remove Docker/API version matrix
Upstream-commit: 4bc5a5765288c797bb6989a9e08938b5327236dc
Component: engine
2017-11-02 06:10:20 -07:00
b878f3dd1f Fix API version
Commit 3ba1dda1914fa7d380d9d3220c3b158a41f90cba bumped
the API version, but forgot to actually bump the version
in code.

This patch fixes the version to match those changes :-)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 7f8dbe4a86650b02ffb490098b9f3bf0912c575d
Component: engine
2017-11-02 13:08:27 +01:00
564091fdbb Merge pull request #35373 from yongtang/11012017-solaris
Remove solaris build tag and `contrib/mkimage/solaris`
Upstream-commit: 76531ccdeb5850156150b88c6a4a56bb8c35dc44
Component: engine
2017-11-02 16:39:02 +09:00
eefbd135ae Remove solaris build tag and `contrib/mkimage/solaris
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 4785f1a7ab7ec857dc3ca849ee6ecadf519ef30e
Component: engine
2017-11-02 00:01:46 +00:00
7559d4940b Merge pull request #35369 from thaJeztah/fix-api-changes
Move Isolation API changes to the correct version
Upstream-commit: deae42863209d742ddf96c922e12268c6d887033
Component: engine
2017-11-02 00:38:19 +01:00
4380d9b1d1 Merge pull request #35363 from yongtang/11012017-Dockerfile.solaris
Remove Dockerfile.solaris reference
Upstream-commit: 64e1d4a1f0081f669fff8ed0ad630b202c0cda8a
Component: engine
2017-11-01 16:36:00 -07:00
bd820b2e31 Remove Docker/API version matrix
The Swagger file contained a version matrix to
find which API version is used by which version
of Docker.

Given that Docker is a downstream of the Moby project,
we should not be maintaining such a matrix in this
repository.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 3fb228ba50ccb921148e0174e5e5e45ab650c3e5
Component: engine
2017-11-01 22:29:26 +01:00
a1f2fd42a7 Move Isolation API changes to the correct version
Commit d91c5f42eb37c6f88cec4021c10c0a1ded1785c3 added
support for "Isolation" mode for services, but didn't
get merged before API 1.34.

This patch moves the description in the API version
history to the correct API version (1.35), and does
a slight rewording of the functionality.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 4533a16fa98785c8c18bf9b9a32da5390fc74757
Component: engine
2017-11-01 22:13:10 +01:00
45def429d3 Merge pull request #34424 from simonferquel/swarm-service-isolation
Added support for swarm service isolation mode
Upstream-commit: d91c5f42eb37c6f88cec4021c10c0a1ded1785c3
Component: engine
2017-11-01 16:41:10 -04:00
9a9cb24385 Remove version file
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 1e1ad008db1af4f415b9ef9b8d6d225a09ab42e1
Component: engine
2017-11-01 16:25:03 -04:00
a60239224c Merge pull request #35364 from dnephin/remove-w2l-scripts
Remove W2L scripts
Upstream-commit: d1d69524c25fdc729f1a35826ffce5d37038f141
Component: engine
2017-11-01 15:56:04 -04:00
b9e1e46d81 Merge pull request #35360 from thaJeztah/fix-autogen-warning
Fix .go-autogen warnings
Upstream-commit: a17bfb78e8c33f67338f480637948f537cb69f40
Component: engine
2017-11-01 15:12:09 -04:00
89d76e74a5 Merge pull request #35341 from tklauser/utsname-x-sys
Simplify Utsname string conversion
Upstream-commit: 0bcca5ea863d8e100ede8b7e48d8209cc4620fec
Component: engine
2017-11-01 11:36:38 -07:00
242504f367 Remove dupl setting of OOMScoreAdj in OCI spec
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: f0b44881b5d43b18871dee2ecc2bb313046038f6
Component: engine
2017-11-01 11:01:43 -07:00
8146500811 Remove W2L scripts
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 6d87d178131429217dec0621263d43c848dc7589
Component: engine
2017-11-01 13:09:09 -04:00
d488311b88 Merge pull request #35351 from dnephin/remove-packaging-scripts
Remove packaging scripts
Upstream-commit: be6a523bb9cebe739005327279ad7c090f6c87bf
Component: engine
2017-11-01 17:37:47 +01:00
4d81559763 Remove Dockerfile.solaris reference
Remove Dockerfile.solaris reference in `hack/make/.detect-daemon-osarch`
as `Dockerfile.solaris` has been removed.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: d157d98a5fbfc98f4adec20ce510b99c795b0d9c
Component: engine
2017-11-01 16:26:29 +00:00
0faeccd9ce Merge pull request #35357 from ripcurld0/small_nitpick
Nitpick plugin/manager.go: use loop to create directories
Upstream-commit: f6700d52244de7ee121c0acc564d38753cadaf7c
Component: engine
2017-11-01 16:33:23 +01:00
86be218c45 Only chown network files within container metadata
If the user specifies a mountpath from the host, we should not be
attempting to chown files outside the daemon's metadata directory
(represented by `daemon.repository` at init time).

This forces users who want to use user namespaces to handle the
ownership needs of any external files mounted as network files
(/etc/resolv.conf, /etc/hosts, /etc/hostname) separately from the
daemon. In all other volume/bind mount situations we have taken this
same line--we don't chown host file content.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
Upstream-commit: 42716dcf5c986e4cbb51f480f2782c05e5bd0b41
Component: engine
2017-11-01 10:14:01 -04:00
a92483bbdf Fix .go-autogen warnings
The `.integration-test-helpers` script was sourced by `/etc/bash/bash.rc`.
However, the `$SCRIPTDIR` environment variable is set through `hack/make.sh`,
so will not be set when calling the `.integration-test-helpers` script directly.

Before this patch;

    make BIND_DIR=. shell
    ...
    bash: /make/.go-autogen: No such file or directory

After this patch, the warning is no longer printed

Also removed sourcing `.go-autogen` from test-integration and build-integration-test-binary,
as they already sourced `.integration-test-helpers` (which sources
`.go-autogen`).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 6d5e468db1f07c12140af0cf36ba0d1a09bb4ca9
Component: engine
2017-11-01 12:03:32 +01:00
0bcfa85080 Nitpick plugin/manager.go: use loop to create directories
Instead of duplicating the same if condition per plugin manager directory,
use one if condition and a for-loop.

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: d75f1d848721f04fdc703a2e88a98600f29933a6
Component: engine
2017-11-01 11:29:37 +02:00
fb29de3583 Add --until flag for docker logs; closes #32807
Signed-off-by: Jamie Hannaford <jamie.hannaford@rackspace.com>
Upstream-commit: e8d9a61f4c9e1f3cfdf1c889c541c9dc72a4bb40
Component: engine
2017-11-01 10:08:49 +01:00
2f5eef6e9a Merge pull request #35348 from thaJeztah/bump-selinux
bump opencontainers/selinux to b29023b86e4a69d1b46b7e7b4e2b6fda03f0b9cd
Upstream-commit: ba99c19b593bdb9e7b90793681fe89b0a91781ed
Component: engine
2017-10-31 20:12:34 -07:00
0954691f2f Remove packaging scripts
These scripts have not been used for a while now, and should not be used again
because they are for releasing docker, not moby

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: eef85648e43fef2ec73462fd3d734947384cb16e
Component: engine
2017-10-31 18:37:05 -04:00
7bfb66c670 Merge pull request #35347 from lioncruise/patch-1
Fix grammatical problems in several annotations
Upstream-commit: 100ec844ccad6b79bcb11650e32e9a05ff51a441
Component: engine
2017-10-31 15:25:27 -07:00
7afaa41128 Merge pull request #35350 from crosbymichael/ctd-static
Add containerd static compile
Upstream-commit: 842bbeb63d82a55ee6ce537f860e9b37c146481c
Component: engine
2017-10-31 14:01:16 -07:00
31ecf1d5a7 Merge pull request #661 from thaJeztah/bump-golang-to-1.8.5
Bump Go to 1.8.5
Upstream-commit: 5a4fe7fe05
Component: cli
2017-10-31 16:24:27 -04:00
8126d722b0 Merge pull request #55 from seemethere/add_artful
Add Ubuntu 17.10, Artful
Upstream-commit: 7b2f5e75e1b30ab70bee294e0215f399ffe32d25
Component: packaging
2017-10-31 13:19:41 -07:00
dbab169d62 Bump Go to 1.8.5
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: bc8282a235
Component: cli
2017-10-31 21:04:59 +01:00
9e1b28e972 Merge pull request #35343 from thaJeztah/bump-api-version-1.35
Bump API version to 1.35
Upstream-commit: 3ba1dda1914fa7d380d9d3220c3b158a41f90cba
Component: engine
2017-10-31 12:37:12 -07:00
5e3a8a19fe Update to 1.8.5
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: c16053e90143cd8a9a559b749407d938f0cb4456
Component: packaging
2017-10-31 11:22:44 -07:00
cf57f4873b Merge pull request #58 from thaJeztah/bump-golang-to-1.8.5
Bump Golang to 1.8.5
Upstream-commit: 798ac05bb417d6f51fba3da55d1b9a9c7b686d61
Component: packaging
2017-10-31 11:22:37 -07:00
f9bbb79bc5 Bump Golang to 1.8.5
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: f7e22edc5125feab9887cf6cd6b94a153a88ed89
Component: packaging
2017-10-31 18:57:28 +01:00
7fe5d41e3a Merge pull request #53 from thaJeztah/bump-golang-to-1.8.4
Bump Go to 1.8.4
Upstream-commit: 18b39977570d17368c9d03e862e0ce264f7ef082
Component: packaging
2017-10-31 10:54:14 -07:00
77f73751db LCOW: Add --platform= CLI flag to pull/create/run/build
Signed-off-by: John Howard <jhoward@microsoft.com>

This is the CLI updates for the document discussed in https://github.com/moby/moby/issues/34617
to support Linux Containers on Windows. It adds --platform= as CLI flags to the four
commands listed above. Import still to be completed (needs daemon changes).
Upstream-commit: d8b782560e
Component: cli
2017-10-31 09:50:43 -07:00
b1394ae4a5 Merge pull request #34271 from tonistiigi/build-symlink-hash
builder: fix build cache hash for broken symlink
Upstream-commit: 3ab20a87fa10360df891a67b8307399cdf1ab429
Component: engine
2017-10-31 09:38:57 -07:00
d76235b88c bump opencontainers/selinux to b29023b86e4a69d1b46b7e7b4e2b6fda03f0b9cd
This vendoring fixes two issues.

1. When a user specifies an SELinux MCS Label (level) to override moby picking
   an unigue MCS label, the code currently picks a label then overrides with the
   user selected. This works fine, except the unique MCS Label is leaked and will
   not be used until the daemon is restarted.
2. The override label, is not reserved. This could potentially cause an issue
   where the daemon could pick the same MCS Label again for a different container.
   (~ 1/500,000 Chance).

The updated selinux go bindings, now release the overriden unigue label, and reserve
the one specified by the user.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 73c82386148fe14a47cc515c622bd23b9b7d99b9
Component: engine
2017-10-31 16:54:16 +01:00
3c035adcf7 Add containerd static compile
Fixes #35349

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 007db062f0c39bf31e1150aa26d045778ab7d24e
Component: engine
2017-10-31 11:50:29 -04:00
bf8eb18312 Merge pull request #660 from thaJeztah/bump-version-to-v17.12-dev
Bump version to 17.12.0-dev
Upstream-commit: 1dc89aa98f
Component: cli
2017-10-31 16:37:42 +01:00
95c878aac5 Fix grammatical problems in several annotations
Signed-off-by: qinshijun <272700767@qq.com>
Upstream-commit: 3c376a882b89bc1ff4f7b47667f49440a516bd70
Component: engine
2017-10-31 22:47:58 +08:00
b5133b1bd8 Update names-generator.go to include Cédric Villani and Valentina
Tershkova

Signed-off-by: Jorit Kleine-Möllhoff <joppich@bricknet.de>
Upstream-commit: f69f8f367987717a154d4c95ea9261bc9416734a
Component: engine
2017-10-31 15:38:57 +01:00
06a81bf15d Merge pull request #658 from arehman199/fix-a-number-of-typos
fix a number of minor typos
Upstream-commit: a0140b4ddb
Component: cli
2017-10-31 15:07:51 +01:00
6b11145c27 Bump API version to 1.35
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: ba6b5aa7f28dbc76c6e0c494eb228a652a0d55a7
Component: engine
2017-10-31 12:57:14 +01:00
356175fe57 Bump version to 17.12.0-dev
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: a195685bac
Component: cli
2017-10-31 12:33:06 +01:00
379ed62f4b Merge pull request #609 from albers/completion-trust
Add bash completion for `docker trust` commands
Upstream-commit: d0197347ea
Component: cli
2017-10-31 11:24:35 +01:00
70aedb437f fix a number of minor typos
Fix 19 typos, grammatical errors and duplicated words.

These fixes have minimal impact on the code as these are either in the
doc files or in comments inside the code files.

Signed-off-by: Abdur Rehman <abdur_rehman@mentor.com>
Upstream-commit: c3fe9d85ef
Component: cli
2017-10-31 15:21:51 +05:00
f64b1b1e67 Simplify Utsname string conversion
Update golang.org/x/sys to 95c6576299259db960f6c5b9b69ea52422860fce in
order to get the unix.Utsname with byte array instead of int8/uint8
members.

This allows to use simple byte slice to string conversions instead of
using charsToString or its open-coded version.

Also see golang/go#20753 for details.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Upstream-commit: 6d068bc25b35a420e63e295ea4ab4ac4a6e6665b
Component: engine
2017-10-31 10:59:32 +01:00
f85a09c5e7 Merge pull request #654 from dnephin/pr-fix-image-rm
Fix behaviour of `rmi -f` with unexpected errors
Upstream-commit: 6e04da39b8
Component: cli
2017-10-31 10:38:38 +01:00
f817bbeeb6 Merge pull request #35335 from dnephin/remove-a-test
Remove a test that was moved to docker/cli
Upstream-commit: 147ec3be2e7fe5d35553401990317cf49088ec86
Component: engine
2017-10-31 07:56:03 +01:00
57801c5154 trust sign: add --local flag
Signed-off-by: Kyle Spiers <kyle@spiers.me>
Upstream-commit: f5a50650d6
Component: cli
2017-10-30 16:06:03 -07:00
b617f5a57f Remove a test that was moved to docker/cli
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 1a03bd396b21f0c291499e1c5bd185d23e20ffc1
Component: engine
2017-10-30 18:39:11 -04:00
b96759ddb9 Adding unit tests for cp
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: b7b62ca26a
Component: cli
2017-10-30 18:33:28 -04:00
7cbbc92838 Merge component 'engine' from git@github.com:moby/moby master 2017-10-30 21:52:27 +00:00
b9bd420700 Merge component 'cli' from git@github.com:docker/cli master 2017-10-30 21:32:56 +00:00
c0bf3ebcc8 Merge pull request #35177 from sargun/add-quota-tests
Add tests to project quotas and detection mechanism
Upstream-commit: 226eb8004e0e9b1cd55b37ce4c235c0f19ca9a14
Component: engine
2017-10-30 21:08:38 +01:00
de8f897ce4 Merge pull request #651 from thaJeztah/fix-extra-host-sorting
Preserve sort-order of extra hosts, and allow duplicate entries
Upstream-commit: 96b8d15bdd
Component: cli
2017-10-30 20:38:10 +01:00
89f40238db Merge pull request #34888 from jahkeup/sized-logger
logger: copy to log driver's bufsize, fixes #34887
Upstream-commit: dfc2d62632d32f9d38166ea477f0ca033a5c91c2
Component: engine
2017-10-30 12:37:41 -07:00
2700d23ec3 Merge pull request #35102 from ripcurld0/doc_31926
Elaborate more about port allocation in docs
Upstream-commit: a6f09a7509cd77b4ce0bf26845a253a7d9997d11
Component: engine
2017-10-30 20:28:36 +01:00
0e0f534e7d Merge pull request #652 from thaJeztah/move-notary
Move notary to its new location
Upstream-commit: 7ca234fe24
Component: cli
2017-10-30 14:05:59 -04:00
7878df6b36 Merge pull request #655 from eiais/extraQuote
Remove extra quotes from docker trust sign
Upstream-commit: 65398de1a6
Component: cli
2017-10-30 13:53:18 -04:00
7b52a0b8c0 Merge pull request #648 from thaJeztah/fix-host-add-description
Fix flag description for --host-add
Upstream-commit: a79e742bfc
Component: cli
2017-10-30 13:52:29 -04:00
17ef49339b Merge component 'cli' from git@github.com:docker/cli master 2017-10-30 17:32:31 +00:00
48cf1a4fab Remove extra quotes from docker trust sign
Signed-off-by: Kyle Spiers <kyle@spiers.me>
Upstream-commit: 291fdcfdbe
Component: cli
2017-10-30 10:31:21 -07:00
74cd535226 Use t.Run() for tests
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: b900676523
Component: cli
2017-10-30 13:00:03 -04:00
0f02c6fd5a docker rm -f exits with 1 if the image was not removed
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
Upstream-commit: 125302cfa6
Component: cli
2017-10-30 12:50:19 -04:00
bd61323342 logger: copy to log driver's bufsize
Log drivers may have an internal buffer size that can be accommodated
by the copier as it is more effective to buffer and send fewer though
larger messages that the log driver can consume.

This eliminates the need for Partial handling for drivers that do not
support the concept (ie: awslogs, which can only have events up to
service limits).

Signed-off-by: Jacob Vallejo <jakeev@amazon.com>
Upstream-commit: e1ada0b885b31de0bb0e79b4d99ae4d48b65f721
Component: engine
2017-10-30 16:25:09 +00:00
095f04e761 Move notary to its new location
The https://github.com/docker/notary repository has moved to
https://github.com/theupdateframework/notary

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 6cd58063fa
Component: cli
2017-10-30 17:21:41 +01:00
dd79157d92 Merge pull request #566 from riyazdf/docker-trust-2
docker trust: interact with signers and keys
Upstream-commit: 0c4fa699eb
Component: cli
2017-10-30 17:03:58 +01:00
c75c0e3626 Merge component 'engine' from git@github.com:moby/moby master 2017-10-30 16:00:31 +00:00
2f9ed9f2a3 review feedback: updating for windows, error paths
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: e189a21a25
Component: cli
2017-10-30 16:55:59 +01:00
fb29d9eb55 update to stderr instead of stdout, update tests
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 079471ebeb
Component: cli
2017-10-30 16:55:59 +01:00
80651d6c61 revendor notary for updated import/export packages, update with rebase
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: b4ef2ddb8b
Component: cli
2017-10-30 16:55:59 +01:00
aeaef10882 refactoring and adding tests for EC key types
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 2d8cc3cd80
Component: cli
2017-10-30 16:55:59 +01:00
506e33cdf2 trust: move signer and key commands down one level
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 532d223db4
Component: cli
2017-10-30 16:53:54 +01:00
222f56b982 docs: add docs for new trust subcommands
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 4e797eaa04
Component: cli
2017-10-30 16:53:54 +01:00
d01ed820ce trust: key-load and key-generate code
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 604bc3f22d
Component: cli
2017-10-30 16:53:53 +01:00
cfe9deca16 trust: add signer-add and signer-remove command
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: dde9f614a7
Component: cli
2017-10-30 16:53:53 +01:00
a2d940cc8d Merge component 'cli' from git@github.com:docker/cli master 2017-10-30 15:41:05 +00:00
1377e81acb Added support for swarm service isolation mode
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
Upstream-commit: f28cb422e69bd4239401e6ea32b65b56485d6691
Component: engine
2017-10-30 16:16:18 +01:00
88e8779c7d Merge pull request #623 from johndmulhausen/master
Removing titles from md files
Upstream-commit: 92afc3f474
Component: cli
2017-10-30 14:01:58 +01:00
c5ffc78d5e Preserve sort-order of extra hosts, and allow duplicate entries
Extra hosts (`extra_hosts` in compose-file, or `--hosts` in services) adds
custom host/ip mappings to the container's `/etc/hosts`.

The current implementation used a `map[string]string{}` as intermediate
storage, and sorted the results alphabetically when converting to a service-spec.

As a result, duplicate hosts were removed, and order of host/ip mappings was not
preserved (in case the compose-file used a list instead of a map).

According to the **host.conf(5)** man page (http://man7.org/linux/man-pages/man5/host.conf.5.html)

    multi  Valid values are on and off.  If set to on, the resolver
      library will return all valid addresses for a host that
      appears in the /etc/hosts file, instead of only the first.
      This is off by default, as it may cause a substantial
      performance loss at sites with large hosts files.

Multiple entries for a host are allowed, and even required for some situations,
for example, to add mappings for IPv4 and IPv6 addreses for a host, as illustrated
by the example hosts file in the **hosts(5)** man page (http://man7.org/linux/man-pages/man5/hosts.5.html):

    # The following lines are desirable for IPv4 capable hosts
    127.0.0.1       localhost

    # 127.0.1.1 is often used for the FQDN of the machine
    127.0.1.1       thishost.mydomain.org  thishost
    192.168.1.10    foo.mydomain.org       foo
    192.168.1.13    bar.mydomain.org       bar
    146.82.138.7    master.debian.org      master
    209.237.226.90  www.opensource.org

    # The following lines are desirable for IPv6 capable hosts
    ::1             localhost ip6-localhost ip6-loopback
    ff02::1         ip6-allnodes
    ff02::2         ip6-allrouters

This patch changes the intermediate storage format to use a `[]string`, and only
sorts entries if the input format in the compose file is a mapping. If the input
format is a list, the original sort-order is preserved.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: dbdf8f6468
Component: cli
2017-10-30 01:48:09 +01:00
3090f62b5d Merge pull request #35313 from charrywanganthony/RandomAlpha
Separate the GenerateRandomAlphaOnlyString function from stringutils
Upstream-commit: ba3bf8191e3390745420ada6b7f79483eb7e7be0
Component: engine
2017-10-29 22:33:57 +01:00
b3821c58fe Merge pull request #34999 from kolyshkin/wait-on-rm
ContainerWait on remove: don't stuck on rm fail
Upstream-commit: 220d6c4aff7e3c8887f8c39e8f47b4aca21ab22f
Component: engine
2017-10-29 11:04:41 -07:00
a313f92089 Merge pull request #35289 from zuiurs/namesgeneratorCmd
Fix a names-generator binary
Upstream-commit: e8730d052e625af3666176f7c1f596bb07fccbe2
Component: engine
2017-10-28 13:16:33 -07:00
6a734a478e Merge pull request #35314 from thaJeztah/improve-devicemapper-info
Improve devicemapper driver-status output
Upstream-commit: 1f5bcb1b8812abd832fee3721dd29ef431ddc32a
Component: engine
2017-10-28 11:15:59 -07:00
772cdcbf0c Fix flag description for --host-add
The `--host-add` flag adds a new `host:ip` mapping. Even though
adding an entry is idempotent (adding the same mapping multiple
times does not update the service's definition), it does not
_update_  an existing mapping with a new IP-address (multiple
IP-addresses can be defined for a host).

This patch removes the "or update" part from the flag's
description.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 79b19cba16
Component: cli
2017-10-28 16:47:53 +02:00
be3cbac37e Separate the GenerateRandomAlphaOnlyString function from stringutils
Signed-off-by: chaowang <chaowang@localhost.localdomain>
Upstream-commit: 7c35a2418265336a572976e2ced378ef4b6f1666
Component: engine
2017-10-28 09:03:02 +08:00
a4aced17f9 Merge pull request #646 from jadametz/add_unpause_output
Adds unpause output to docs
Upstream-commit: 7ed96d3b2b
Component: cli
2017-10-28 02:00:40 +02:00
4e5eea8827 Merge pull request #35320 from Microsoft/jjh/lcow-set-oci-root
Fixes LCOW after containerd 1.0 introduced regressions
Upstream-commit: 2613c3d53cee46d8e0dc8e1aba83686f259985e4
Component: engine
2017-10-28 09:02:00 +11:00
e947e4d4f1 Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2017-10-27 11:27:43 -07:00
fdcaaa2daa Merge component 'engine' from git@github.com:moby/moby master 2017-10-27 11:27:30 -07:00
320e3a6526 Add tests to project quotas and detection mechanism
This adds a mechanism (read-only) to check for project quota support
in a standard way. This mechanism is leveraged by the tests, which
test for the following:
 1. Can we get a quota controller?
 2. Can we set the quota for a particular directory?
 3. Is the quota being over-enforced?
 4. Is the quota being under-enforced?
 5. Can we retrieve the quota?

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Upstream-commit: 6966dc0aa9134c518babcbf1f02684cae5374843
Component: engine
2017-10-27 11:07:37 -07:00
ac1bfe09d7 Merge component 'cli' from git@github.com:docker/cli master 2017-10-27 10:23:42 -07:00
67f37f6e34 Fixes LCOW after containerd 1.0 introduced regressions
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 71651e0b801ae874b4a899e3c47add9e3fbc2400
Component: engine
2017-10-27 09:55:43 -07:00
b829f463d9 Merge pull request #636 from dnephin/fix-trust-output-stream
Fix stdout and errors in image/trust
Upstream-commit: 54e1378e04
Component: cli
2017-10-27 11:31:01 -04:00
b09454312c Merge pull request #35307 from thaJeztah/bump-golang-to-1.8.5
Bump Golang to 1.8.5
Upstream-commit: ecf4125b85e0faa57d2739348e0d453c1d24d10c
Component: engine
2017-10-27 06:10:09 -07:00
ab4fa07bf0 Merge pull request #621 from charrywanganthony/displaystringutils
Refactor stringutils and fix docker search output form
Upstream-commit: e4940cb8d2
Component: cli
2017-10-27 11:08:36 +02:00
4251785d24 Merge pull request #645 from dnephin/use-upstream-spf13-cobra
Hide help flag from help output
Upstream-commit: 6aedafd195
Component: cli
2017-10-27 11:00:07 +02:00
b238ed565f Improve devicemapper driver-status output
Do not print "Data file" and "Metadata file" if they're
not used, and sort/group output.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 8f702de9b705ced68b6244239ac81d86ebdd6b0a
Component: engine
2017-10-27 10:12:39 +02:00
e0db409186 Adds unpause output to docs
Signed-off-by: Jesse Adametz <jesseadametz@gmail.com>
Upstream-commit: 8bf99be0c7
Component: cli
2017-10-26 23:55:03 -07:00
9a3be7b972 Refactor stringutils and fix docker search output form when the description has CJK character
Signed-off-by: Chao Wang <wangchao.fnst@cn.fujitsu.com>
Upstream-commit: 926b20fcb5
Component: cli
2017-10-27 11:15:10 +08:00
6a1f8e5780 Merge pull request #633 from seemethere/switch_to_multi_arch_images
Switch to golang:1.8.4-alpine3.6
Upstream-commit: 50e1161744
Component: cli
2017-10-26 17:08:08 -07:00
d815178654 Bump Golang to 1.8.5
go1.8.5 (released 2017/10/25) includes fixes to the compiler, linker, runtime,
documentation, go command, and the crypto/x509 and net/smtp packages. It
includes a fix to a bug introduced in Go 1.8.4 that broke go get of non-Git
repositories under certain conditions. See the Go 1.8.5 milestone on our issue
tracker for details:

https://github.com/golang/go/issues?q=milestone%3AGo1.8.5

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 503fe408da376a046c37c4940f7f3af0cfa81c38
Component: engine
2017-10-27 01:18:00 +02:00
9797d6fc52 Update to multi-arch image for golang
golang:1.8.4-alpine does not have multi-arch images available in the
manifest. (s390x, ppc64le, etc.)

This makes it so that if you are trying to compile on different
arches you aren't forced to have to write your own Dockerfile and can
instead use the one bundled with the CLI repo.

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 9d1d9f2fa3
Component: cli
2017-10-26 11:42:13 -07:00
f845101532 Merge pull request #617 from dnephin/update-gometalinter
Update gometalinter
Upstream-commit: b087b13cae
Component: cli
2017-10-26 13:08:00 -04:00
2b624e8f54 Update gometalinter
and enable the new WarnUnmatchedDirective to warn if a nolint is unnecessary.
remove some unnecessary nolint

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: c0d004f7cf
Component: cli
2017-10-26 12:21:02 -04:00
06ddf7146d Merge pull request #601 from dnephin/compose-cast-after-interpolate
[Compose] Cast values to expected type after interpolating values
Upstream-commit: b68c3d007f
Component: cli
2017-10-26 12:20:04 -04:00
e585bc4a87 Hide help flag from help output.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: f50345a26c
Component: cli
2017-10-26 12:17:50 -04:00
52f9a6e75e Change multi-type parameters to single type
Signed-off-by: Asad Saeeduddin <masaeedu@gmail.com>
Upstream-commit: c6d32bebe5b6a0919fcb530692092dd5516e5b54
Component: engine
2017-10-26 06:10:24 -04:00
6c4fe5e7de Merge pull request #642 from dnephin/use-upstream-spf13-cobra
Use upstream spf13 cobra
Upstream-commit: e59f3e2925
Component: cli
2017-10-26 10:05:11 +02:00
2613cd4235 Merge pull request #644 from thaJeztah/fix-daemon-config-example
Fix daemon.json runtime example
Upstream-commit: 41797e1753
Component: cli
2017-10-26 09:31:57 +02:00
c8091c3807 Merge pull request #641 from cpuguy83/35295_memusage_pagecache_note
Add note about reported memory stats on linux
Upstream-commit: ecf06bba21
Component: cli
2017-10-26 02:28:06 +02:00
5c9abffbcf Fix daemon.json runtime example
The example in the documentation used "runc", which is a
reserved runtime name (as it's the default).

This patch updates the example, and uses a different name.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 1e5d013064
Component: cli
2017-10-26 02:15:49 +02:00
7c4d9074f1 Fix UseLine
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 8e600e10f7
Component: cli
2017-10-25 18:22:04 -04:00
7184497162 Merge pull request #35283 from darrenstahlmsft/revendorLibnetwork
Update libnetwork
Upstream-commit: 074b1fc47b12ef18cbdd972597d5c3d706bd3709
Component: engine
2017-10-26 00:03:33 +02:00
a3b0929c08 Add note about reported memory stats on linux
Since the API and the CLI both have a "Usage" field for memory, clarify
that the CLI does additional calculations to avoid confusion of API
consumers.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: a6acacc533
Component: cli
2017-10-25 16:50:43 -04:00
8efb0e1631 ContainerWait on remove: don't stuck on rm fail
Currently, if a container removal has failed for some reason,
any client waiting for removal (e.g. `docker run --rm`) is
stuck, waiting for removal to succeed while it has failed already.
For more details and the reproducer, please check
https://github.com/moby/moby/issues/34945

This commit addresses that by allowing `ContainerWait()` with
`container.WaitCondition == "removed"` argument to return an
error in case of removal failure. The `ContainerWaitOKBody`
stucture returned to a client is amended with a pointer to `struct Error`,
containing an error message string, and the `Client.ContainerWait()`
is modified to return the error, if any, to the client.

Note that this feature is only available for API version >= 1.34.
In order for the old clients to be unstuck, we just close the connection
without writing anything -- this causes client's error.

Now, docker-cli would need a separate commit to bump the API to 1.34
and to show an error returned, if any.

[v2: recreate the waitRemove channel after closing]
[v3: document; keep legacy behavior for older clients]
[v4: convert Error from string to pointer to a struct]
[v5: don't emulate old behavior, send empty response in error case]
[v6: rename legacy* vars to include version suffix]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: f963500c544daa3c158c0ca3d2985295c875cb6b
Component: engine
2017-10-25 13:11:56 -07:00
2e5b6e24c7 Update code for upstream cobra
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 4205416c9b
Component: cli
2017-10-25 14:49:26 -04:00
bf87c9c8da Update vendor of spf13/pflag and spf13/cobra
Use upstream isntead of fork for cobra.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 0f2ebae056
Component: cli
2017-10-25 12:50:37 -04:00
21f2b39427 Merge pull request #35294 from vdemeester/docker-function-name
Remove Docker from some functions
Upstream-commit: 0e037717e06f4f260f4e76d90675ccd1e9a6bed3
Component: engine
2017-10-25 08:25:26 -07:00
373458dd9c Merge pull request #34670 from sargun/use_copy_file_range
Use In-kernel File Copy for Overlayfs and VFS on Linux
Upstream-commit: ce5800c329510bbf38c6899c3386633823acefcd
Component: engine
2017-10-25 17:10:44 +02:00
7f1869d232 Merge pull request #35285 from crosbymichael/solaris
Remove solaris files
Upstream-commit: 17bb1d3663f6586e83b453670526e3186bb56dd3
Component: engine
2017-10-25 15:14:04 +02:00
1fe3d1bde0 Merge pull request #35293 from vdemeester/small-docker-to-moby-rename
Rename a few docker to moby
Upstream-commit: 61d1bd8a807de3411b62eb1c3af88fec6021a688
Component: engine
2017-10-25 14:57:29 +02:00
bec5e89f59 Remove Docker from some functions
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: de5c80b4f3ca51343fb4b698362ad232478b43be
Component: engine
2017-10-25 14:39:51 +02:00
e1ac8beab7 Merge pull request #35030 from tossmilestone/34459-fix-network-create-conflict-errcode
Fix returned error code for network creation from 500 to 409
Upstream-commit: e309f98b84fd3aaf527512a925e2b7d066135a4d
Component: engine
2017-10-25 14:29:20 +02:00
aa769fd9a0 Rename a few docker to moby
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: d040d637a950b10843a4535c6dbc1c66cc84dde7
Component: engine
2017-10-25 13:56:12 +02:00
61ad1e458b Fix a names-generator binary
To ensure that namesgenerator binary outputs random name
by initializing Seed.

Signed-off-by: Mizuki Urushida <z11111001011@gmail.com>

not use init function.

Signed-off-by: Mizuki Urushida <z11111001011@gmail.com>
Upstream-commit: eaab2f715039e212dd67c71c30f1f8a8cfc03ded
Component: engine
2017-10-25 18:21:17 +09:00
4883b5d512 Merge pull request #638 from BastianHofmann/patch-1
Fix json formating in dockerd docs
Upstream-commit: 9b7656cc05
Component: cli
2017-10-25 10:56:21 +02:00
25caba7d97 Fix json formatting in dockerd docs
Fix another json formatiing error.

Signed-off-by: Bastian Hofmann <bastianhofmann@me.com>
Upstream-commit: c7867f5cc6
Component: cli
2017-10-25 08:50:34 +02:00
f5ef703efd Merge pull request #35284 from tophj-ibm/download-frozen-images-with-integration-cli-tests
[integration-cli] ensureFrozenImages here too
Upstream-commit: d85f5e73203a1f8537b7db02e1eadcb6d75798b2
Component: engine
2017-10-24 16:43:55 -07:00
a04c3458dc Add zero-copy support to copy module
This changeset allows Docker's VFS, and Overlay to take advantage of
Linux's zerocopy APIs.

The copy function first tries to use the ficlone ioctl. Reason being:
 - they do not allow partial success (aka short writes)
 - clones are expected to be a fast metadata operation
See: http://oss.sgi.com/archives/xfs/2015-12/msg00356.html

If the clone fails, we fall back to copy_file_range, which internally
may fall back to splice, which has an upper limit on the size
of copy it can perform. Given that, we have to loop until the copy
is done.

For a given dirCopy operation, if the clone fails, we will not try
it again during any other file copy. Same is true with copy_file_range.

If all else fails, we fall back to traditional copy.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Upstream-commit: 3ec4ec2857c714387e7b59c2cf324565f6ae55e2
Component: engine
2017-10-24 13:14:40 -07:00
671341f0e3 Separate daemon/graphdriver/overlay/copy into its own package
Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Upstream-commit: 5298785b8e612ca5d3943fada08a46978971ba70
Component: engine
2017-10-24 13:14:40 -07:00
54e6932cca Merge pull request #35217 from cpuguy83/fix_chroot_mount_race
Use rslave instead of rprivate in chrootarchive
Upstream-commit: d891f2e3cab7509d5fe9336c7d2efffe1934accc
Component: engine
2017-10-24 22:13:28 +02:00
d78181e968 Remove solaris files
For obvious reasons that it is not really supported now.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 5a9b5f10cf967f31f0856871ad08f9a0286b4a46
Component: engine
2017-10-24 15:39:34 -04:00
2740139c0c Merge pull request #35125 from ripcurld0/reload_no_config
Reload daemon even if "/etc/docker/daemon.json" does not exist
Upstream-commit: 04e8d7b8bfc531fdfc6fb201fae39820002455fe
Component: engine
2017-10-24 21:23:49 +02:00
68eac4a32f Merge pull request #35055 from adnxn/creds-endpoint
Add credentials endpoint option for awslogs driver
Upstream-commit: 158c072bde002c574e10f54763844f67e0ae34c0
Component: engine
2017-10-24 14:45:14 -04:00
3f2845711e Merge pull request #35273 from chchliang/containerstate
add testcase IsValidStateString
Upstream-commit: 05026b187b35dfa97e5f4895c6c0a21feb8bc90d
Component: engine
2017-10-24 14:32:37 -04:00
8c5d2bc78d [integration-cli] ensureFrozenImages here too
Checks + pulls down the frozen images in the integration-cli
tests too. Fixes an issue where they wouldn't be pulled if running
against just integration-cli tests, e.g. through TESTFLAGS

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: c95b17e598409000deb265945c5e80256de7db9f
Component: engine
2017-10-24 14:24:25 -04:00
89c643c206 Update libnetwork
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: 0d4e2531888c3696db490e90708a1faf40afb510
Component: engine
2017-10-24 11:11:02 -07:00
5ab47d5b72 Merge pull request #639 from thaJeztah/add-squash-known-issue
Mention known limitations for --squash
Upstream-commit: 465a83a140
Component: cli
2017-10-24 12:04:59 -04:00
835cb984a3 Mention known limitations for --squash
The experimental `docker build --squash` feature has a number
of limitations. For most use-cases, multi-stage builds are
a better alternative.

This patch lists the known limitations, and adds a link to
multi-stage builds.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: bcc228ac6b
Component: cli
2017-10-24 14:32:06 +02:00
eca1900380 trust: define new commands and helpers
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 5ab3ae7aba
Component: cli
2017-10-24 11:23:35 +02:00
d7f53f25fe vendor: update notary and deps for new trust commands
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: f47b1a3c6d
Component: cli
2017-10-24 11:23:32 +02:00
44eef72d75 add testcase IsValidStateString
Signed-off-by: chchliang <chen.chuanliang@zte.com.cn>
Upstream-commit: 675ac37482432e13d1312647762d9db8b9bb175e
Component: engine
2017-10-24 09:49:58 +08:00
d0c54aaf3d Merge pull request #35184 from darrenstahlmsft/shutdownTimeout
Increase container default shutdown timeout on Windows
Upstream-commit: 7848b8beb9d38a98a78b75f78e05f8d2255f9dfe
Component: engine
2017-10-23 13:05:35 -07:00
46f41afac1 Fix stdout and errors in image/trust
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 8f86a25029
Component: cli
2017-10-23 13:54:55 -04:00
259cc0cc87 Increase container default shutdown timeout on Windows
The shutdown timeout for containers in insufficient on Windows. If the daemon is shutting down, and a container takes longer than expected to shut down, this can cause the container to remain in a bad state after restart, and never be able to start again. Increasing the timeout makes this less likely to occur.

Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: ed74ee127f42f32ee98be7b908e1562b1c0554d7
Component: engine
2017-10-23 10:31:31 -07:00
9e02505935 Merge pull request #35267 from mcandre/patch-1
[vim] support *.Dockerfile
Upstream-commit: 8ca8cc219db45bc1228a70c99d24d8b01759e019
Component: engine
2017-10-23 10:13:45 -07:00
74a0738e87 Merge pull request #35253 from Microsoft/jjh/startuplogging
Windows: Fix startup logging
Upstream-commit: 2058854c4b118b28abe638befbb98320526da902
Component: engine
2017-10-23 18:43:41 +02:00
fb72d25156 Merge pull request #35248 from tophj-ibm/add-integration-testsetup
[integration] add setupTest to integration test
Upstream-commit: 78cd8e8d18ce250e7cd66ffe60666cfdad4ea02f
Component: engine
2017-10-23 18:39:13 +02:00
1dbedcfc9e Merge pull request #34895 from mlaventure/containerd-1.0-client
Containerd 1.0 client
Upstream-commit: 402540708c9a0c35dc0b279a0f330455633537b8
Component: engine
2017-10-23 10:38:03 -04:00
ab1d1d2aa8 support *.Dockerfile
Probably a good idea to treat `*.Dockerfile` as dockerfile format as well. In general, it's better to use the `Dockerfile` part as an extension rather than a basename.

Signed-off-by: Andrew Pennebaker <andrew.pennebaker@gmail.com>
Upstream-commit: 2f5146ba1d413a7a07943648fd37e73f076361be
Component: engine
2017-10-22 11:16:06 -05:00
b49329396e Reload daemon even if "/etc/docker/daemon.json" does not exist
Before this commit if "--config-file" wasn't set the daemon would use
the default configuration file which is "/etc/docker/daemon.json".

When attempting to reload the daemon if that file didn't exist
and error message would display.

This behaviour is changed in a way that if the default configuration
file does not exist and no other configuration file is set
the daemon uses an empty configuration which later will be updated
and reloaded using the "reload" function given as an argument in Reload.

However, if the "--config-file" is set and the file is removed
or renamed an error message will be displayed and no reload will be done.

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: 0f8119a87dc301e9543c45c416d6b4545da1fc46
Component: engine
2017-10-22 15:20:52 +03:00
1c3f4cf12c Fixup some issues with plugin refcounting
In some circumstances we were not properly releasing plugin references,
leading to failures in removing a plugin with no way to recover other
than restarting the daemon.

1. If volume create fails (in the driver)
2. If a driver validation fails (should be rare)
3. If trying to get a plugin that does not match the passed in capability

Ideally the test for 1 and 2 would just be a unit test, however the
plugin interfaces are too complicated as `plugingetter` relies on
github.com/pkg/plugin/Client (a concrete type), which will require
spinning up services from within the unit test... it just wouldn't be a
unit test at this point.
I attempted to refactor this a bit, but since both libnetwork and
swarmkit are reliant on `plugingetter` as well, this would not work.
This really requires a re-write of the lower-level plugin management to
decouple these pieces.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 3816b514387efd24394f0b8e61d55502aa6ac9ac
Component: engine
2017-10-21 15:17:57 -04:00
edb0598a8f [integration] ensure frozen images are loaded
Ensures that the frozen test images are loaded in the daemon
before any tests are run.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: 58151358c0c296c2cf601aea528d5e8a11a20d12
Component: engine
2017-10-20 16:51:13 -04:00
869831ccd7 Merge pull request #632 from mstanleyjones/fix-system-prune-f-flag
For system prune, -f is not an alias for --filter
Upstream-commit: 3352c0e137
Component: cli
2017-10-20 16:17:19 -04:00
e18e9addc6 Add Ubuntu 17.10, Artful
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 1468941a50dba7e0a82a01cb938338041f028ef9
Component: packaging
2017-10-20 11:46:49 -07:00
7b8e36ff5a For system prune, -f is not an alias for --filter
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: d4e5481cd4
Component: cli
2017-10-20 10:51:28 -07:00
e59c840b6d Merge pull request #35077 from ryansimmen/35076-WindowsDaemonTmpDir
Windows Daemon should respect DOCKER_TMPDIR
Upstream-commit: ab0eb8fcf6fe6b4ee12393edcd6465501b5c66a1
Component: engine
2017-10-20 08:40:43 -07:00
f2d8311eb8 Merge pull request #35059 from cpuguy83/35002_handle_bind_create_errors
idtools don't chown if not needed
Upstream-commit: 113bebe0ee690246323171dad82f939c97fb2778
Component: engine
2017-10-20 08:39:23 -07:00
4fab58b1ff Merge pull request #624 from mstanleyjones/guidance-on-labels
Update info on labels
Upstream-commit: 3785a314e1
Component: cli
2017-10-20 16:33:13 +02:00
3242c0b622 Fix tests creating zombie processes
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 617f89b9a357c0176efc2b5b28af8b36f5ebdbcb
Component: engine
2017-10-20 07:11:38 -07:00
044d7f995b Update libcontainerd to use containerd 1.0
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: ddae20c032058a0fd42c34c2e9750ee8f6296ac8
Component: engine
2017-10-20 07:11:37 -07:00
3655b65e84 Merge pull request #35178 from chchliang/registryconfig
Add ValidateIndexName testcase
Upstream-commit: 4df80ae0535cb8e69780f28fe0028134e4d69909
Component: engine
2017-10-20 15:58:54 +02:00
02485e8657 Vendor containerd 1.0
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 7acea2a243d25c061d12a2a2f8bbd4e5955a85f4
Component: engine
2017-10-19 13:19:41 -07:00
55cea3f58e idtools don't chown if not needed
In some cases (e.g. NFS), a chown may technically be a no-op but still
return `EPERM`, so only call `chown` when neccessary.

This is particularly problematic for docker users bind-mounting an NFS
share into a container.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: fa9709a3fc51785c3dc0f7ca8f54dafde2e291ab
Component: engine
2017-10-19 16:06:25 -04:00
d03ac8e017 Fix startup logging
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 7d0dea10557e01865d67aa90c43b294fa6b36c42
Component: engine
2017-10-19 11:09:29 -07:00
3d080c31d7 Merge pull request #35237 from tklauser/unix-major-minor
Use Mkdev, Major and Minor functions from golang.org/x/sys/unix
Upstream-commit: bf1376f44a1177de2dc08d8470c80316f5df67f3
Component: engine
2017-10-19 17:26:06 +02:00
fcfff58f66 Windows Daemon should respect DOCKER_TMPDIR
Signed-off-by: Ryan Simmen <ryan.simmen@gmail.com>
Upstream-commit: 5611f127a7028c40a2ba59a1a09f92cdfe99f2ba
Component: engine
2017-10-19 10:47:46 -04:00
90d3bf5347 Use Mkdev, Major and Minor functions from golang.org/x/sys/unix
Update golang.org/x/sys to 8dbc5d05d6edcc104950cc299a1ce6641235bc86 in
order to get the Major, Minor and Mkdev functions for every unix-like
OS. Use them instead of the locally defined versions which currently use
the Linux specific device major/minor encoding.

This means that the device number should now be properly encoded on e.g.
Darwin, FreeBSD or Solaris.

Also, the SIGUNUSED constant was removed from golang.org/x/sys/unix in
https://go-review.googlesource.com/61771 as it is also removed from the
respective glibc headers.

Remove it from signal.SignalMap as well after the golang.org/x/sys
re-vendoring.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Upstream-commit: 86f080cff0914e9694068ed78d503701667c4c00
Component: engine
2017-10-19 08:28:38 +02:00
d2bb6cfe29 Add ValidateIndexName testcase
Signed-off-by: chchliang <chen.chuanliang@zte.com.cn>
Upstream-commit: 0ddc903cec5594ba3cfd5043798321c983fc4eba
Component: engine
2017-10-19 08:53:26 +08:00
4e34887dae Merge pull request #35222 from xuri/xuri_patch
Typo fixed and simple code.
Upstream-commit: 239d61f04bf1c00273c1c89b531fe37993e08a9f
Component: engine
2017-10-18 07:51:41 +02:00
d91c638398 Typo fixed and simple code.
Signed-off-by: Ri Xu <xuri@360.net>
Upstream-commit: 87e8a936e82ecfbef59b829d8bbfca3fb4aa3163
Component: engine
2017-10-18 10:26:58 +08:00
f9aa6f8b5d Merge pull request #35220 from heddle317/remove-unused-code-todo
Removing unused code with a TODO that no longer needs to be done
Upstream-commit: 7dbbd4e2ba2ef0a19e9e8d42439780300218ad87
Component: engine
2017-10-17 14:24:27 -07:00
6bfaa3dd46 Elaborate more about port allocation in docs
Describe more how host port allocation is done when
container is stopped/started in "PublishAllPorts".

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: dfd706e1a59c3830c87b8240c466489ae6cc9d15
Component: engine
2017-10-17 15:19:54 +03:00
9816812d14 Merge pull request #35157 from BSWANG/fix-panic-on-restore
fix panic on get container pid when live restore containers
Upstream-commit: fa2df86ab62a231c8859400540bb4542143f3e0c
Component: engine
2017-10-16 20:24:20 -04:00
b229e5ca88 Merge pull request #35205 from cyphar/oci-obey-CL_UNPRIVILEGED
daemon: oci: obey CL_UNPRIVILEGED for user namespaced daemon
Upstream-commit: 046c3ea4331dda40a86676c463e7c1ffda76e8ae
Component: engine
2017-10-16 17:10:13 -07:00
fdc015d172 Removing unused code with a TODO that no longer needs to be done
Signed-off-by: Kate Heddleston <kate.heddleston@gmail.com>
Upstream-commit: 736fafb2d0b8b70573978f3d220be65afb1587f4
Component: engine
2017-10-16 14:57:48 -07:00
3c89b7fafe Use rslave instead of rprivate in chrootarchive
With `rprivate` there exists a race where a reference to a mount has
propagated to the new namespace, when `rprivate` is set the parent
namespace is not able to remove the mount due to that reference.
With `rslave` unmounts will propagate correctly into the namespace and
prevent the sort of transient errors that are possible with `rprivate`.

This is a similar fix to 117c92745b

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 5ede64d63fec0b9d4cf921b6f8fb946e65287538
Component: engine
2017-10-16 13:49:31 -04:00
2ac0f85aa9 Update info on labels
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: e49e1ea739
Component: cli
2017-10-16 10:10:49 -07:00
77fe26d1a3 daemon: oci: obey CL_UNPRIVILEGED for user namespaced daemon
When runc is bind-mounting a particular path "with options", it has to
do so by first creating a bind-mount and the modifying the options of
said bind-mount via remount. However, in a user namespace, there are
restrictions on which flags you can change with a remount (due to
CL_UNPRIVILEGED being set in this instance). Docker historically has
ignored this, and as a result, internal Docker mounts (such as secrets)
haven't worked with --userns-remap. Fix this by preserving
CL_UNPRIVILEGED mount flags when Docker is spawning containers with user
namespaces enabled.

Ref: https://github.com/opencontainers/runc/pull/1603
Signed-off-by: Aleksa Sarai <asarai@suse.de>
Upstream-commit: c0f883fdeeb2480970fb48fbcbc2a842aa5a90e8
Component: engine
2017-10-16 02:52:56 +11:00
24d0fa40df Bump Go to 1.8.4
Bumps the Go version used to 1.8.4, which contains
security fixes; https://groups.google.com/forum/#!topic/golang-announce/1hZYiemnkdE

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 9f50d4449ab79e467e7c2a2a498bf00ebd9db48c
Component: packaging
2017-10-14 23:26:31 +02:00
505cf3697a Merge pull request #35189 from chris-crone/e2e-no-default-logs
Do not print e2e test logs by default
Upstream-commit: f2afa26235941fd79f40eb1e572e19e4ac2b9bbe
Component: engine
2017-10-14 07:49:40 -04:00
210282a543 Removing titles from md files
Signed-off-by: John Mulhausen <john@docker.com>
Upstream-commit: 4a5db8d27e
Component: cli
2017-10-13 15:24:06 -07:00
70444882b3 Merge pull request #254 from andrewhsu/c
minimize changelog template
2017-10-13 14:42:55 -07:00
f0e2a3825e Merge pull request #35192 from itsafire/master
fixing return value
Upstream-commit: 64eabb7f695dc948a76b96ea4204f8a755e45985
Component: engine
2017-10-13 13:24:10 -07:00
03dc500ba7 Merge pull request #34509 from thaJeztah/fix-network-delete
Fix network name masking network ID on delete
Upstream-commit: 0181eb8f213284b0fae754f28123076c5cab9be4
Component: engine
2017-10-13 08:40:09 -07:00
b5021afc0e Merge pull request #620 from dnephin/add-nakedret-linter
Add nakedret linter
Upstream-commit: 1401d5daf2
Component: cli
2017-10-13 14:54:00 +02:00
a13666782c fixing return value
Signed-off-by: Andreas Elvers <andreas@work.de>
Upstream-commit: 547dd4f95d032c8a2cb590a85767472e65e916db
Component: engine
2017-10-13 13:59:48 +02:00
061914f0d5 e2e: Do not print test logs by default
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: 5195ec8fb064795df77290a100e5d21ee482d68a
Component: engine
2017-10-13 13:40:21 +02:00
587a1111a1 Merge pull request #35139 from simonferquel/fix-remaining-containers-on-fail
Test & Fix build with rm/force-rm matrix
Upstream-commit: 9a166a74d174c34122fa1a3dfaf86e61f3ea1caf
Component: engine
2017-10-13 12:27:41 +02:00
9528dbc7cf Merge pull request #616 from thaJeztah/bump-moby
Bump moby to 1ffa10ee2630917e4f2a88f5e4daf34d700eaa1f
Upstream-commit: 54a10d544c
Component: cli
2017-10-13 11:48:41 +02:00
c90eb48e09 Merge pull request #34960 from sterchelen/34953-Prune-Volume-lack-event-entry
Fix #34953 how volumes are pruned from daemon
Upstream-commit: 2a7388a6c47a58c402acfe0059fbe27a7a090c23
Component: engine
2017-10-12 09:24:26 -07:00
0f96be35a7 Add nakedret linter.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: dbd96badb6
Component: cli
2017-10-12 11:48:51 -04:00
817827c1bc Test & Fix build with rm/force-rm matrix
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
Upstream-commit: 172e73a1dfb894c54fdc93fa6ef338eb1374d06c
Component: engine
2017-10-12 10:22:40 +02:00
aeff250acf Merge pull request #35173 from tophj-ibm/fix-raft-quorum-test
[integration-cli] fix flaky raft test
Upstream-commit: dc74e31bb211faa189ef83469d7f58dfde0b052a
Component: engine
2017-10-11 22:23:18 -07:00
c077b5031b Merge pull request #35151 from thaJeztah/always-return-version-information
Always return version and server headers
Upstream-commit: 591b2eeeb37c285d637a2c4071a59302010128cc
Component: engine
2017-10-11 18:11:35 -07:00
f0af38693c Updates for updated moby version
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: e56a58e4ed
Component: cli
2017-10-12 01:02:10 +02:00
3854f6d75a Bump moby to 1ffa10ee2630917e4f2a88f5e4daf34d700eaa1f
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 2f393694c2
Component: cli
2017-10-12 01:01:48 +02:00
594afcb5ff Merge pull request #35144 from Microsoft/jjh/fixdownlevel
Fix regression on inspect
Upstream-commit: 1ffa10ee2630917e4f2a88f5e4daf34d700eaa1f
Component: engine
2017-10-12 00:52:28 +02:00
4cde2a075b Merge pull request #35172 from cpuguy83/for_linux_126_dont_abort
Don't abort when setting may_detach_mounts
Upstream-commit: 02a2ba3e8b095f901d55020225a7300bf1eb04e1
Component: engine
2017-10-12 00:47:31 +02:00
107b0ea669 Merge pull request #611 from albers/completion-stack-deploy--resolve-image
Add bash completion for `stack deploy --resolve-image`
Upstream-commit: 6ef0ea82ea
Component: cli
2017-10-11 22:28:51 +02:00
81908c29d1 Merge pull request #580 from djgoosen/patch-1
Update rmi.md
Upstream-commit: 0a6e1cb3aa
Component: cli
2017-10-11 22:17:46 +02:00
f8ec7d1b83 Always return version and server headers
If a 400 error is returned due to an API version mismatch, no
version and server-identification headers were returned by the API.

All information in these headers is "static", so there is no
reason to omit the information in case of an error being
returned.

This patch updates the version middleware to always
return the headers.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: e9dac5ef5e8a4b0ecce0c89d337fea90f2c6aef3
Component: engine
2017-10-11 22:06:43 +02:00
33fa7572b6 Fix network name masking network ID on delete
If a network is created with a name that matches another
network's ID, the network with that name was masking the
other network's ID.

As a result, it was not possible to remove the network
with a given ID.

This patch changes the order in which networks are
matched to be what we use for other cases;

1. Match on full ID
2. Match on full Name
3. Match on Partial ID

Before this patch:

    $ docker network create foo
    336717eac9eaa3da6557042a04efc803f7e8862ce6cf96f6b9565265ba5c618b

    $ docker network create 336717eac9eaa3da6557042a04efc803f7e8862ce6cf96f6b9565265ba5c618b
    4a698333f1197f20224583abce14876d7f25fdfe416a8545927006c315915a2a

    $ docker network ls
    NETWORK ID          NAME                                                               DRIVER              SCOPE
    4a698333f119        336717eac9eaa3da6557042a04efc803f7e8862ce6cf96f6b9565265ba5c618b   bridge              local
    d1e40d43a2c0        bridge                                                             bridge              local
    336717eac9ea        foo                                                                bridge              local
    13cf280a1bbf        host                                                               host                local
    d9e4c03728a0        none                                                               null                local

    $ docker network rm 336717eac9eaa3da6557042a04efc803f7e8862ce6cf96f6b9565265ba5c618b
    4a698333f1197f20224583abce14876d7f25fdfe416a8545927006c315915a2a

    $ docker network ls
    NETWORK ID          NAME                DRIVER              SCOPE
    d1e40d43a2c0        bridge              bridge              local
    336717eac9ea        foo                 bridge              local
    13cf280a1bbf        host                host                local
    d9e4c03728a0        none                null                local

After this patch:

    $ docker network create foo
    2d1791a7def4e2a1ef0f6b83c6add333df0bb4ced2f196c584cb64e6bd94b835

    $ docker network create 2d1791a7def4e2a1ef0f6b83c6add333df0bb4ced2f196c584cb64e6bd94b835
    6cbc749a529cd2d9d3b10566c84e56c4203dd88b67417437b5fc7a6e955dd48f

    $ docker network ls
    NETWORK ID          NAME                                                               DRIVER              SCOPE
    6cbc749a529c        2d1791a7def4e2a1ef0f6b83c6add333df0bb4ced2f196c584cb64e6bd94b835   bridge              local
    166c943dbeb5        bridge                                                             bridge              local
    2d1791a7def4        foo                                                                bridge              local
    6c45b8aa6d8e        host                                                               host                local
    b11c96b51ea7        none                                                               null                local

    $ docker network rm 2d1791a7def4e2a1ef0f6b83c6add333df0bb4ced2f196c584cb64e6bd94b835
    2d1791a7def4e2a1ef0f6b83c6add333df0bb4ced2f196c584cb64e6bd94b835

    $ docker network ls
    NETWORK ID          NAME                                                               DRIVER              SCOPE
    6cbc749a529c        2d1791a7def4e2a1ef0f6b83c6add333df0bb4ced2f196c584cb64e6bd94b835   bridge              local
    166c943dbeb5        bridge                                                             bridge              local
    6c45b8aa6d8e        host                                                               host                local
    b11c96b51ea7        none                                                               null                local

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: e52001c56e12e4fc63fb5d89ef919295d6ddd5d5
Component: engine
2017-10-11 21:57:05 +02:00
09a047bcdd Merge pull request #35171 from justincormack/update-roadmap
Update the Roadmap
Upstream-commit: 38c5af2c44f67b58b5bb33c1ab519f37f5263083
Component: engine
2017-10-11 12:02:43 -07:00
6bfc0ecd57 Don't abort when setting may_detach_mounts
83c2152de503012195bd26069fd8fbd2dea4b32f sets the kernel param for
fs.may_detach_mounts, but this is not neccessary for the daemon to
operate. Instead of erroring out (and thus aborting startup) just log
the error.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: c6a2044497e0e1ff61350859c8572a2c31c17ced
Component: engine
2017-10-11 14:54:24 -04:00
2890f26aa9 Merge pull request #35150 from thaJeztah/fix-api-version-check
Return 400 error if API client is too new
Upstream-commit: 6f117e266f244b06c3e59fc6ab66c652b2e601ec
Component: engine
2017-10-11 11:26:12 -07:00
92d9dda9c1 [integration-cli] fix flaky raft test
Fixes previously flaky TestAPISwarmRaftQuorum.

In the test we are shutting down 2 of 3 nodes, all of which are managers.
When this happens the remaining node prepares to step down from being
a leader because there is no longer an active quorum. This test was
written before that change was implemented, and assumes that the
remaining node can still handle requests to create a service (it can't)

There was further flakiness depending on whether or not the node has
stepped down or was in the process of doing so. Fix this by waiting
for the node to completely step down and checking to see if it errors
out like it should.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: fd32d49c490126d830be6c1008ab20f6ffcee56c
Component: engine
2017-10-11 14:23:55 -04:00
fff68fafe8 Merge pull request #618 from albers/completion-secret-create--driver
Add bash completion for `secret create --driver`
Upstream-commit: 5c9784e3a3
Component: cli
2017-10-11 13:10:00 -04:00
0750d56f05 Add bash completion for secret create --driver
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 1d7a31f87e
Component: cli
2017-10-11 18:55:28 +02:00
e23a8c6c1c Update the Roadmap
As part of the Moby transition (see #35115), update the Roadmap to
reflect the new priorities. Also just update it as it was written
a while back, and we made some progress in areas such as `containerd`.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: de86d33b4a39d095e29b4857bc768363a70b3adc
Component: engine
2017-10-11 17:33:50 +01:00
c1fc769d9d Merge pull request #35113 from tych0/drop-useless-apparmor
drop useless apparmor denies
Upstream-commit: 9b9d00dd4b515918683e47fbb406d8a8f1c9cdbf
Component: engine
2017-10-11 18:12:51 +02:00
721e1b72bc Merge pull request #35170 from akimd/readme
API: minor fixes in the README
Upstream-commit: eee2df1083851f6c8e4365cd74a5997ad5f99624
Component: engine
2017-10-11 16:31:33 +02:00
68a51d42bd Merge pull request #34941 from dsheets/authz-tests-api-port
integration/plugin/authz: port tests from integration-cli
Upstream-commit: fe33ea9b0e5a295118feee0f46f45d92f8cc6103
Component: engine
2017-10-11 16:15:56 +02:00
9dcd903628 API: minor fixes in the README
The main point is to fix a non ASCII space character that wrecks the
markdown handling.

Signed-off-by: Akim Demaille <akim.demaille@docker.com>
Upstream-commit: ce58cd5a346d2ef02cd9b893e4a51f10382aaf11
Component: engine
2017-10-11 16:12:10 +02:00
ce49598ea9 Merge pull request #607 from riyazdf/update-dct-push-and-pull
Mutate image references where needed for trusted pulls
Upstream-commit: b70f9296dd
Component: cli
2017-10-11 15:08:04 +02:00
cd4b6a83b5 Merge pull request #35165 from justincormack/no-logo
Remove Docker logo
Upstream-commit: 303aec061129a5e60706da6f0344018ad052eb6e
Component: engine
2017-10-11 15:05:08 +02:00
1d7efaf3d1 Remove Docker logo
No longer used as we are using the Moby logo.

Refer to #35115 for more details.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: 9b87491729ad0b3e7bc2a97a1006ae43f5aef969
Component: engine
2017-10-11 13:17:59 +01:00
a5efd59e9b Merge pull request #35156 from yongtang/lego
Bring "Lego set" back in README.md
Upstream-commit: f762604fd099bc334525274138a796617c66659e
Component: engine
2017-10-11 12:05:42 +01:00
a2e7813d7e Fix tests after Hash() behavior change
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: d5b15f0d3ee6b9575a919ca5ba568631957425e0
Component: engine
2017-10-10 14:23:12 -07:00
66b3ea1c4e Update e2e test for image pull to check stdout
Also add TEST_DEBUG env variable for debugging E2E tests.
And change icmd environment helpers to fit the CmdOp interface os they
can be passed to 'icmd.RunCmd()'

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: b11c11ea74
Component: cli
2017-10-10 17:04:49 -04:00
ac808691c3 Refactor runPull to remove second GetImageReferencesAndAuth
Fix unit tests to catch the regression.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: e548861481
Component: cli
2017-10-10 16:32:27 -04:00
ac06921a97 factor out rigging for pushing unsigned busybox image
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 7dda6fc3c9
Component: cli
2017-10-10 12:00:52 -07:00
697f2a54c7 update image pull tests
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 46f3d8bb7f
Component: cli
2017-10-10 11:20:54 -07:00
8990f67e9c get e2e working with notary service
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: ade675d36c
Component: cli
2017-10-10 11:19:02 -07:00
d57a85ccfd update e2e tests for content trust tests
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 6e3bafd06b
Component: cli
2017-10-10 11:19:02 -07:00
f57d5e7b36 trust: update references when pulling
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 067fff8b03
Component: cli
2017-10-10 11:19:02 -07:00
4d03b3fd97 Merge pull request #35128 from thaJeztah/fix-ContainerExecAttach-type
Use correct type for ContainerExecAttach
Upstream-commit: 8b24d2a96024d7aa35a26744ea7c7df577accc4b
Component: engine
2017-10-10 10:59:16 -07:00
c5166635d0 Update rmi.md
Signed-off-by: Daniel Goosen <daniel.goosen@surveysampling.com>
Upstream-commit: 9004495541
Component: cli
2017-10-10 10:27:54 -07:00
24531cb28a Merge pull request #54 from seemethere/change_ubuntu_trusty_package_mirror
Switches ubuntu trusty mirror to one that works
Upstream-commit: e2507465495d5361fe9501a5f5e7172779a67e63
Component: packaging
2017-10-10 10:21:32 -07:00
69522bfabb Switches ubuntu trusty mirror to one that works
Was getting 404's with the old one, consider this one temporary until
canonical fixes their stuff.

Related:
https://bugs.launchpad.net/cloud-images/+bug/1711735

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 8e177368d0a30614a7ba615f3c2f2ede1e21ff8e
Component: packaging
2017-10-10 10:19:03 -07:00
41e90bb713 Merge pull request #33488 from raja-sami-10p/pkg/idtools
Increase Coverage of pkg/idtools
Upstream-commit: be4586fffd0f4eb095fd6d94ad067dbf220c1bd3
Component: engine
2017-10-10 18:37:49 +02:00
5a2940263e Merge pull request #35064 from LK4D4/replace_timer
Replace NewTimer().C with After
Upstream-commit: b6aa01570cd8d679afd716f648aeaeb35238fa79
Component: engine
2017-10-10 08:47:37 -07:00
b77f073e16 Merge pull request #35136 from ripcurld0/refactor_plugin_store_get
Refactor plugin store to reduce nested if's in Get
Upstream-commit: 34d502eb9e39847b170dc4f9d6598f6bc2627e9b
Component: engine
2017-10-10 08:07:36 -07:00
84fbbffdb4 fix panic on get container pid when live restore containers
Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
Upstream-commit: db8de0d0da0a5285dfc35d2c81553a1b2d8db24e
Component: engine
2017-10-10 22:45:34 +08:00
1ec5c9a00f Merge pull request #34758 from ghislainbourgeois/33495-add-tcp-to-gelf-log-driver
Add TCP support for GELF log driver
Upstream-commit: 3437f0f4e57453097c42088fcfc2ac6bf7c59170
Component: engine
2017-10-10 10:26:01 -04:00
1fb3125256 Add "Lego set" back in README.md
This PR adds the nice concept of "Lego set" back in README.md.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: d3787d1fdabd1c01b1de1aa761d76f888a533a01
Component: engine
2017-10-10 14:10:39 +00:00
5c3deebf70 Merge pull request #35141 from justincormack/update-readme
Update README for Moby Project
Upstream-commit: 786311be7d011960801d713f0d01ea9d36f63170
Component: engine
2017-10-10 12:51:52 +02:00
efe89988fe Return 400 error if API client is too new
Commit e98e4a71110fd33852bb755a9b8b4ebc9df904db implemented API version
negotiation using the `/_ping` endpoint. In that change, URL validation for the
maximum supported API version was removed from the API server (validation for
the _minimum_ version was kept in place).

With this feature, clients that support version negotiation would negotiate the
maximum version supported by the daemon, and downgrade to an older API version
if the client's default API version is not supported.

However, clients that do _not_ support version negotiation can call API versions
that are higher than the maximum supported version. Due to the missing version
check, this is silently ignored, and the daemon's default API version is used.

This is a problem, because the actual API version in use is non-deterministic;
for example, calling `/v9999.9999/version` on a daemon that runs API v1.34 will
use API v1.34, but calling the same URL on an older daemon may use API version
v1.24.

This patch reverts the removal of the API check for maximum supported versions.
The documentation has been updated accordingly

Before this patch is applied, the daemon returns a 200 (success):

    $ curl -v --unix-socket /var/run/docker.sock http://localhost/v9999.9999/version
    *   Trying /var/run/docker.sock...
    * Connected to localhost (/Users/sebastiaan/Library/Containers/com.dock) port 80 (#0)
    > GET /v9999.9999/version HTTP/1.1
    > Host: localhost
    > User-Agent: curl/7.54.0
    > Accept: */*
    >
    < HTTP/1.1 200 OK
    < Api-Version: 1.32
    < Content-Length: 240
    < Content-Type: application/json
    < Date: Tue, 10 Oct 2017 09:11:29 GMT
    < Docker-Experimental: true
    < Ostype: linux
    < Server: Docker/17.09.0-ce (linux)
    <
    {"Version":"17.09.0-ce","ApiVersion":"1.32","MinAPIVersion":"1.12","GitCommit":"afdb6d4","GoVersion":"go1.8.3","Os":"linux","Arch":"amd64","KernelVersion":"4.9.49-moby","Experimental":true,"BuildTime":"2017-09-26T22:45:38.000000000+00:00"}
    * Connection #0 to host localhost left intact

After this patch is applied, a 400 (Bad Request) is returned:

    $ curl -v --unix-socket /var/run/docker.sock http://localhost/v9999.9999/version
    *   Trying /var/run/docker.sock...
    * Connected to localhost (/var/run/docker.sock) port 80 (#0)
    > GET /v9999.9999/info HTTP/1.1
    > Host: localhost
    > User-Agent: curl/7.52.1
    > Accept: */*
    >
    < HTTP/1.1 400 Bad Request
    < Content-Type: application/json
    < Date: Tue, 10 Oct 2017 08:08:34 GMT
    < Content-Length: 89
    <
    {"message":"client version 9999.9999 is too new. Maximim supported API version is 1.34"}
    * Curl_http_done: called premature == 0
    * Connection #0 to host localhost left intact

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 01f9227ec9116b3969cb0725787e43a5fa26aac2
Component: engine
2017-10-10 11:17:48 +02:00
c4c23db3b4 Merge pull request #35117 from johnstep/fix-windows-manifest-lists
Stop filtering Windows manifest lists by version
Upstream-commit: 9ed0922683779a65bf729bcc2efef73d7536e543
Component: engine
2017-10-09 20:46:01 -07:00
388f100559 Merge pull request #35103 from abhi/master
Modifying integration test due to new ipam options in swarmkit
Upstream-commit: 9b8203c09678fd06aebb97e9418ca7f8ea0805ba
Component: engine
2017-10-09 19:32:41 -07:00
3730192eec Fix downlevel regression
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: f9b2a20819e7b29ce4dee46d87e8c32ae7ca9899
Component: engine
2017-10-09 13:47:28 -07:00
6cafcfb61b Vendoring libnetwork and swarmkit
Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
Upstream-commit: 2083121b0923dd084fc92873648b7ce74f725da5
Component: engine
2017-10-09 13:08:03 -07:00
3547a4b45b Refactor plugin store to reduce nested if's in Get
This patch removes the nested if's  in the Get function
and makes the code more readable.

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: 36ebf9489c3c6c8422d8ff9bb6e2cb65a9a66698
Component: engine
2017-10-09 22:21:27 +03:00
0772688cf2 Merge pull request #35138 from vdemeester/foo
Carry 35078 : Fix TestErrorCases to run all tests
Upstream-commit: 513f0e6c26cfac31d41a1eb249758907950cb7be
Component: engine
2017-10-09 12:16:16 -07:00
f174f34034 Fix #34953 how volumes are pruned from daemon
- Call the function that create an event entry while volumes are
pruning.
- Pass volume.Volume type on volumeRm instead of a name. Volume lookup is done
on the exported VolumeRm function.
- Skip volume deletion when force option used and it does not exists.

Signed-off-by: Nicolas Sterchele <sterchele.nicolas@gmail.com>
Upstream-commit: 63864ad8c17f0119a38af3cb9b1bc64a8afd0584
Component: engine
2017-10-09 21:15:26 +02:00
db22136d30 Update README for Moby Project
As described in #35115 Completing the Moby Transition, we would like to complete the transition
stage that we began a while back. This tries to clarify what and who this project is for.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: 737410d3f5f8579a26cfa009f4a654bbdf9ce485
Component: engine
2017-10-09 15:25:21 +01:00
9de8f7c5a8 Merge pull request #35129 from thaJeztah/add-content-length-headers
API docs: add information about Content-Length header
Upstream-commit: d9cd40d58bef2f607d4a798c99eb98cf56aab112
Component: engine
2017-10-09 06:42:54 -07:00
4d1cde4541 Fix TestErrorCases to run all tests
Signed-off-by: John Howard <jhoward@microsoft.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: d2c41f06c36dc24b2170fef365563d64cc5bd8ec
Component: engine
2017-10-09 15:15:58 +02:00
a808a78d53 Add bash completion for stack deploy --resolve-image
Also adds minimal documentation for this flag.

Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 9559b9b7a8
Component: cli
2017-10-09 13:39:54 +02:00
9b23ae7d55 API docs: add information about Content-Length header
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: a249ec36dd75df0fffa5d22f98422f778c60126e
Component: engine
2017-10-09 01:43:10 +02:00
016304f346 Use correct type for ContainerExecAttach
ContainerExecAttach used `types.ExecConfig` instead of `types.ExecStartCheck`,
which is the type that's expected by the `/exec/execid/start` API endpoint.

Investigating when this inconsistency was introduced, I found that the client has
sent the additional properties since its first imlpementation in
c786a8ee5e9db8f5f609cf8721bd1e1513fb0043.

The `postContainerExecStart()` at that time used the "jobs" package, which
only took the information from the body that was needed (`Detach` and `Tty`).

Commit 24425021d26f29a475702064181e6c99fb6bd1c5 refactored the Exec commands
to remove the "jobs", and introduced the `ExecStartCheck` type, but failed to
update the `cli.hijack()` call with the new type.

The change in this patch should not affect compatibility with older clients,
as the additional information from the `ExecConfig` type is not used (the
API server already decodes to the `ExecStartCheck` type).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 5fee8bddfeb9b268f3e0b3c91e0932ee9a5eff83
Component: engine
2017-10-09 01:25:46 +02:00
0fea1e1271 Merge pull request #35086 from friederbluemle/fix-github-spelling
Fix GitHub spelling
Upstream-commit: 97575ecda9bce64b12ead7b588da7acebb01fa22
Component: engine
2017-10-08 23:21:26 +02:00
e42b52cb32 Merge pull request #492 from albers/completion-daemon--network-control-plane-mtu
Add bash completion for `dockerd --network-control-plane-mtu`
Upstream-commit: fb7a817583
Component: cli
2017-10-08 17:49:58 +02:00
a7e36cfccc Fix returned error code for network creation from 500 to 409
Signed-off-by: He Xiaoxi <tossmilestone@gmail.com>
Upstream-commit: ab1871872d547e01f78a8a6c7af96c6cf05f793d
Component: engine
2017-10-08 16:00:00 +08:00
6fe1666e36 Merge pull request #610 from albers/completion-service--detach
Update bash completion and deprecation for synchronous service updates
Upstream-commit: e3c580c300
Component: cli
2017-10-07 15:31:48 +02:00
c50c8a6cf3 Update deprecation for synchronous service updates
- The default was not changed in 17.09 but will be in 17.10
- `service scale` and `service rollback` are also affected.

Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 20d9ceca78
Component: cli
2017-10-07 14:28:56 +02:00
80eb2d603b Update bash completion for synchronous docker service commands
The default value for
`docker service create|update|scale|rollback --detach|-d` changed from
`true` to `false`.
This updates bash completion to complete just `--detach|-d`.

Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 60bfaba6fb
Component: cli
2017-10-07 13:57:26 +02:00
e06cccc917 Add bash completion for docker trust commands
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: bb28364824
Component: cli
2017-10-07 13:29:10 +02:00
a34160d786 Remove unused variable from bash completion
Removes a copy & paste leftover.

Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 891c3a9d96
Component: cli
2017-10-07 13:29:10 +02:00
5fecfe49b1 Stop filtering Windows manifest lists by version
Signed-off-by: John Stephens <johnstep@docker.com>
Upstream-commit: 8ed8f4a71d7e1a936fa077b4348b7375c81746a6
Component: engine
2017-10-06 22:37:31 -07:00
a08850286d Merge pull request #34642 from Microsoft/jjh/add-platform-to-api
LCOW: API: Add `platform` to /images/create and /build
Upstream-commit: a3efe9722f34af5cf4443fe3a5c4e4e3e0457b54
Component: engine
2017-10-06 22:17:17 -07:00
3d973055bf LCOW: API change JSON header to string POST parameter
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: d98ecf2d6cdad7dae65868398440cfdc855e5263
Component: engine
2017-10-06 15:26:48 -07:00
35db73fa01 LCOW: API: Add platform to /images/create and /build
Signed-off-by: John Howard <jhoward@microsoft.com>

This PR has the API changes described in https://github.com/moby/moby/issues/34617.
Specifically, it adds an HTTP header "X-Requested-Platform" which is a JSON-encoded
OCI Image-spec `Platform` structure.

In addition, it renames (almost all) uses of a string variable platform (and associated)
methods/functions to os. This makes it much clearer to disambiguate with the swarm
"platform" which is really os/arch. This is a stepping stone to getting the daemon towards
fully multi-platform/arch-aware, and makes it clear when "operating system" is being
referred to rather than "platform" which is misleadingly used - sometimes in the swarm
meaning, but more often as just the operating system.
Upstream-commit: 0380fbff37922cadf294851b1546f4c212c7f364
Component: engine
2017-10-06 11:44:18 -07:00
1bfeb65ddc Fix GitHub spelling
Signed-off-by: Frieder Bluemle <frieder.bluemle@gmail.com>
Upstream-commit: b80472cef449d900ca9496d97e1527556ff6a04f
Component: engine
2017-10-07 00:10:24 +08:00
70ad19f2e6 drop useless apparmor denies
These files don't exist under proc so this rule does nothing.

They are protected against by docker's default cgroup devices since they're
both character devices and not explicitly allowed.

Signed-off-by: Tycho Andersen <tycho@docker.com>
Upstream-commit: b4a6ccbc5fe695062111cad5a20bb3d0ac5a94db
Component: engine
2017-10-06 09:11:59 -06:00
f7a982fdaa Modifying swarm integration test
Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
Upstream-commit: 7e6b2165ef58e68ad4eafd457e8de89dd4c2c6b1
Component: engine
2017-10-05 18:20:00 -07:00
318e1046f2 Merge pull request #35090 from dmcgowan/windows-support-os-version
Add support for Windows version filtering on pull
Upstream-commit: b8571fd81c7d2223c9ecbf799c693e3ef1daaea9
Component: engine
2017-10-05 17:31:23 -07:00
9d743bcb10 Merge pull request #598 from thaJeztah/fix-dockerd-heading-levels
Fix dockerd reference heading levels
Upstream-commit: 1649af8129
Component: cli
2017-10-06 01:51:19 +02:00
dace19a103 Add support for Windows version filtering on pull
Update logic to choose manifest from manifest list to check
for os version on Windows. Separate the logic for windows
and unix to keep unix logic the same.


Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: 38aef56e1fcb8ea318df98c89cf002267b88a136
Component: engine
2017-10-05 13:31:58 -07:00
6a849f46fd Merge pull request #603 from thaJeztah/fix-service-create-markdown
Fix markdown link in service-create reference docs
Upstream-commit: 0f659d99bd
Component: cli
2017-10-05 21:49:29 +02:00
8a57c20de6 Merge pull request #35088 from thaJeztah/bump-golang-to-1.8.4
Bump Go to 1.8.4
Upstream-commit: 2bc9bff86707737ff5df5f23b613d16281f9d223
Component: engine
2017-10-05 21:46:55 +02:00
e55a2343f6 Merge pull request #547 from rdxmb/small-change
small reference change
Upstream-commit: 2801d382c6
Component: cli
2017-10-05 11:56:33 -07:00
6464eb5e89 Merge pull request #35022 from thaJeztah/fix-conflict-status-code
Fix conflicting container name producing 400 error instead of 409
Upstream-commit: f8806b18b4b92c5e1980f6e11c917fad201cd73c
Component: engine
2017-10-05 11:18:06 -07:00
aba7eac9a8 Merge pull request #35085 from thaJeztah/update-portconfig-swagger
Add PortConfig.PublishMode to API documentation
Upstream-commit: f0e393bd0a3064aa72e7aebe2308d518c8fce676
Component: engine
2017-10-05 11:15:17 -07:00
50093b06f0 Merge pull request #600 from thaJeztah/bump-golang-to-1.8.4
Bump Go to 1.8.4
Upstream-commit: 08d81681af
Component: cli
2017-10-05 18:49:00 +02:00
35d18f8b33 Bump Go to 1.8.4
Bumps the Go version used to 1.8.4, which contains security fixes;
https://groups.google.com/forum/#!topic/golang-announce/1hZYiemnkdE

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 6b35e98a61
Component: cli
2017-10-05 18:43:33 +02:00
7cd305fd99 Add docs for Dockerfile ADD/COPY --chown flag
Document the new `--chown` flag added to the ADD and COPY commands in
the Dockerfile format.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
Upstream-commit: a83b9f102b
Component: cli
2017-10-05 12:35:01 -04:00
2af9de07de Fix load order
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: af8f563922
Component: cli
2017-10-05 12:03:29 -04:00
87d82fc493 Merge pull request #35087 from corbin-coleman/fix-integration-stats-test
Fix One of the Docker Stats Tests in /integration-cli
Upstream-commit: ed082152f6e7c6c7c7fbf2bc777ba1ae88cb9073
Component: engine
2017-10-05 17:59:53 +02:00
bf9a49688b Merge pull request #35084 from thaJeztah/update-authors
Update mailmap and authors
Upstream-commit: a437b078d33bc4284de80be842d0ee9e5c8a18af
Component: engine
2017-10-05 12:21:34 +02:00
afca8202d7 Fix markdown link in service-create reference docs
Markdown nested in a HTML table doesn't work, so changing
the link to a plain HTML link.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 6b6511f191
Component: cli
2017-10-05 12:17:40 +02:00
d9d9c820a9 Merge pull request #599 from friederbluemle/fix-github-spelling
Fix GitHub spelling
Upstream-commit: 472fcca185
Component: cli
2017-10-05 09:39:39 +02:00
b69e823a30 Merge pull request #35056 from tklauser/win-console-mode-consts
Use windows console mode constants from Azure/go-ansiterm
Upstream-commit: 1c4fad8135b52a8a6405aef897712c4ca7a6d168
Component: engine
2017-10-05 00:41:22 +02:00
cf634f106b Cast interpolated values
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 18ddec447a
Component: cli
2017-10-04 17:36:47 -04:00
691ff82d89 Update interface of Interpolate
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 0aa7ca943c
Component: cli
2017-10-04 17:36:43 -04:00
9256ae419b Vendor gotestyourself/env
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: edcea7c7a6
Component: cli
2017-10-04 17:36:43 -04:00
8d9cd6c880 Replace NewTimer().C with After
It is the same thing

Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
Upstream-commit: 1a517a4a429d2b4db15383fc9d514fc8db66f8d3
Component: engine
2017-10-04 14:24:19 -07:00
9aa7f4c8ce Bump Go to 1.8.4
Bumps the Go version used to 1.8.4, which contains
security fixes; https://groups.google.com/forum/#!topic/golang-announce/1hZYiemnkdE

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 33e8141f63ccc1a660529cd0d3581bd908bc8c1b
Component: engine
2017-10-04 23:22:23 +02:00
d29f681cdb Use the first 12 characters of the ID to match the output of docker stats command
Signed-off-by: Corbin <corbin.coleman@docker.com>
Upstream-commit: 8c10098ea51017fb514bef5c31a310a3f2d0d411
Component: engine
2017-10-04 13:43:00 -07:00
9da01454db Fix conflicting container name producint 400 error instead of 409
Commit ebcb7d6b406fe50ea9a237c73004d75884184c33 removed string checking
for error messages, in favor of typed errors.

In this change, the status code for conflicting container  names
changed from 409 to 400 (validationError).

This patch add a `nameConflictError`, changing the status code to
409 as it was in older versions.

With this change applied, the correct 409 status is returned:

```bash
$ docker create --name c1 busybox
```

```bash
$ curl --unix-socket /var/run/docker.sock -v -XPOST -H"Content-Type: application/json" -d'{"Image":"busybox"}' http://localhost/containers/create?name=c1
Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying /var/run/docker.sock...
* Connected to localhost (/var/run/docker.sock) port 80 (#0)
> POST /containers/create?name=c1 HTTP/1.1
> Host: localhost
> User-Agent: curl/7.52.1
> Accept: */*
> Content-Type: application/json
> Content-Length: 19
>
* upload completely sent off: 19 out of 19 bytes
< HTTP/1.1 409 Conflict
< Api-Version: 1.33
< Content-Type: application/json
< Docker-Experimental: false
< Ostype: linux
< Server: Docker/17.06.0-dev (linux)
< Date: Thu, 28 Sep 2017 15:07:23 GMT
< Content-Length: 229
<
{"message":"Conflict. The container name \"/c1\" is already in use by container \"ed2efdc806c1883954e677eb9ab8cbc7e286c9c5934ef6724fd5d93c56744923\". You have to remove (or rename) that container to be able to reuse that name."}
* Curl_http_done: called premature == 0
* Connection #0 to host localhost left intact
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: e424343b4348f994d5c2922e7556629a620b4b3b
Component: engine
2017-10-04 20:39:45 +02:00
ab0a17f568 Fix GitHub spelling
Signed-off-by: Frieder Bluemle <frieder.bluemle@gmail.com>
Upstream-commit: 45c9b9b6c1
Component: cli
2017-10-05 01:14:31 +08:00
962e70214f Fix dockerd reference heading levels
Commit ddadd3db49 changed
the heading levels of various sections, but as a result,
the "daemon configuration file" section (and other sections)
changed from a H2 to a H4, therefore no longer showing
up in the page's TOC / navigation bar.

This patch changes the heading level to a H3 for
sections that should show up in the page navigation.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: aca0421eb8
Component: cli
2017-10-04 18:09:12 +02:00
c1d495468d Add PortConfig.PublishMode to API documentation
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: fd90733972c6e78a0871b068e01e29ae1ac97fd7
Component: engine
2017-10-04 15:34:08 +02:00
27685bd51b Update mailmap and authors
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 4309d3cf6b12fb7e9c5f23b756aed33f6dd74d1e
Component: engine
2017-10-04 14:44:24 +02:00
7bcc658be1 Merge pull request #35072 from tophj-ibm/fix-kernel-version-detection
[integration-cli] fix s390x flaky test
Upstream-commit: d65ab869e8712d08fb94a5337b83df5d247bf25b
Component: engine
2017-10-03 23:46:10 +02:00
669254d0fe Merge pull request #568 from matt9ucci/DockerCompletion
Add link to DockerCompletion for PowerShell
Upstream-commit: f7ef79228e
Component: cli
2017-10-03 21:50:58 +02:00
d069c92fec Add gelf log driver plugin to Windows build
Signed-off-by: Mike Estes <mle_ii@yahoo.com>
Upstream-commit: 10b449b997373df37f285594a624545ad3e173b2
Component: engine
2017-10-03 12:42:54 -07:00
c75056fadb [integration-cli] fix s390x flaky test
s390x node-1 has kernel 4.6.0, kernel.CompareKernelVersion()
returns 0 if the kernels are equal, so include that.

Full logic for CompareKernelVersion() is
a > b ret 1,
a == b ret 0,
a < b ret -1

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: aa5ea652c8864f014e1fa480d7e504f0d742c170
Component: engine
2017-10-03 12:13:29 -04:00
7d7cb9a4d0 Merge pull request #593 from thaJeztah/add-create-output
Add output for "secrets" and "configs" on stack deploy
Upstream-commit: 1367fc1114
Component: cli
2017-10-03 11:06:04 -04:00
cbaa579597 Merge pull request #594 from thaJeztah/remove-deprecated-error-check
Remove use of deprecated IsErr...NotFound checks
Upstream-commit: daafdf3d84
Component: cli
2017-10-03 10:30:55 -04:00
b11186b8f9 Merge pull request #34342 from coolljt0725/fallback_to_naive_diff
Fallback to use naive diff driver if enable CONFIG_OVERLAY_FS_REDIRECT_DIR
Upstream-commit: 595b929c573236dd95111429039f7f0788c1a7e5
Component: engine
2017-10-03 06:45:17 -07:00
233679b950 Merge pull request #35069 from thaJeztah/remove-deprecated-error-check
Remove deprecated error checks
Upstream-commit: 882563b2d64a99f24923c4b2bfe90750f2fdd433
Component: engine
2017-10-03 06:40:47 -07:00
fdd1bd7910 Add output for "secrets" and "configs" on stack deploy
When deploying a stack from a compose file, the output did not show
that a secret or config was created. This patch adds messages for these.

Create a configuration file and compose file:

    $ cat > config.yml <<EOF
    hello: world
    EOF

    $ cat > secret.txt <<EOF
    p@ssw0rd
    EOF

    $ cat > docker-compose.yml <<EOF
    version: "3.3"
    services:
       test:
         image: nginx:alpine
         configs:
         - source: myconfig
           target: /my-config.yml
         secrets:
         - source: mysecret
           target: /my-secret.txt
    configs:
      myconfig:
        file: ./config.yml
    secrets:
      mysecret:
        file: ./secret.txt
    EOF

Before this patch is applied:

    $ docker stack deploy -c docker-compose.yml example
    Creating network example_default
    Creating service example_test

After this patch is applied:

    $ docker stack deploy -c docker-compose.yml example
    Creating network example_default
    Creating secret example_mysecret
    Creating config example_myconfig
    Creating service example_test

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: a5113f4368
Component: cli
2017-10-03 15:13:10 +02:00
72747182f4 Remove deprecated IsErr...NotFound() functions
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 7553fc4bcd80d103096f2e8f662b7fb3c65b5249
Component: engine
2017-10-03 12:07:49 +02:00
886e433681 Replace uses of deprecated IsErr...Notfound()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 919726b5dbf7f063f82eac2f5384966fc7271710
Component: engine
2017-10-03 12:05:03 +02:00
338d1dac66 Remove use of deprecated IsErr...NotFound checks
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 532a3942d6
Component: cli
2017-10-03 12:01:24 +02:00
1941c5110e Merge pull request #35063 from LK4D4/locker_benchmarks
pkg/locker: add benchmarks
Upstream-commit: a8e7aca3fd2aeefa24b3f1a039f8c63b0301cacf
Component: engine
2017-10-03 09:45:56 +02:00
9aa431ea90 Merge pull request #560 from dnephin/fix-bind-mount-named-pipe-compose
Support parsing of named pipes for compose volumes
Upstream-commit: 448d56a491
Component: cli
2017-10-03 09:29:13 +02:00
63ac4b5569 Skip all testdata in integration
Also skip.IfCondition directly from the test, so that the skip message is correct

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 104c1c68438c5c59ab0e7a5fb2da6bae4ce6d080
Component: engine
2017-10-02 17:02:52 -04:00
d35ee25d03 pkg/locker: add benchmarks
Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
Upstream-commit: 889cfd1b441e8039bb6b78e8c54276b8eb03cdef
Component: engine
2017-10-02 11:20:21 -07:00
d52520c4a7 Merge pull request #579 from thaJeztah/dont-trunc-on-quiet
Do not truncate ID on docker service ps --quiet
Upstream-commit: adfc2d17a0
Component: cli
2017-10-02 10:33:23 -04:00
4b75060b8c integration/plugin/authz: inline CLI work-alike library
I strongly disagree with the design of this pull request.

Signed-off-by: David Sheets <dsheets@docker.com>
Upstream-commit: 1574d91463efd4741c2f6620718abdb624967584
Component: engine
2017-10-02 14:20:59 +01:00
8ebec737fa integration/plugin/authz: port tests from integration-cli
Signed-off-by: David Sheets <dsheets@docker.com>
Upstream-commit: 928b0631c96ae5cb0105b3bf42d43ba529a14aa1
Component: engine
2017-10-02 14:20:59 +01:00
5f75b4dbc3 Merge pull request #578 from thaJeztah/bump-tonistiigi-fsutil
vendor tonistiigi/fsutil to dea3a0da73aee887fc02142d995be764106ac5e2
Upstream-commit: 63b795e71f
Component: cli
2017-10-02 11:00:11 +02:00
46c885c3e3 Use all console mode constants from go-ansiterm
The missing console mode constants were added to go-ansiterm in
Azure/go-ansiterm#23. Use these constants instead of defining them
locally.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Upstream-commit: 9335683fa50c4863ada4bf00a30e7dfbfef3c783
Component: engine
2017-10-02 09:49:20 +02:00
81273ccd92 vendor: re-vendor github.com/Azure/go-ansiterm
Re-vendor go-ansiterm to d6e3b3328b783f23731bc4d058875b0371ff8109 in
order to get the newly added console mode constants.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Upstream-commit: 2b946fbc7012eff745e23aa43672f4ce4c5208a6
Component: engine
2017-10-02 09:47:38 +02:00
7a1f68fd02 Add credentials endpoint option for awslogs driver
Signed-off-by: Adnan Khan <adnkha@amazon.com>
Upstream-commit: c7cc9d67590dd11343336c121e3629924a9894e9
Component: engine
2017-10-02 00:25:49 -07:00
5f36dc5666 Merge pull request #35052 from x1957/typo
fix typo
Upstream-commit: 1e94a4862ee2d92976c26ff741585d090169ed42
Component: engine
2017-10-01 15:31:11 -04:00
cfbb3b1158 Merge pull request #34874 from pascalgn/patch-1
Reworded push message
Upstream-commit: 4a244c3558ab6985ba110d261920b575016fd2d4
Component: engine
2017-10-01 10:29:43 -07:00
76886c96d8 fix typo
Signed-off-by: Yuhao Fang <fangyuhao@gmail.com>
Upstream-commit: c673319dea5adcb33379b13f8e70c1d157e7c87d
Component: engine
2017-10-01 23:11:58 +08:00
d7b8803737 Merge pull request #50 from thaJeztah/add-debian-buster
Add builds for debian buster
Upstream-commit: a7630bdc8bb0a5928174675d4948a437eaf4849e
Component: packaging
2017-09-30 13:38:22 -07:00
a6c488e8bc Do not truncate ID on docker service ps --quiet
Running `docker service ps --quiet` should print the
full, non-truncated ID, even if the `--no-trunc` option
is not set.

This patch disables truncation if the `--quiet` flag
is set.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: c5f267d95c
Component: cli
2017-09-30 22:23:37 +02:00
ae4be632f1 Merge pull request #35045 from thaJeztah/bump-tonistiigi-fsutil
vendor tonistiigi/fsutil to dea3a0da73aee887fc02142d995be764106ac5e2
Upstream-commit: 9c9f4d6f70a14e00902cae19dd586a6faa6476f6
Component: engine
2017-09-30 13:23:30 -07:00
1c031cd7d9 vendor tonistiigi/fsutil to dea3a0da73aee887fc02142d995be764106ac5e2
removes the stevvooe/continuity dependency, which has moved to
containerd/continuity.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 197842fd45
Component: cli
2017-09-30 18:26:02 +02:00
4e99cb1e84 vendor tonistiigi/fsutil to dea3a0da73aee887fc02142d995be764106ac5e2
removes the stevvooe/continuity dependency, which has moved to
containerd/continuity.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: e3c130df944bc433efe7bc5bddebbb1ac0f35d93
Component: engine
2017-09-30 18:04:11 +02:00
e3c5bf234d Merge pull request #577 from stevvooe/allocate-channel
cli/command/container: ensure channel is allocated
Upstream-commit: 583015b896
Component: cli
2017-09-30 12:33:40 +02:00
b123db0bdc Merge pull request #35044 from thaJeztah/bump-api-version-1.34
Bump API version to 1.34
Upstream-commit: 19015df2b06769a0908ba9eeae72d9b785684ed3
Component: engine
2017-09-29 22:20:30 -10:00
4b6bbc7c4a Merge pull request #35040 from thaJeztah/bump-vndr
Bump vndr to a6e196d8b4b0cbbdc29aebdb20c59ac6926bb384
Upstream-commit: e223bbedc127b7260ac2c8702cbd8e41d764b4d1
Component: engine
2017-09-29 16:48:52 -10:00
a0cdbef9a2 cli/command/container: ensure channel is allocated
Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: e78772af4d
Component: cli
2017-09-29 18:12:03 -07:00
6e3b4640d2 Bump API version to 1.34
Docker 17.10 was cut off from ab2b03a0e139537376bbf66c1e1e9e897a403f06

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 288abf0854852b4542da359400b3c29e99941fc9
Component: engine
2017-09-30 01:13:20 +02:00
b92094248e Merge pull request #576 from thaJeztah/bump-version
Bump version to 17.11.0-dev
Upstream-commit: b75be206d0
Component: cli
2017-09-30 01:10:00 +02:00
6d5c926ee5 Merge pull request #258 from andrewhsu/e
update moby-extras tool fixes git param
2017-09-29 16:09:47 -07:00
1ef62ff784 Bump version to 17.11.0-dev
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 2a82adcbe0
Component: cli
2017-09-30 00:59:27 +02:00
328a5917ad Merge component 'engine' from git@github.com:moby/moby master 2017-09-29 22:30:27 +00:00
8591aa0956 update moby-extras tool fixes git param
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2017-09-29 15:17:11 -07:00
09bc512154 Merge component 'cli' from git@github.com:docker/cli master 2017-09-29 22:08:57 +00:00
4b8b813d22 Merge pull request #570 from thaJeztah/bump-moby-vendor
Bump moby vendor to 14ce1f1cf48e9859223c6311de58aec4dc
Upstream-commit: 31908a4b45
Component: cli
2017-09-29 23:08:16 +02:00
0e6592d05e Merge pull request #572 from thaJeztah/bump-vendor-for-powerpc
revendor logrus and x/crypto
Upstream-commit: 00cc728dfb
Component: cli
2017-09-29 13:58:38 -07:00
4c4e74cebe Merge pull request #35042 from pradipd/panic_fix
Fixing panic when sandbox is nil
Upstream-commit: ab2b03a0e139537376bbf66c1e1e9e897a403f06
Component: engine
2017-09-29 12:51:55 -07:00
5103c6279f builder: fix build cache hash for broken symlink
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 793ebdbf4b187b3680aed0073643040ddbeef523
Component: engine
2017-09-29 09:27:51 -07:00
28e35b96d0 Fixing panic when sandbox is nil
Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
Upstream-commit: c4ad0747e929a41ecec7e8c2ae2bd0cc037401ed
Component: engine
2017-09-29 09:23:06 -07:00
c9fbb737e9 Fixes for updated dependencies
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 0082310aa5
Component: cli
2017-09-29 17:45:31 +02:00
c9e8020d97 bump moby/moby and dependencies to 14ce1f1cf48e9859223c6311de58aec4dc0f046c
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 98dbfeee76
Component: cli
2017-09-29 17:44:49 +02:00
0b195d3e47 Merge pull request #571 from thaJeztah/bump-vndr
Bump vndr to a6e196d8b4b0cbbdc29aebdb20c59ac6926bb384
Upstream-commit: 107f6c6ab2
Component: cli
2017-09-29 17:39:21 +02:00
a2cd96f46a Reworded push message
Changed push message from "The push refers to a repository" to "The push refers to the repository" to make it clearer that this is just an information about the local source and not a distinction between pushing single images or whole repositories.

Signed-off-by: Pascal <pascalgn@users.noreply.github.com>
Upstream-commit: d82948b75d8aba97816ff5257240c1edb5e8de5b
Component: engine
2017-09-29 17:02:20 +02:00
6230f06c47 revendor logrus and x/crypto
updates to the same version as is currently used
on moby/moby; this bump contains fixes for ppc64le.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: e3b7700fb9
Component: cli
2017-09-29 15:32:42 +02:00
bf69bcbb74 Bump vndr to a6e196d8b4b0cbbdc29aebdb20c59ac6926bb384
Includes a fix to cleanup unused vendor-directories

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 67b1f54dc2413a018ac42e4335ca182a2d0b8a1d
Component: engine
2017-09-29 15:09:57 +02:00
5edb9ec08c Bump vndr to a6e196d8b4b0cbbdc29aebdb20c59ac6926bb384
Includes a fix to cleanup unused vendor-directories

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 368b639e7e
Component: cli
2017-09-29 14:58:05 +02:00
c90aa1161d Add link to DockerCompletion for PowerShell
Signed-off-by: Masatoshi Higuchi <matt9ucci@gmail.com>
Upstream-commit: f7dfc946fe
Component: cli
2017-09-29 17:04:33 +09:00
907b966c7e Merge pull request #35029 from fntlnz/builder/cleaning
Cleaning dead code out of the builder
Upstream-commit: de6cb7ab848d6131634e40d21d30bf2fe183e9a3
Component: engine
2017-09-29 16:28:02 +09:00
4034b44eca Cleaning dead code out of the builder
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Upstream-commit: dff2a23749a6b7c949146d7850f514cd74e3a8d7
Component: engine
2017-09-29 02:55:35 +02:00
80c3ad8db1 Merge pull request #35008 from yujuhong/cli-version
Fix version comparison when negotiating the the API version
Upstream-commit: 14ce1f1cf48e9859223c6311de58aec4dc0f046c
Component: engine
2017-09-28 11:58:50 -10:00
d62e09de17 Merge pull request #35025 from Microsoft/jjh/TestRunAttachFailedNoLeak
Windows: RS3: Temporarily disable TestRunAttachFailedNoLeak
Upstream-commit: 048ef0db6a75898aee57bf725ed64940744cd938
Component: engine
2017-09-28 21:59:32 +02:00
5fe53bab44 Merge pull request #565 from thaJeztah/change-stats-format
Change default stats format and add --no-trunc flag
Upstream-commit: 64d5c32b8e
Component: cli
2017-09-28 15:14:43 -04:00
ae273c63d1 Merge component 'engine' from git@github.com:moby/moby master 2017-09-28 10:34:35 -07:00
4330196b5a Windows: RS3: Temporarily disable TestRunAttachFailedNoLeak
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 9e587fa72b8cc42895681efe3d0b9fdcdfe3b06d
Component: engine
2017-09-28 10:15:58 -07:00
e25514ef0c Merge pull request #35004 from thaJeztah/dont-warn-for-comment-only-lines
Warn on empty continuation lines only, not on comment-only lines
Upstream-commit: 94b987043ffd372aad49dfc51c3be2c2f6cff97f
Component: engine
2017-09-28 08:56:30 -07:00
d6eb3e21a4 Merge pull request #35007 from seemethere/fix_service_detach_tests
Explicitly add --detach to service CLI calls
Upstream-commit: 5a4841079bc247937e6ed1042ab24ffd01a8547c
Component: engine
2017-09-28 11:17:14 +02:00
747a47b477 Fix version comparison when negotiating the the API version
Signed-off-by: Yu-Ju Hong <yjhong@google.com>
Upstream-commit: 4b6ec10b07c14e7fff1cc51156b6d954147f826f
Component: engine
2017-09-27 18:42:02 -07:00
d7aeee3eda remove --detach on scale
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: 0ad0294124badebe0d9a73f1b7e2f030e4a24e2b
Component: engine
2017-09-27 17:47:51 -07:00
8d23cb5213 Merge pull request #34966 from AkihiroSuda/seccomp
Dockerfile: use seccomp provided by stretch
Upstream-commit: aa02e2b7bc1f5f4b921f64337e4f6d1cf7aa8fe4
Component: engine
2017-09-27 16:21:55 -07:00
ca5a5c5ca1 Explicitly add --detach to service CLI calls
The behavior of service (create/update/scale) was changed in a recent PR
to docker/cli. This commit serves to remedy test failures experienced
when attempting to use service calls.

Should not affect current behavior.

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: e5b3ebbc649e4b1a10d4cdca342a153c301ec225
Component: engine
2017-09-27 16:17:55 -07:00
f6d296e26e Warn on empty continuation lines only, not for comments
Commit 8d1ae76dcbbb73d8e20c6a14a7d3fe2410b95f55 added
deprecation warnings for empty continuation lines,
but also treated comment-only lines as empty.

This patch distinguishes empty continuation lines
from comment-only lines, and only outputs warnings
for the former.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 2fd736ac10c1c46d1001373d887cb99b3d8ee824
Component: engine
2017-09-28 00:11:10 +02:00
9e4f6bb515 minimize changelog template
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2017-09-27 11:31:04 -07:00
00bb761ead Merge pull request #34990 from pradipd/update_field_name
Update field name
Upstream-commit: 853df8f32bf560428fdc39dfd9bfa7bb7c610346
Component: engine
2017-09-27 20:00:18 +02:00
747646833d Merge component 'engine' from git@github.com:moby/moby master 2017-09-27 10:25:04 -07:00
b4a6a3d358 Add --no-trunc option to docker container stats
This patch adds a `--no-trunc` option to `docker container stats`;

With this patch applied, the default output is:

    CONTAINER ID        NAME                                    CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O           PIDS
    b95a83497c91        awesome_brattain                        0.28%               5.629MiB / 1.952GiB   0.28%               916B / 0B           147kB / 0B          9
    67b2525d8ad1        foobar                                  0.00%               1.727MiB / 1.952GiB   0.09%               2.48kB / 0B         4.11MB / 0B         2
    e5c383697914        test-1951.1.kay7x1lh1twk9c0oig50sd5tr   0.00%               196KiB / 1.952GiB     0.01%               71.2kB / 0B         770kB / 0B          1
    4bda148efbc0        random.1.vnc8on831idyr42slu578u3cr      0.00%               1.672MiB / 1.952GiB   0.08%               110kB / 0B          578kB / 0B          2
    84e3deaa45b2        registry                                0.01%               3.402MiB / 1.952GiB   0.17%               127kB / 378B        233kB / 0B          10
    2ed915778ceb        foo.1.lsmxrefn5yp9c9ijz1hzgdq4u         0.00%               1.727MiB / 1.952GiB   0.09%               166kB / 7.76kB      614kB / 0B          2

Addin the `--no-trunc` option, changes the output to:

    CONTAINER ID                                                       NAME                                    CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O           PIDS
    b95a83497c9161c9b444e3d70e1a9dfba0c1840d41720e146a95a08ebf938afc   awesome_brattain                        0.25%               5.75MiB / 1.952GiB    0.29%               648B / 0B           147kB / 0B          10
    67b2525d8ad10bb236a49960e93c09993b0baabeef12c2d46cd5f4fbb6f4808c   foobar                                  0.00%               1.727MiB / 1.952GiB   0.09%               2.35kB / 0B         4.11MB / 0B         2
    e5c383697914b98b10cbbc9d0bd324b7b927099ac584f031057b8208d2fba9b1   test-1951.1.kay7x1lh1twk9c0oig50sd5tr   0.00%               196KiB / 1.952GiB     0.01%               71.1kB / 0B         770kB / 0B          1
    4bda148efbc006b0063373c3678083159af89f8cc83a6a28def14cb0dd171f70   random.1.vnc8on831idyr42slu578u3cr      0.00%               1.672MiB / 1.952GiB   0.08%               110kB / 0B          578kB / 0B          2
    84e3deaa45b2fc363e06167df9b90ab59f88d4f101e3f9b8df03a62a8f6783e1   registry                                0.00%               3.387MiB / 1.952GiB   0.17%               127kB / 378B        233kB / 0B          10
    2ed915778cebddf9ec69263a75cfdcf00962a5198d94d42cda75d5cd45bb82f2   foo.1.lsmxrefn5yp9c9ijz1hzgdq4u         0.00%               1.727MiB / 1.952GiB   0.09%               166kB / 7.76kB      614kB / 0B          2

Which is the same as the default before this patch was applied.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: e63417a9c0
Component: cli
2017-09-27 18:59:25 +02:00
915d4f9741 Merge component 'cli' from git@github.com:docker/cli master 2017-09-27 09:23:02 -07:00
a58b05b91c Update default output format for stats to include ID and Name
The `docker container stats` output has a column (`CONTAINER`), that shows either
the container _id_ or container _name_, depending on the arguments given.

For example, running `docker container stats foobar` shows:

    CONTAINER           CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O           PIDS
    foobar              0.00%               1.938MiB / 1.952GiB   0.10%               782B / 0B           4.11MB / 0B         2

Whereas `docker container stats 67b2525d8ad1` (`67b2525d8ad1` being the ID for
container `foobar`) shows:

    CONTAINER           CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O           PIDS
    67b2525d8ad1        0.00%               1.938MiB / 1.952GiB   0.10%               916B / 0B           4.11MB / 0B         2

This behavior is confusing.

This patch updates the default output format for `docker stats` to use separate
columns for container ID and container Name (similar to `docker container ls`).

With this patch applied, both commands show the same output:

    $ docker container stats foobar
    CONTAINER ID                                                       NAME                CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O           PIDS
    67b2525d8ad10bb236a49960e93c09993b0baabeef12c2d46cd5f4fbb6f4808c   foobar              0.00%               1.938MiB / 1.952GiB   0.10%               1.25kB / 0B         4.11MB / 0B         2

    $ docker container stats 67b2525d8ad1
    CONTAINER ID                                                       NAME                CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O           PIDS
    67b2525d8ad10bb236a49960e93c09993b0baabeef12c2d46cd5f4fbb6f4808c   foobar              0.00%               1.938MiB / 1.952GiB   0.10%               1.31kB / 0B         4.11MB / 0B         2

Users that want to use the old format can configure a custom format in the
cli configuration file (`~/.docker/config.json`);

on Linux:

    {
      "statsFormat" : "table {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.MemPerc}}\t{{.NetIO}}\t{{.BlockIO}}\t{{.PIDs}}"
    }

on Windows:

    {
      "statsFormat" : "table {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.NetIO}}\t{{.BlockIO}}"
    }

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 0a78472211
Component: cli
2017-09-27 18:05:51 +02:00
4d03073a2c Merge pull request #34811 from yongtang/runc
Update runc to 0351df1c5a66838d0c392b4ac4cf9450de844e2d
Upstream-commit: 502eddb9859dcd30ce46732b24cefe49cf1ccbd1
Component: engine
2017-09-27 08:44:43 -07:00
d14643fb47 Merge pull request #34792 from runcom/fix-relabel-symlinks
volume: evaluate symlinks before relabeling mount source
Upstream-commit: f60e7aac62a14907132aa5c3bc9d5cf5ca0e6ebc
Component: engine
2017-09-27 17:42:23 +02:00
240408899b Merge pull request #34928 from darrenstahlmsft/HnsRunning
Ensure Host Network Service exists
Upstream-commit: 6af60b3c6180817e06ce87d562643b442a866502
Component: engine
2017-09-27 17:35:08 +02:00
4262667057 Merge pull request #34985 from thaJeztah/remove-use-of-deprecated-filter-functions
Remove use of deprecated filter functions
Upstream-commit: a343cba40c25deb2893e13f9a81dbcc4d19d16e2
Component: engine
2017-09-27 17:34:07 +02:00
7ed1303eb4 Merge pull request #34881 from ityangchen/test-moby
"docker swarm init --force-new-cluster" use limit
Upstream-commit: 0b968f91958eea12c2fa82cec64790cb03367232
Component: engine
2017-09-27 14:11:46 +02:00
82a0e7daf9 Increase Coverage of pkg/idtools
Signed-off-by: Danyal Khaliq <danyal.khaliq@tenpearls.com>
Upstream-commit: 00c0ee885c671942f9bc751c80cbc45b7f6404f3
Component: engine
2017-09-27 12:55:04 +05:00
689b8ff233 Merge pull request #562 from dnephin/update-gometalinter
Update gometalinter
Upstream-commit: feb4d79935
Component: cli
2017-09-27 09:42:37 +02:00
5a67fa7a37 Merge pull request #563 from riyazdf/remove-extra-options
trust: remove extraneous OPTIONS from commands that do not use it
Upstream-commit: e27e07a8a9
Component: cli
2017-09-27 09:41:33 +02:00
bb1eca37a9 trust: remove extraneous OPTIONS from commands that do not use it
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 9ad0e8f223
Component: cli
2017-09-26 16:15:45 -07:00
e4f32567d3 Updating moby to correspond to naming convention used in https://github.com/docker/swarmkit/pull/2385
Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
Upstream-commit: d00a07b1e6d46c3cc9ef95e8b6227115830e2701
Component: engine
2017-09-26 22:08:10 +00:00
fa385958f4 vndr swarmkit 941a01844b89c56aa61086fecb167ab3af1de22b
Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
Upstream-commit: 8e15b1cffb95d1e82943a628353c6df7cd54f6c4
Component: engine
2017-09-26 22:08:10 +00:00
23c421f3c5 Merge pull request #557 from allencloud/add-more-event-filter-type
Add more event filters in doc: config, node, secret and service
Upstream-commit: 62d62ff513
Component: cli
2017-09-26 22:48:22 +02:00
de74f6b50c Merge pull request #34952 from allencloud/add-specific-event-filter
add node/service/secret/config specific event filter
Upstream-commit: afe31900915782daf67b40d405d8e7b8e01ab2dd
Component: engine
2017-09-26 22:46:41 +02:00
f99bd6dc82 Merge component 'engine' from git@github.com:moby/moby master 2017-09-26 12:50:25 -07:00
dead314452 Refactor image commands to make use of the new trust struct for trusted pull
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 4203b49431
Component: cli
2017-09-26 15:15:42 -04:00
8a5301f81b Merge pull request #34911 from dnephin/new-ci-entrypoint
Add a new entrypoint for CI
Upstream-commit: a971f9c9d7d1bdc69b197a82c3fb010681f5cd1f
Component: engine
2017-09-26 11:50:44 -07:00
1a654751d3 Merge component 'cli' from git@github.com:docker/cli master 2017-09-26 10:56:04 -07:00
7fd47ecc0d Merge pull request #34961 from fcrisciani/libnetwork-vendoring
Vendoring libnetwork
Upstream-commit: 37eb796ccb6de7def92f0ab3f18c686ae92ef29f
Component: engine
2017-09-26 10:50:32 -07:00
09b100cab2 Merge pull request #34973 from darrenstahlmsft/fixError
Fix error string about containers feature
Upstream-commit: 9feef9287474d0e9afe489d9ad0b71a986a012cb
Component: engine
2017-09-26 18:44:12 +02:00
6424aeb9fa Merge pull request #34918 from thaJeztah/update-copy-add-error
Improve error message for COPY missing destination
Upstream-commit: 76b5ab6f43aeffe4261e2b1f848476d36d332880
Component: engine
2017-09-26 18:43:36 +02:00
57c6d20473 Merge pull request #34358 from ripcurld0/fix_link_problem
Add an integration test for bug #31392 regression
Upstream-commit: 584ed9603b4cb79160d0dd8689cdbbdedb9fe00f
Component: engine
2017-09-26 18:41:08 +02:00
f321e1ed9d Update gometalinter
The update includes bug fixes in gometalinter and updates to linters, which
discovered more linter problems.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: d956386b2d
Component: cli
2017-09-26 12:33:35 -04:00
2a54e5d16e add node/service/secret/config specific event filter
Signed-off-by: Allen Sun <shlallen1990@gmail.com>
Upstream-commit: 4611ecd3cdc9b2738f58a136b79f752add223f3f
Component: engine
2017-09-27 00:23:51 +08:00
e3c3856028 Merge pull request #34908 from thaJeztah/bump-api-version-1.33
Bump API version to 1.33
Upstream-commit: 74a084162ce544fe995715ba47aa84d3d75b95c1
Component: engine
2017-09-26 18:09:50 +02:00
86f10d67d5 add more event filters in doc: config, node, secret and service
Signed-off-by: Allen Sun <shlallen1990@gmail.com>
Upstream-commit: fc98f8757a
Component: cli
2017-09-27 00:04:56 +08:00
399de7ee20 Merge pull request #551 from dnephin/set-local-constant
Use a local constant
Upstream-commit: 0856c20e04
Component: cli
2017-09-26 17:42:50 +02:00
7125e1b239 Support parsing of named pipes for compose volumes.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 9f73b8c718
Component: cli
2017-09-26 11:24:23 -04:00
57dd97eab1 Merge pull request #555 from joaofnfernandes/docs/advertise-addr
Add note about joining through a load balancer
Upstream-commit: b77f3fd5ac
Component: cli
2017-09-26 17:15:42 +02:00
671d46ed3d Merge pull request #34983 from thaJeztah/suppress-tmp-rename-warning
Suppress warning for renaming missing tmp directory
Upstream-commit: 65234597216d03866bc26bdad06cb1f25f832206
Component: engine
2017-09-26 16:53:28 +02:00
9e59512fe4 Merge pull request #451 from tych0/use-pass-backend
Use pass backend
Upstream-commit: be8dab26a3
Component: cli
2017-09-26 16:40:32 +02:00
1fe51e0bb7 document the pass backend and default behavior
Also add a big warning about cleartext passwords.

Signed-off-by: Tycho Andersen <tycho@docker.com>
Upstream-commit: a2f116733b
Component: cli
2017-09-26 08:31:02 -06:00
5dbfedf3f9 Replace uses of filters.ToParam(), FromParam() with filters.ToJSON(), FromJSON()
`filters.ToParam()` and `filters.FromParam()` were deprecated in favor of
`filters.ToJSON()` and `filters.FromJSON()` in 065118390a3ecaf0dbd2fa752d54d43f8f1e8ec6,
but still used in various locations.

This patch replaces uses of `filters.ToParam()` and  `filters.FromParam()` with
`filters.ToJSON()` and `filters.FromJSON()`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: a4efe66cf2a7648dbcf5b9993bf351925b905b5b
Component: engine
2017-09-26 13:59:45 +02:00
c4c68bf819 Replace uses of filters.Include() with filters.Contains()
The `filters.Include()` method was deprecated in favor of `filters.Contains()`
in 065118390a3ecaf0dbd2fa752d54d43f8f1e8ec6, but still used in various
locations.

This patch replaces uses of `filters.Include()` with `filters.Contains()`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 97c5ae25c4d857563acd1f3467afc760145b1d55
Component: engine
2017-09-26 13:39:56 +02:00
b987e63572 Update runc to 0351df1c5a66838d0c392b4ac4cf9450de844e2d
This fix updates runc to 0351df1c5a66838d0c392b4ac4cf9450de844e2d

With this fix the warnings generated by netgo and dlopen by go 1.9
are addressed.

See
- opencontainers/runc#1577
- opencontainers/runc#1579

This fix is part of the efforts for go 1.9 (#33892)

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: e0ff1d147bc12234f1be25a620bf6b3bf3179d97
Component: engine
2017-09-26 11:07:27 +00:00
cbf8cc6faf Suppress warning for renaming missing tmp directory
When starting `dockerd` on a host that has no `/var/lib/docker/tmp` directory,
a warning was printed in the logs:

    $ dockerd --data-root=/no-such-directory
    ...
    WARN[2017-09-26T09:37:00.045153377Z] failed to rename /no-such-directory/tmp for background deletion: rename /no-such-directory/tmp /no-such-directory/tmp-old: no such file or directory. Deleting synchronously

Although harmless, the warning does not show any useful information, so can be
skipped.

This patch checks thetype of error, so that warning is not printed.
Other errors will still show up:

    $ touch /i-am-a-file
    $ dockerd --data-root=/i-am-a-file
    Unable to get the full path to root (/i-am-a-file): canonical path points to a file '/i-am-a-file'

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 2b50b14aebc12722f81db8d8f66415e1fa7b954a
Component: engine
2017-09-26 12:04:30 +02:00
b4098a4e18 Merge pull request #34968 from chris-crone/integration-test-docker-ee
Docker EE integration test fixes
Upstream-commit: 147443a42665419d8b3c2047a7d345440bfb63c0
Component: engine
2017-09-26 10:50:09 +02:00
48757849a4 Merge pull request #34946 from dnephin/fix-jsonlog
Move pkg/jsonlog to be a subpackage of the single consumer
Upstream-commit: 7d47823c22945bb24a609a7ef20c0559d78d96e4
Component: engine
2017-09-26 10:49:57 +02:00
ec4868350d Add an integration test for bug #31392 regression
This verifies that bug #31392 won't surface again.

To reproduce the bug:
1) docker run -dit --name a0 busybox sh
2) docker run -dit --name b0 --link a0 busybox sh
3) docker rename a0 a1
4) docker run -dit --name a0 busybox sh
5) docker rm -f b0
6) docker run -dit --name b0 --link a0 busybox sh

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: 48a26ba9e42f25ebc1ad732b4c0d31e77a7aaa55
Component: engine
2017-09-26 10:55:59 +03:00
fa79e0059e Merge pull request #34943 from tonistiigi/vendor-buildkit
vendor: update buildkit to aaff9d591
Upstream-commit: 4d48baacde3dd6bb9e4c4f8ef1319765ded031f4
Component: engine
2017-09-26 08:37:46 +02:00
3366e8951a Merge pull request #34965 from vdemeester/fix-pkg-mount-unit-test-under-selinux
Fix TestMount under a selinux system
Upstream-commit: 41313c87a25aec122fb43fdaf2433d1b121f1808
Component: engine
2017-09-26 08:37:22 +02:00
401172966f "docker swarm init --force-new-cluster" use limit
Signed-off-by: yangchenliang <yangchenliang@huawei.com>

When worker executor `docker swarm init
--force-new-cluster`,docker would hang.So only manager can process it.

Signed-off-by: yangchenliang <yangchenliang@huawei.com>
Upstream-commit: 12e947efdba5481020f6543514ade83d87c69a28
Component: engine
2017-09-26 12:05:19 +08:00
1608188995 Merge pull request #472 from riyazdf/docker-trust
docker trust: view, revoke, sign subcommands (experimental)
Upstream-commit: af3cdccf52
Component: cli
2017-09-25 17:26:52 -07:00
f367f50630 Move jsonlog to a subpackage of jsonfilelog
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 035604cca6d6bd9a432268caf7515a35023908ed
Component: engine
2017-09-25 16:07:25 -04:00
7d644fb209 Fix benchmarks and remove more unnecessary code.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: a06ad2792ab92d4f246e4b4cc4c3529eb060651e
Component: engine
2017-09-25 16:07:25 -04:00
4701b66889 Remove unused JSONLog marshaling
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 231c5cbd50e1870f31eb6a525b2df2ed7a716565
Component: engine
2017-09-25 16:07:25 -04:00
a001c9d5c7 Remove unused Format
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 638d4cc7e4390ab217be711913017b22ce2cd5c2
Component: engine
2017-09-25 16:07:25 -04:00
0c6f170345 Unexport FastTimeMarshalJSON
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 7de92de636ef307d66b7b20b24f166a47f40f72b
Component: engine
2017-09-25 16:07:25 -04:00
101f740d40 Move RFC3339NanoFixed to a more appropriate package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 27cfa68af16721c978803c3b695bcc7181ccc721
Component: engine
2017-09-25 16:07:24 -04:00
658351133f Fix error string about containers feature
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: 31405b556f155d8f56902086c7c24efe25dd8de0
Component: engine
2017-09-25 12:39:27 -07:00
3c4574bac3 Ensure Host Network Service exists
If HNS does not exist on the Docker host, the daemon may fail with unexpected
and difficult to diagnose errors. This check prevents the daemon from starting
on a system that does not have the correct prerequisites.

Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: 1edcc63560cb1286f452565754092bc2eb428ffa
Component: engine
2017-09-25 11:07:44 -07:00
025e41d2ae Add note about joining through a load balancer
Signed-off-by: Joao Fernandes <joao.fernandes@docker.com>
Upstream-commit: 8595d15d60
Component: cli
2017-09-25 10:53:20 -07:00
702bac1553 mark command as experimental in docs and cli
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: e07f345267
Component: cli
2017-09-25 09:39:46 -07:00
e0bca90fda trust: rename inspect to view, add repo name to signer table header
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: c6db0cd7a1
Component: cli
2017-09-25 09:39:46 -07:00
94f2b59302 tests: use alice/bob/claire conventional names for signers
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 46a879e3b9
Component: cli
2017-09-25 09:39:46 -07:00
188ec7af2a trust: update remove to error on empty references for consistency
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 4e95fcd72c
Component: cli
2017-09-25 09:39:46 -07:00
a59fc63f3b tests: move trust test to proper package
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 67cf09cbe1
Component: cli
2017-09-25 09:39:46 -07:00
7c83ece8ef trust: update reference type and use golden output
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 4e89dc800a
Component: cli
2017-09-25 09:39:44 -07:00
1659928f34 tests: address review feedback
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 6fca400f1e
Component: cli
2017-09-25 09:38:41 -07:00
51f87f33d4 trust: use mock CLI for testing offline
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: f667bd7559
Component: cli
2017-09-25 09:38:40 -07:00
93ba24cc42 cli: introduce NotaryClient getter
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: e5c35ab9d1
Component: cli
2017-09-25 09:38:38 -07:00
b53048a314 trust: add Repository client interface
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 7c5b836ca5
Component: cli
2017-09-25 09:34:54 -07:00
e42a2df102 trust: address review feedback, refactor to align with existing cli/command semantics
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 45c102a03d
Component: cli
2017-09-25 09:34:53 -07:00
e92c4686dd docs: update docker trust docs with correct tense and formatting
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 007aff70bf
Component: cli
2017-09-25 09:34:53 -07:00
97f2ec42fa trust revoke: docs for docker trust revoke
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 43717a866e
Component: cli
2017-09-25 09:34:53 -07:00
e8d4ecb361 trust revoke: add docker trust revoke command
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 609f8b4b81
Component: cli
2017-09-25 09:34:53 -07:00
ad5c7cb4bb trust sign: docs for docker trust sign
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: bc665ed762
Component: cli
2017-09-25 09:34:53 -07:00
644ae3a3f1 trust sign: add docker trust sign command
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: fab6bb6798
Component: cli
2017-09-25 09:34:53 -07:00
1115dc5cef trust inspect: docs for docker trust inspect
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 809ef0fd74
Component: cli
2017-09-25 09:34:53 -07:00
530ee183f1 trust inspect: add docker trust inspect command with formatting print
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: ec6bc9460f
Component: cli
2017-09-25 09:34:52 -07:00
742798f154 trust: update existing code for new vendoring, refactor for docker trust code sharing
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 5846e6e5d5
Component: cli
2017-09-25 09:34:52 -07:00
86beae9d05 vendor: upgrade notary version for docker trust
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: fb1cbaeb66
Component: cli
2017-09-25 09:34:52 -07:00
0975184f91 Docker EE integration test fixes
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: 8c5f98c93e06de81b7fb6416372a3f42aa7aeb5d
Component: engine
2017-09-25 18:09:19 +02:00
0c54b3a041 Improve error message for COPY missing destination
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 5d05a8291314b8f727b04b504b8d7fc7ed7f42da
Component: engine
2017-09-25 14:17:18 +02:00
522e6cc8ec Do not use deprecated call for APIClient
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: 82440a039f58b6a1487f8042486fe8dba675df54
Component: engine
2017-09-25 14:08:03 +02:00
0b2721b9c1 Protect environment for system integration tests
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: d43dac2202667a407f4c5ab061c04b0ea334aa20
Component: engine
2017-09-25 14:05:18 +02:00
e38ecccceb Match not implemented error check to others
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: 7406088853b6cbcb8996c367062cee2e1ee6eaaa
Component: engine
2017-09-25 13:58:51 +02:00
954a7de027 Dockerfile: use seccomp provided by stretch
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: 1b51a05375b48c5f655fbbedc5a1e7cba044122c
Component: engine
2017-09-25 10:03:37 +00:00
08619d0c7c Fix TestMount under a selinux system
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 8bebd42df2d8eaa0ecdc9c78bc1e395a752eb5c9
Component: engine
2017-09-25 11:54:30 +02:00
5c2be22475 Merge pull request #307 from allencloud/sort-secrets-and-configs-in-cli
using nature sort secrets and configs in cli
Upstream-commit: bd6e1757f5
Component: cli
2017-09-25 09:41:50 +02:00
fdeab20153 sort secrets and configs in cli
Signed-off-by: Allen Sun <shlallen1990@gmail.com>
Upstream-commit: 26f06c5bcb
Component: cli
2017-09-25 13:18:13 +08:00
28762b7242 Vendoring libnetwork
Fix for networkDB garbage collection (PR: https://github.com/docker/libnetwork/pull/1944)
Added extra logs to monitor the netowrkDB status and number of entries per network

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
Upstream-commit: 04043428ea5ce679618aec2007b77ac51d0b6af0
Component: engine
2017-09-24 16:44:16 -07:00
0f097012c8 Merge pull request #546 from dnephin/fix-version-on-failure
Set APIVersion on the client, even when Ping fails
Upstream-commit: a41caadef0
Component: cli
2017-09-23 09:04:03 -04:00
753a551b2e Merge pull request #552 from allencloud/volume-has-no-id
remove volume id because it only has name
Upstream-commit: 29c4f0df57
Component: cli
2017-09-23 08:58:37 -04:00
a0ff43ff51 remove volume id because it only has name
Signed-off-by: Allen Sun <shlallen1990@gmail.com>
Upstream-commit: fe1c1b6b5c
Component: cli
2017-09-23 11:26:56 +08:00
f3a4b20d25 Use a local constant
This constant is going to be removed from jsonlog package.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 32612058cb
Component: cli
2017-09-22 17:59:46 -04:00
278bf3cb85 Merge pull request #34929 from stevvooe/remove-promise-package
pkg/package: remove promise package
Upstream-commit: c982ee805d895a4fc2bf01f2d1d8afa06b408dd0
Component: engine
2017-09-22 11:52:23 -07:00
afac6be123 builder: updates to session after vendor
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: d4729749023fde0c57cded0c8159dc85cd7ee448
Component: engine
2017-09-22 09:51:52 -07:00
441f6cef6d Set APIVersion on the client, even when Ping fails
Refactor to support testing
Also add tests

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: e828efa4ab
Component: cli
2017-09-22 10:08:19 -04:00
120931ebc2 small reference change
Signed-off-by: Marc Bihlmaier <marc.bihlmaier@reddoxx.com>
Upstream-commit: 9490189cba
Component: cli
2017-09-22 10:49:30 +02:00
6771dc87e0 Merge pull request #34878 from chchliang/imagebranch
Add  testcases with ` Image` , covering all methods.
Upstream-commit: ba317637de9b9918cdc2139466dd51c6200bd158
Component: engine
2017-09-22 10:08:54 +02:00
793cd3af24 Merge pull request #30696 from yummypeng/lock-RWLayer-while-committing
Fixes #29654: take reference to RWLayer while committing/exporting
Upstream-commit: a157dc53a850dff19ead074f24f9eff61b9d0622
Component: engine
2017-09-22 09:41:57 +02:00
2d68241660 vendor: update buildkit
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: ed6fd3d95bde4651ffb66d37cd1e5e76ee3c1f7b
Component: engine
2017-09-21 22:17:43 -07:00
d1d8439f3f Fixes #29654: take reference to RWLayer while committing/exporting
Take an extra reference to rwlayer while the container is being
committed or exported to avoid the removal of that layer.

Also add some checks before commit/export.

Signed-off-by: Yuanhong Peng <pengyuanhong@huawei.com>
Upstream-commit: 8c32659979150630a2c4eae4e7da944806c46297
Component: engine
2017-09-22 09:47:42 +08:00
efc44f60de Fallback to use naive diff driver if enable CONFIG_OVERLAY_FS_REDIRECT_DIR
When use overlay2 as the graphdriver and the kernel enable
`CONFIG_OVERLAY_FS_REDIRECT_DIR=y`, rename a dir in lower layer
will has a xattr to redirct its dir to source dir. This make the
image layer unportable. This patch fallback to use naive diff driver
when kernel enable CONFIG_OVERLAY_FS_REDIRECT_DIR

Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 49c3a7c4bac2877265ef8c4eaf210159560f08b4
Component: engine
2017-09-22 09:40:18 +08:00
6700f361c5 pkg/package: remove promise package
The promise package represents a simple enough concurrency pattern that
replicating it in place is sufficient. To end the propagation of this
package, it has been removed and the uses have been inlined.

While this code could likely be refactored to be simpler without the
package, the changes have been minimized to reduce the possibility of
defects. Someone else may want to do further refactoring to remove
closures and reduce the number of goroutines in use.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 0cd4ab3f9a3f242468484fc62b46e632fdba5e13
Component: engine
2017-09-21 17:56:45 -07:00
3a50fe644a Merge pull request #34861 from tklauser/fix-cstring-leaks
Fix CString memory leaks
Upstream-commit: 777d4a1bf45c85db6931205d4adbe38a17c583d7
Component: engine
2017-09-21 09:14:07 -07:00
e22297f2e2 Merge pull request #34907 from chris-crone/set-test-ostype
Set integration test OSType with environment variable
Upstream-commit: 409d4711812c5c23815a783524e543ec653a234b
Component: engine
2017-09-21 04:13:17 -07:00
9f6a445ef2 Merge pull request #34910 from chris-crone/plugin-list-not-implemented
Handle plugin list not implemented
Upstream-commit: 7d8deaa0db40b8b88d8e5039d23d4fcdb627fc00
Component: engine
2017-09-21 04:12:35 -07:00
aebe8e8ce7 add Images testcase
Signed-off-by: chchliang <chen.chuanliang@zte.com.cn>
Upstream-commit: 832f39c2ed53fc4a91265798198273044448bc7f
Component: engine
2017-09-21 17:54:29 +08:00
0dfdf37ab2 Merge pull request #34914 from euank/000003-percent
overlay2: fix faulty errcheck
Upstream-commit: 48cce229330561c104f777dac4f3f39ef2e2de6e
Component: engine
2017-09-20 19:52:10 -07:00
ccdce91e65 overlay2: fix faulty errcheck
The change in 7a7357dae1bcccb17e9b2d4c7c8f5c025fce56ca inadvertently
changed the `defer` error code into a no-op. This restores its behavior
prior to that code change, and also introduces a little more error
logging.

Signed-off-by: Euan Kemp <euan.kemp@coreos.com>
Upstream-commit: 639ab92f011245e17e9a293455a8dae1eb034022
Component: engine
2017-09-20 15:25:57 -07:00
e55d5634bf Add a new entrypoint for CI
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: dbf580be57a4bb854d7ce20d313e3a22ea337be5
Component: engine
2017-09-20 17:26:30 -04:00
028b015443 Merge pull request #250 from seemethere/update_moby_components_hash
Hash needs to be updated for moby-components script
2017-09-20 13:40:13 -07:00
1e4bfaa04a Hash needs to be updated for moby-components script
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2017-09-20 13:25:51 -07:00
5cb2c664ef Merge pull request #34886 from cpuguy83/may_detach_mount
Automatically set `may_detach_mounts=1` on startup
Upstream-commit: 7d70d0fac339b2ed9715739748c89d0486456407
Component: engine
2017-09-20 11:31:45 -07:00
da0223d365 Set integration test OSType with environment variable
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: f0e5b3d7d89c0c87d001faa18bc60fd1b4531901
Component: engine
2017-09-20 19:50:17 +02:00
20c1a2b928 Handle plugin list not implemented
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: e7e11bdd44878d28c642d72761aa41eb9ffce3d1
Component: engine
2017-09-20 19:48:33 +02:00
9337e13113 prefer pass backend if it is available
Signed-off-by: Tycho Andersen <tycho@docker.com>
Upstream-commit: 713e87e780
Component: cli
2017-09-20 11:15:49 -06:00
6280c12bb9 version bump for docker-credential-helpers
Signed-off-by: Tycho Andersen <tycho@docker.com>
Upstream-commit: 6bd5c63c78
Component: cli
2017-09-20 11:15:49 -06:00
315e815656 defaultCredentialStore: make this a function
In the next patch, we'll use this to implement some logic about which
password backend to use.

Signed-off-by: Tycho Andersen <tycho@docker.com>
Upstream-commit: 4cf1849418
Component: cli
2017-09-20 11:14:27 -06:00
7e0e805bca Merge pull request #34863 from keloyang/close-pipe
Close pipe in overlay2 graphdriver
Upstream-commit: e40d5e665c6de904ea1e22bb3aa615638ec05e2a
Component: engine
2017-09-20 09:37:15 -07:00
cdbfcd2c1d Merge pull request #545 from thaJeztah/fix-nocopy-description
Fix nocopy description
Upstream-commit: 10e292dbab
Component: cli
2017-09-20 17:54:55 +02:00
36e37bb56e Merge pull request #544 from vdemeester/fix-build-loading
Fix loader error with different build syntax
Upstream-commit: 09c8f47af1
Component: cli
2017-09-20 11:03:54 -04:00
62cdceef74 Fix nocopy description
nocopy does not apply to bind mounts, only volumes

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 0e72a6ff81
Component: cli
2017-09-20 16:43:15 +02:00
de0f898e39 Automatically set may_detach_mounts=1 on startup
This is kernel config available in RHEL7.4 based kernels that enables
mountpoint removal where the mountpoint exists in other namespaces.
In particular this is important for making this pattern work:

```
umount -l /some/path
rm -r /some/path
```

Where `/some/path` exists in another mount namespace.
Setting this value will prevent `device or resource busy` errors when
attempting to the removal of `/some/path` in the example.

This setting is the default, and non-configurable, on upstream kernels
since 3.15.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 83c2152de503012195bd26069fd8fbd2dea4b32f
Component: engine
2017-09-20 09:57:25 -04:00
e2fa4c4d55 Bump API version to 1.33
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 15a59e763b6bdb44f28ffafb20e173606308ce2c
Component: engine
2017-09-20 15:19:16 +02:00
7d19908a7b Merge pull request #504 from albers/completion-search--format
Add bash completion for `search --format`
Upstream-commit: da82dcb1db
Component: cli
2017-09-20 14:41:28 +02:00
95b34532ce Fix loader error with different build syntax
`build: .` was not working anymore. Fixing this by adding a new
tranform function for BuildConfig.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 0da9f14821
Component: cli
2017-09-20 14:02:33 +02:00
c59fc2b89e Merge pull request #352 from albers/fix-completion--credential-spec
Improve bash completion for `--credential-spec`
Upstream-commit: 16804b7313
Component: cli
2017-09-20 11:52:11 +02:00
48266cefa7 Merge pull request #531 from seemethere/add_cross_targets
Add a way to just build windows and osx
Upstream-commit: bd31cb4bd5
Component: cli
2017-09-20 08:52:56 +02:00
0ee27e86a8 Add a way to just build windows and osx
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 51080d6148
Component: cli
2017-09-19 16:48:31 -07:00
bb1c0c5aa8 Merge pull request #34846 from Microsoft/jjh/debuggcs
LCOW: Add UVM debugability by grabbing logs before tear-down
Upstream-commit: 7cbbbb95097f065757d38bcccdb1bbef81d10ddb
Component: engine
2017-09-19 22:33:46 +02:00
d9942eee10 Merge pull request #34117 from cpuguy83/decouple_plugin_manager_from_executor
Decouple plugin manager from libcontainerd package
Upstream-commit: b6b85da6576b3e923325897aab9b12d85c014e1b
Component: engine
2017-09-19 21:07:57 +02:00
5338e5013a Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2017-09-19 11:14:46 -07:00
46ea757ea5 Merge component 'engine' from git@github.com:moby/moby master 2017-09-19 11:14:35 -07:00
95004c9da9 Merge pull request #31993 from dccurtis/issue-31816
Fixing ‘docker cp’ to allow new target file name in a host symlinked directory
Upstream-commit: 149f3aceb277ecccd33ee815e9c54d6aec782ab5
Component: engine
2017-09-19 10:54:53 -07:00
d382cdf023 Merge pull request #33492 from simonferquel/typed-builder-commands-squashed
[Builder] Introduce a typed command system and 2 phase parse/dispatch build
Upstream-commit: 22e15721b1f33f32f07615e034cf3a7b4c865aa3
Component: engine
2017-09-20 02:52:23 +09:00
6a9321461a Merge pull request #34684 from cpuguy83/fix_selinux_with_mount_api
Set selinux label on local volumes from mounts API
Upstream-commit: 3ddced570dbd7c07291df15bf0b5ac02b04453ca
Component: engine
2017-09-19 13:43:40 -04:00
a5ceeb03a8 Merge component 'cli' from git@github.com:docker/cli master 2017-09-19 10:12:43 -07:00
ddb0ee3757 Revendor Microsoft/opengcs @ v0.3.4
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 2798576b37aa99643a06366f00072b6026c0b77e
Component: engine
2017-09-19 09:56:23 -07:00
cb0c1a12c4 Decouple plugin manager from libcontainerd package
libcontainerd has a bunch of platform dependent code and huge interfaces
that are a pain implement.
To make the plugin manager a bit easier to work with, extract the plugin
executor into an interface and move the containerd implementation to a
separate package.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: c85e8622a4813d7b72d74517faa03ab5de4c4550
Component: engine
2017-09-19 12:17:55 -04:00
84b2d8c7a7 Merge pull request #34732 from vizv/fix-relabel-config-files
daemon: relabel config files.
Upstream-commit: 1bb55e6495cea72d6bca17d90ab25573766d07b3
Component: engine
2017-09-19 08:46:54 -07:00
1411476434 Merge pull request #542 from vdemeester/tidying-loader-test-a-bit
Tidying up compose/loader test a bit
Upstream-commit: 9e162fb011
Component: cli
2017-09-19 17:44:08 +02:00
00de807109 Merge pull request #541 from thaJeztah/fix-service-create-markdown
Fix service_create markdown
Upstream-commit: 68935944b3
Component: cli
2017-09-19 17:17:45 +02:00
13c06c5996 Tidying up compose/loader test a bit
- Use `require` instead of `assert` when the assumption is "breaking" for the code
following. For example when asserting an error is not nil and then doing
`err.Error` on it ; if `err` is nil, the test will panic instead of fail.
- Use `assert.Len` when possible. The error message is better.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: f34655ecf8
Component: cli
2017-09-19 16:48:52 +02:00
f7daf26c0f Set selinux label on local volumes from mounts API
When using a volume via the `Binds` API, a shared selinux label is
automatically set.
The `Mounts` API is not setting this, which makes volumes specified via
the mounts API useless when selinux is enabled.

This fix adopts the same selinux label for volumes on the mounts API as on
binds.
Note in the case of both the `Binds` API and the `Mounts` API, the
selinux label is only applied when the volume driver is the `local`
driver.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 5bbf5cc671ec8007bf8e0416799fff01d6a79b7e
Component: engine
2017-09-19 10:46:38 -04:00
8828a6255a Merge pull request #537 from vdemeester/add-jenkins-status-to-readme
Add jenkins build status to readme
Upstream-commit: b3aa1195d4
Component: cli
2017-09-19 16:33:33 +02:00
6daf6c2b58 Fix service_create markdown
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 01ef9acd31
Component: cli
2017-09-19 16:29:52 +02:00
da00b40eb4 Merge pull request #34721 from kinvolk/iaguis/add-missing-ecryptfs-string
Add missing eCryptfs translation to FsNames
Upstream-commit: 3fa72d38ec61377b506d31711f5cf1b855219926
Component: engine
2017-09-19 05:45:24 -07:00
07893693ca Merge pull request #34891 from Microsoft/jjh/fixcomment
LCOW: Fix comment in graphdriver code
Upstream-commit: 13e8a7a0067ce5d8d458b3a5985691bed0b0f30e
Component: engine
2017-09-19 14:43:35 +02:00
889843574b volume: evaluate symlinks before relabeling mount source
Simple reproducer:

```sh
$ mkdir /var/foo
$ touch /var/foo/test
$ ln -s /var/foo /var/bar
$ docker run -ti -v /var/bar:/var/bar:Z fedora sh
sh-4.3# ls -lZ /var/bar/
ls: cannot open directory '/var/bar/': Permission denied
```

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: e0b22c0b9e013527ef121250b51ae780d2d2912d
Component: engine
2017-09-19 10:54:03 +02:00
822098983e Merge pull request #34520 from fnoeding/fixed-raw-splunk-logger
Fixed `raw` mode splunk logger
Upstream-commit: 5c57ca17d50c392b7ad627fc1215d7a7e91e0c41
Component: engine
2017-09-19 10:53:01 +02:00
1cc4bb63c2 Merge pull request #34856 from dnephin/cleanup-version-tests
Replace old version tests
Upstream-commit: 7cd7cf9167fd4bc57889dfe01447f4bb0d52acc2
Component: engine
2017-09-19 10:34:50 +02:00
1cc36398f9 Merge pull request #34495 from ripcurld0/registry_mirror_json
Exit if service config is loaded unsuccessfully on startup
Upstream-commit: b075cd2d78c1bafcded7d12ddb2e7c215e2e5117
Component: engine
2017-09-18 21:59:14 -07:00
a17ffddbf6 Merge pull request #34550 from kolyshkin/libeudev
Update Dockerfiles to use Debian Stretch
Upstream-commit: cfdac1245a8d97ef21fb739ef3e631bdb852bbc7
Component: engine
2017-09-18 21:03:31 -07:00
f8cc2fb021 LCOW: Fix comment in graphdriver code
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: f9fc269c204b96b34a479f3e55e41886ed2626b0
Component: engine
2017-09-18 19:52:55 -07:00
b07dcb72fb Close pipe if mountFrom failed.
Signed-off-by: Shukui Yang <yangshukui@huawei.com>
Upstream-commit: 9f38923901352459bb621d0b3587a6517e67eeb3
Component: engine
2017-09-19 01:25:39 +00:00
7ac80a2691 Merge pull request #34674 from pradipd/windows_routingmesh
Enabling ILB/ELB on windows using per-node, per-network LB endpoint.
Upstream-commit: a2ee40b98c281139c75b38e0e11aa35726021169
Component: engine
2017-09-18 15:56:17 -07:00
3303de2b82 Merge pull request #34759 from kolyshkin/gometalinter
Gometalinter fixups for non-x86
Upstream-commit: 65e88d996ad13ad5ca9c2d2c625a87f9271d1e82
Component: engine
2017-09-18 13:44:15 -07:00
b8677707a9 vendoring libnetwork and swarmkit
Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
Upstream-commit: 4c1b07924a7449e6e37fac4479624fcaf01ce889
Component: engine
2017-09-18 20:38:18 +00:00
61af2a7b87 Enabling ILB/ELB on windows using per-node, per-network LB endpoint.
Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
Upstream-commit: 9bed0883e762181ad6c4d5607ae2228e164e44b5
Component: engine
2017-09-18 20:27:56 +00:00
fab90b5b50 Merge pull request #524 from thaJeztah/update-deprecated-api-cors
Update deprecated.md for "api-enable-cors"
Upstream-commit: 139fcd3ee9
Component: cli
2017-09-18 21:37:08 +02:00
f01963dfea Merge pull request #34805 from chris-crone/containerize-integration-tests
Containerize integration tests
Upstream-commit: 9be245f438f9fb2eaeb7891673b16aed9262a192
Component: engine
2017-09-18 21:11:06 +02:00
dd976e6170 integration-cli/docker_cli_logs_test.go: Wait()
To avoid a zombie apocalypse, use cmd.Wait() to properly finish
the processes we spawn by Start().

Found while investigating DockerSuite.TestLogsFollowSlowStdoutConsumer
failure on ARM (see
https://github.com/moby/moby/pull/34550#issuecomment-324937936).

[v2: don't expect no error from Wait() when process is killed]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 14f0a1888f92667f82bea548bfa2fe4a890a75e8
Component: engine
2017-09-18 11:18:36 -07:00
0a503dae01 Merge pull request #366 from twistlock/plugable_secrets_backend
Plugable secrets backend
Upstream-commit: 3edf97e5a9
Component: cli
2017-09-18 19:25:15 +02:00
50bc0b5a39 Merge pull request #523 from thaJeztah/more-yaml-information
Add more information to the generated YAML for documentation
Upstream-commit: 37ac97c72e
Component: cli
2017-09-18 13:12:39 -04:00
9f902b9066 Merge pull request #526 from thaJeztah/docs-fix-system-prune
Update system prune docs for --volumes flag
Upstream-commit: d4251b4268
Component: cli
2017-09-18 19:10:46 +02:00
5421741502 Add missing eCryptfs translation to FsNames
It was causing the error message to be

    'overlay' is not supported over <unknown>

instead of

    'overlay' is not supported over ecryptfs

Signed-off-by: Iago López Galeiras <iago@kinvolk.io>
Upstream-commit: ddb31b4fdf7311ad6c7e62aa15b5f6da16518e77
Component: engine
2017-09-18 19:06:13 +02:00
133eff770e TestLogsFollowSlowStdoutConsumer: fix for slow ARM
We run our CI on Scaleway C1 machine, which is pretty slow,
including I/O. This test was failing on it, as it tried to
write 100000 lines of log very fast, and the loggerCloseTimeout
(defined and used in container/monitor.go) prevents the
daemon to finish writing it within this time frame,

Reducing the size to 150000 characters (75000 lines) should
help avoiding hitting it, without compromising the test case
itself.

Alternatively, we could have increased the timeout further. It was
originally set to 1s (commit b6a42673a) and later increased 10x
(commit c0391bf55). Please let me know if you want me to go that way.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 1bc93bff221bd30e80f776cc620a8937314569ef
Component: engine
2017-09-18 08:47:55 -07:00
e01e198f54 Introduce a typed command system and 2 phase parse/dispatch build
This is a work base to introduce more features like build time
dockerfile optimisations, dependency analysis and parallel build, as
well as a first step to go from a dispatch-inline process to a
frontend+backend process.

Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
Upstream-commit: 669c0677980b04bcbf871bb7c2d9f07caccfd42b
Component: engine
2017-09-18 09:48:56 +02:00
3a4f4fd3c4 overlay gd: fix build for 32-bit ARM
This commit reverts a hunk of commit 2f5f0af3f ("Add unconvert linter")
and adds a hint for unconvert linter to ignore excessive conversion as
it is required on 32-bit platforms (e.g. armhf).

The exact error on armhf is this:

	19:06:45 ---> Making bundle: dynbinary (in bundles/17.06.0-dev/dynbinary)
	19:06:48 Building: bundles/17.06.0-dev/dynbinary-daemon/dockerd-17.06.0-dev
	19:10:58 # github.com/docker/docker/daemon/graphdriver/overlay
	19:10:58 daemon/graphdriver/overlay/copy.go:161: cannot use stat.Atim.Sec (type int32) as type int64 in argument to time.Unix
	19:10:58 daemon/graphdriver/overlay/copy.go:161: cannot use stat.Atim.Nsec (type int32) as type int64 in argument to time.Unix
	19:10:58 daemon/graphdriver/overlay/copy.go:162: cannot use stat.Mtim.Sec (type int32) as type int64 in argument to time.Unix
	19:10:58 daemon/graphdriver/overlay/copy.go:162: cannot use stat.Mtim.Nsec (type int32) as type int64 in argument to time.Unix

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: b569f57890d4cad132be437e5dac55130b6c76e9
Component: engine
2017-09-17 22:04:31 -07:00
dd4630ca9c Fix test-docker-py on some arches
When running 'make all' on armhf, I got this:

> ---> Making bundle: .integration-daemon-start (in bundles/17.06.0-dev/test-docker-py)
> Using test binary docker
> INFO: Waiting for daemon to start...
> Starting dockerd
> .
> Traceback (most recent call last):
>   File "/usr/local/lib/python2.7/dist-packages/_pytest/config.py", line
> 320, in _importconftest
>     mod = conftestpath.pyimport()
>   File "/usr/local/lib/python2.7/dist-packages/py/_path/local.py", line
> 662, in pyimport
>     __import__(modname)
>   File "/docker-py/tests/integration/conftest.py", line 6, in <module>
>     import docker.errors
>   File "/docker-py/docker/__init__.py", line 2, in <module>
>     from .api import APIClient
>   File "/docker-py/docker/api/__init__.py", line 2, in <module>
>     from .client import APIClient
>   File "/docker-py/docker/api/client.py", line 11, in <module>
>     from .build import BuildApiMixin
>   File "/docker-py/docker/api/build.py", line 6, in <module>
>     from .. import auth
>   File "/docker-py/docker/auth.py", line 6, in <module>
>     import dockerpycreds
> ImportError: No module named dockerpycreds
> ERROR: could not load /docker-py/tests/integration/conftest.py

The fix for this was already provided by commit 0ec8f56a3 and
commit c7c923594, but for some reason it did not made its way
to Dockerfiles for all architectures.

While at it, remove excessive comments.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 7439d360fd567e063b8e9c4174a5c21b9fbc06aa
Component: engine
2017-09-17 22:04:31 -07:00
a14ef1d5fc devmapper: tell why xfs is not supported
Instead of providing a generic message listing all possible reasons
why xfs is not available on the system, let's be specific.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: c21245c9200ab39a9219b28f8185573b78a55074
Component: engine
2017-09-17 22:04:31 -07:00
e3dc487328 devmapper: show dmesg if mount fails
If mount fails, the reason might be right there in the kernel log ring buffer.
Let's include it in the error message, it might be of great help.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 46833ee1c353c247e3ef817a08d5a35a2a43bdf3
Component: engine
2017-09-17 22:04:31 -07:00
a4c2f1d0c4 devmapper: don't create too new xfs
Since the update to Debian Stretch, devmapper unit test fails. One
reason is, the combination of somewhat old (less than 3.16) kernel and
relatively new xfsprogs leads to creating a filesystem which is not supported
by the kernel:

> [12206.467518] XFS (dm-1): Superblock has unknown read-only compatible features (0x1) enabled.
> [12206.472046] XFS (dm-1): Attempted to mount read-only compatible filesystem read-write.
> Filesystem can only be safely mounted read only.
> [12206.472079] XFS (dm-1): SB validate failed with error 22.

Ideally, that would be automatically and implicitly handled by xfsprogs.
In real life, we have to take care about it here. Sigh.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 6b01bc5adb1255cb48e22e755ab86fd2c3305211
Component: engine
2017-09-17 22:04:31 -07:00
c25f7e149b Dockerfiles: fix test-docker-py
Presumably after switch to debian-stretch as a base, the following
errors happens in Jenkins:

10:48:03 ---> Making bundle: test-docker-py (in
bundles/17.06.0-dev/test-docker-py)
10:48:03 ---> Making bundle: .integration-daemon-start (in
bundles/17.06.0-dev/test-docker-py)
10:48:03 Using test binary docker
10:48:03 # DOCKER_EXPERIMENTAL is set: starting daemon with experimental
features enabled!
10:48:03 /etc/init.d/apparmor: 130: /etc/init.d/apparmor:
systemd-detect-virt: not found
10:48:03 Starting AppArmor profiles:Warning from stdin (line 1):
/sbin/apparmor_parser: cannot use or update cache, disable, or
force-complain via stdin
10:48:03 Warning failed to create cache: (null)
10:48:03 .
10:48:03 INFO: Waiting for daemon to start...
10:48:03 Starting dockerd
10:48:05 .
10:48:06 Traceback (most recent call last):
10:48:06   File
"/usr/local/lib/python2.7/dist-packages/_pytest/config.py", line 320, in
_importconftest
10:48:06     mod = conftestpath.pyimport()
10:48:06   File
"/usr/local/lib/python2.7/dist-packages/py/_path/local.py", line 662, in
pyimport
10:48:06     __import__(modname)
10:48:06   File "/docker-py/tests/integration/conftest.py", line 6, in
<module>
10:48:06     import docker.errors
10:48:06   File "/docker-py/docker/__init__.py", line 2, in <module>
10:48:06     from .api import APIClient
10:48:06   File "/docker-py/docker/api/__init__.py", line 2, in <module>
10:48:06     from .client import APIClient
10:48:06   File "/docker-py/docker/api/client.py", line 6, in <module>
10:48:06     import requests
10:48:06 ImportError: No module named requests
10:48:06 ERROR: could not load /docker-py/tests/integration/conftest.py
10:48:06

and

00:38:55   File "/docker-py/docker/transport/ssladapter.py", line 21, in
<module>
00:38:55     from backports.ssl_match_hostname import match_hostname
00:38:55 ImportError: No module named backports.ssl_match_hostname
00:38:55 ERROR: could not load /docker-py/tests/integration/conftest.py

To fix, install the missing python modules.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: ce2a0120c1925492a9bb7f6339cdbf716a4c50e0
Component: engine
2017-09-17 22:04:31 -07:00
c53f4217c9 TestRunSeccompProfileAllow32Bit: fix
Since the update to Debian Stretch, this test fails. The reason is dynamic
binary, which requires i386 ld.so for loading (and apparently it is no longer
installed by default):

> root@09d4b173c3dc:/go/src/github.com/docker/docker# file exit32-test
> exit32-test: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, BuildID[sha1]=a0d3d6cb59788453b983f65f8dc6ac52920147b6, stripped
> root@09d4b173c3dc:/go/src/github.com/docker/docker# ls -l /lib/ld-linux.so.2
> ls: cannot access '/lib/ld-linux.so.2': No such file or directory

To fix, just add -static.

Interestingly, ldd can'f figure it out.

> root@a324f8edfcaa:/go/src/github.com/docker/docker# ldd exit32-test
>	not a dynamic executable

Other tools (e.g. objdump) also show it's a dynamic binary.

While at it, remove the extra "id" argument (a copy-paste error I
guess).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 771256b305c8c06fca5eb1d041b60fbe093c0e1b
Component: engine
2017-09-17 22:04:31 -07:00
322ee8f812 devmapper gd: disable for static build
Static build with devmapper is impossible now since libudev is required
and no static version of libudev is available (as static libraries are
not supported by systemd which udev is part of).

This should not hurt anyone as "[t]he primary user of static builds
is the Editions, and docker in docker via the containers, and none
of those use device mapper".

Also, since the need for static libdevmapper is gone, there is no need
to self-compile libdevmapper -- let's use the one from Debian Stretch.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 84f1c054e66d3999aaf2751062cda8a77925b7ae
Component: engine
2017-09-17 22:04:31 -07:00
8fb9073dbb Update Dockerfiles to use Debian stretch
The main gain here is that they all use exactly the same distro; previously
arm64 was using Ubuntu Xenial because Debian jessie was too old.

Does not seem that we can change any of the downloaded dependencies still,
as eg libseccomp is still not the version we are using.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: e89a5e5e91476102a471797fc2a81aa2f0f2b3fb
Component: engine
2017-09-17 22:02:13 -07:00
5681a2921d Exit if service config is loaded unsuccessfully on startup
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: 5258297dac1e32c8dd1caff528d321ac7eb4a87c
Component: engine
2017-09-17 18:50:16 +03:00
af2e8abbf0 Merge pull request #34842 from dnephin/fix-integration-on-timeout
[integration-cli] Only attempt to find pid with local daemon
Upstream-commit: c5c0702a4d523071b3e41a13c233b6ec9e261b06
Component: engine
2017-09-16 06:48:18 -07:00
347269ee44 Merge pull request #52 from thaJeztah/switch-to-arm64v8
Switch aarch64 images to arm64v8
Upstream-commit: a1debdbcf0220c10799fce225f2f189e681de385
Component: packaging
2017-09-15 18:54:10 -07:00
19d23646ea Merge pull request #51 from thaJeztah/switch-to-arm32v7
Switch armhf images to arm32v7
Upstream-commit: dfb5b129949527991b6ef9fa1d82c1a8a3f412eb
Component: packaging
2017-09-15 18:53:37 -07:00
35f91d208e Switch aarch64 images to arm64v8
The "aarch64" images on Docker Hub are deprecated
in favor of the "arm64v8" images.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: cc436770b773767ad59e766be66323282b030d33
Component: packaging
2017-09-16 03:10:07 +02:00
4609e2004f Switch armhf images to arm32v7
The "armhf" images on Docker Hub are deprecated
in favor of the "arm32v7" and "arm32v6" images.

Note that the Alpine image is built for arm32v6,
which is compatible for both arm32v6 and arm32v7.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 2b8d4afddf118b809157f4249a45656cfaa96cd3
Component: packaging
2017-09-16 03:05:34 +02:00
a8090896a0 Merge pull request #34252 from Microsoft/akagup/lcow-remotefs-sandbox
LCOW: Support for docker cp, ADD/COPY on build
Upstream-commit: a5f9783c930834b8e6035fb0ad9c22fd4bbfc355
Component: engine
2017-09-15 16:49:48 -07:00
d8ebaa5838 Replace old version tests
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 813d2e082a094d11bda0d0f5a708ce30805ab28e
Component: engine
2017-09-15 12:56:09 -04:00
50498e4fbd Add builds for debian buster
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: cc8fa77524c6c1ee1a17dc4f77ea2ade1f112f81
Component: packaging
2017-09-15 17:35:51 +02:00
a785d9466c Merge pull request #535 from thaJeztah/remove-swp-file
Remove .swp file that was accidentally added
Upstream-commit: 6d614ec54d
Component: cli
2017-09-15 16:13:31 +02:00
892a44a627 Various fixes
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: b7d8d2c4ab709f072cbdc4f89a8c80065648757e
Component: engine
2017-09-15 16:01:15 +02:00
2a72ee1fde Merge pull request #509 from xificurC/fix-secrets-and-configs-idempotence
sort secrets and configs to ensure idempotence
Upstream-commit: a09a2c6d15
Component: cli
2017-09-15 15:43:59 +02:00
adba854430 Merge pull request #34849 from chchliang/testlayer
add testcase in layer/empty_test.go with Platform(),Metadata()
Upstream-commit: 5c10698d5c5223f9cb49704124be592e3d39d0df
Component: engine
2017-09-15 06:39:20 -07:00
2a306cdba9 Add jenkins build status to readme
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: c56d7ec37f
Component: cli
2017-09-15 15:08:28 +02:00
04f1d90792 Merge pull request #532 from dnephin/fix-e2e-fixture
Fix e2e test by using a pinned version of alpine
Upstream-commit: 9053aa1038
Component: cli
2017-09-15 14:49:37 +02:00
eae91199bd Remove .swp file that was accidentally added
This file was added by accident in dd95731a21
and not noticed during review.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: e612236a3d
Component: cli
2017-09-15 13:20:40 +02:00
b66e771f48 Merge pull request #534 from mion00/document_node_hostname_templating
Document .Node.Hostname templating
Upstream-commit: e2ee30ae42
Component: cli
2017-09-15 13:02:31 +02:00
3223c51c8a Remove erroneous Println
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: eb396e8984ce64ea6ee9c04905780d74ed7d8d8b
Component: engine
2017-09-15 13:02:27 +02:00
b43594fccc Merge pull request #442 from jhowardmsft/jjh/34508docs
Docs for Windows daemon graphdriver options
Upstream-commit: 5a7f25f24c
Component: cli
2017-09-15 12:19:14 +02:00
a5b24016fd Document .Node.Hostname templating
Update placeholders table and add example code
Follow up to moby/moby#34686

Signed-off-by: Carlo Mion <mion00@gmail.com>
Upstream-commit: 21825b6842
Component: cli
2017-09-15 10:23:56 +02:00
5086fdcfde Fix CString memory leaks
Make sure to call C.free on C string allocated using C.CString in every
exit path.

C.CString allocates memory in the C heap using malloc. It is the callers
responsibility to free them. See
https://golang.org/cmd/cgo/#hdr-Go_references_to_C for details.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Upstream-commit: 593dbfd1448e8dac08488786fde6fe7fb057bdac
Component: engine
2017-09-15 09:57:26 +02:00
ae2d031a76 add testcase in layer/empty_test.go with Metadata()
Signed-off-by: chchliang <chen.chuanliang@zte.com.cn>
Upstream-commit: c72112b171ac046d11e8279b799315e962332450
Component: engine
2017-09-15 14:13:48 +08:00
70abc439d8 Merge pull request #34258 from simonferquel/lcow-mounts
LCOW: Prepare work for bind mounts
Upstream-commit: 0300fa7f806f978451c09ebbff402ddd34e928d9
Component: engine
2017-09-14 15:00:08 -07:00
a641c1b7f0 Add LCOW behind experimental,
might not be the cleanest way, but it's definitly the way with the
minimum code change.

Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: ff686743c50dc34b57f5627ba6fee38502bdd3ec
Component: engine
2017-09-14 13:51:16 -07:00
aeb89eb179 Volume refactoring for LCOW
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
Upstream-commit: e89b6e8c2d2c36c43f22aeaf2a885646c2994051
Component: engine
2017-09-14 12:33:31 -07:00
cddfe04f6a LCOW: Implemented support for docker cp + build
This enables docker cp and ADD/COPY docker build support for LCOW.
Originally, the graphdriver.Get() interface returned a local path
to the container root filesystem. This does not work for LCOW, so
the Get() method now returns an interface that LCOW implements to
support copying to and from the container.

Signed-off-by: Akash Gupta <akagup@microsoft.com>
Upstream-commit: 7a7357dae1bcccb17e9b2d4c7c8f5c025fce56ca
Component: engine
2017-09-14 12:07:52 -07:00
14427ba493 Vendor containerd/continuity@22694c680e
Signed-off-by: Akash Gupta <akagup@microsoft.com>
Upstream-commit: ba13c173d1704168b918705b827963dc6e3900ab
Component: engine
2017-09-14 12:00:38 -07:00
29ef2e0479 Merge pull request #34217 from yongtang/34208-http-add-root
Fix build with `ADD` urls without any sub path
Upstream-commit: d60c1866679f9fcd5701eedabe49e9fa11228b08
Component: engine
2017-09-14 11:55:24 -07:00
f34f36be87 Merge pull request #34332 from clnperez/logrus-revendor
revendor logrus and x/crypto
Upstream-commit: 2a54dc080471476037c87cc6961cc126368ffdd9
Component: engine
2017-09-14 11:29:05 -07:00
44733ed80a Fixes after dnephin review
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: 7dabed019a7aac9b317b586d582431eef3b65e33
Component: engine
2017-09-14 19:27:09 +02:00
6cc83af533 Fix Windows build
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: 81f69a593146f61d3f6568403168ba28b1714f97
Component: engine
2017-09-14 19:27:09 +02:00
82ba6d5d3e Test requires SameHostDaemon
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: 61b13ba0d12aeeadc1c08eae62ba83f62208a6d3
Component: engine
2017-09-14 19:27:09 +02:00
414afe084c Correct log message
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: 5eab08930c9c2d39bb76fd6320e9979b504750a6
Component: engine
2017-09-14 19:27:09 +02:00
a13cdc241b Set client version instead of negotiating it
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: 85431566a81792e3612df3b6b858f7b0c3506883
Component: engine
2017-09-14 19:27:09 +02:00
454535ed22 Bring up DockerNetworkSuite
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: 42d812df0a12d92fad1f327f0b0f5d9eb7a9f107
Component: engine
2017-09-14 19:27:09 +02:00
58906ac91c Remove race and split TestAPINetworkInspect test
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: 6936ce3b65f149ba6ab1cd5c257358c06eb9cdbb
Component: engine
2017-09-14 19:27:09 +02:00
4d643fb18a Fixes for dnephin review
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: 86f9eb4a085a61b3355dc38452c47def806bf7c9
Component: engine
2017-09-14 19:27:09 +02:00
f23d5bec57 Skip some tests for E2E
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: f089a1df393228085c4895b8db0fa95128173398
Component: engine
2017-09-14 19:27:09 +02:00
abba79d025 Check integration test requirements using daemon
When running against a remote daemon, we cannot use the local
filesystem to determine configuration.

Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: b1fb41988dc1b7071a58f76f6ad2730fc1a02eca
Component: engine
2017-09-14 19:27:09 +02:00
2801aaa58e Use TLS for tests if needed
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: 0bdba0e91a072ee2cdecb4e632c13f187eb88e9c
Component: engine
2017-09-14 19:27:09 +02:00
e3234a8303 Fix tests that depend on clean environment
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: dc6ddfa8415d90e9a9788d5cfd5a10c17449bbc9
Component: engine
2017-09-14 19:27:09 +02:00
fe0ff1cb68 Add E2E requirement for integration tests
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: d622e81af50f4690d5867a89b430d1b94707fd26
Component: engine
2017-09-14 19:27:09 +02:00
559acd0f8b Containerize integration tests
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: 07f10d8e2e2214000635c32d23f9435fa3fb48b8
Component: engine
2017-09-14 19:27:09 +02:00
16788ee2e5 Protect entire environment when testing
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: 063c89c71fd1fbeb7ef7c46f43ee805b620e7136
Component: engine
2017-09-14 19:27:09 +02:00
9c49974512 Allow protection of entire environment during tests
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: 0520581523caeacdf718a2dd1db2958c24b47cf6
Component: engine
2017-09-14 19:27:09 +02:00
b3c31e9800 Add unit test to cover changes.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 027297a60f5f5a70e1e3eb3a68280f64c66bc877
Component: engine
2017-09-14 16:17:38 +00:00
ac38bbaf63 Fix build with ADD urls without any sub path
This fix tries to address the issue raised in #34208 where
in Dockerfile an `ADD` followed by an url without any sub path
will cause an error.

The issue is because the temporary filename relies on the sub path.

An integration test has been added.

This fix fixes #34208.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: bea0a072d86604071c99e9b6989b19ca4fe22032
Component: engine
2017-09-14 16:17:38 +00:00
97847089f1 revendor logrus and x/crypto
this fixes the issue that was blocking a test from running on ppc64le.
the logrus revendor changes the color code used in that same test, so
that breaks the test for all platforms (updated in this pr)

Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
Upstream-commit: 008b217844f8738cc47ef9ff108dc41dc37736cc
Component: engine
2017-09-14 11:05:47 -05:00
1546d32eb0 Only attempt to find pid with local daemon
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 014cecda464fb1171e613676e0a8a85c02ec1674
Component: engine
2017-09-14 12:05:18 -04:00
c95e22b252 Merge pull request #34837 from tophj-ibm/switch-hub-test-to-alpine
[integration-cli] fix p/z HubPullSuite tests
Upstream-commit: 3a081f53c150190201ddb05c97344ed5071446b0
Component: engine
2017-09-14 18:02:13 +02:00
6c749ced41 Fix e2e test by using a pinned version of alpine
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: ab2e219116
Component: cli
2017-09-14 11:38:46 -04:00
023fe0b32f [integration-cli] fix p/z HubPullSuite tests
This test tries to pull all the tags in the busybox repo and looks to see
if there were more than two images pulled. This was failing on
p/z due to the recent change to manifest lists, where one of the busybox
tags didn't have a p/z manifest in it's manifest list.

This error seems fine to me, so I changed the test to see if pull fails,
it fails with the "manifest not found" error.

Also switched from busybox -> alpine, because it has significantly less tags,
and the images are close in size.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: 5739ba1b918402b8eda748ac2f5dd7ce00f2e69f
Component: engine
2017-09-14 09:42:09 -04:00
93617a3f74 Merge pull request #34784 from dnephin/fix-client-not-found
Cleanup client not found errors
Upstream-commit: bb0e8ee51c8940c3ce23e4f594068612203c6139
Component: engine
2017-09-14 12:04:56 +02:00
c30f13232a Merge pull request #34686 from mion00/templating-node-hostname-support
Add support for .Node.Hostname templating in swarm services
Upstream-commit: 2ee8ef864f9fb9c31848fe10a61605a39fb81635
Component: engine
2017-09-13 21:06:11 -07:00
803b5f0e94 Merge pull request #34821 from thaJeztah/remove-enable-api-cors
Remove deprecated --enable-api-cors flag
Upstream-commit: dc35a8a5d22b6c828cd105be7c62b72919df25cd
Component: engine
2017-09-13 20:10:27 -07:00
63f4bb52b4 Merge pull request #34828 from allencloud/add-config-tags-in-swagger
add configs tag in swagger.yml
Upstream-commit: 80edccda708c6771824c245b4d634c2a9ce29795
Component: engine
2017-09-14 02:37:28 +02:00
4fe1c1584a Merge pull request #34844 from kolyshkin/lvm2-fix
Fix fetching LVM2 sources
Upstream-commit: a8f6e60bfc95421f0d8539fddaecd32642cd947f
Component: engine
2017-09-14 02:01:14 +02:00
150f7f6a55 Add more information about commands to generated YAML docs
This patch adds aditional information about commands to the YAML files
that are generated for the reference documentation.

The following fields are added for each command:

Property          | Type      | Description
------------------|-----------|---------------------------------------------------------------------------------------
deprecated        | Boolean   | Indicates if the command is marked deprecated
min_api_version   | String    | The API version required to use this command (e.g. "1.23")
experimental      | Boolean   | Indicates if the command requires the daemon to run with experimental features enabled

For example (taken from the experimental `docker checkpoint create` command):

    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
    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
    - option: leave-running
      value_type: bool
      default_value: "false"
      description: Leave the container running after checkpoint
      deprecated: false
      experimental: false
    deprecated: false
    min_api_version: "1.25"
    experimental: true

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 1f48e75c5c
Component: cli
2017-09-14 00:48:22 +02:00
46def61677 Add more information about command flags to generated YAML docs
This patch adds aditional information about command flags to the YAML files
that are generated for the reference documentation.

The following fields are added for each flag:

Property          | Type      | Description
------------------|-----------|---------------------------------------------------------------------------------------
value_type        | String    | The "type" of value to be passed to this flag (e.g., `uint64`, `list`)
deprecated        | Boolean   | Indicates if the flag is marked deprecated
min_api_version   | String    | The API version required to use this flag (e.g. "1.23")
experimental      | Boolean   | Indicates if the flag requires the daemon to run with experimental features enabled

For example (taken from the `docker image build` command):

    - option: security-opt
      value_type: stringSlice
      default_value: '[]'
      description: Security options
      deprecated: false
      experimental: false
    - option: shm-size
      value_type: bytes
      default_value: "0"
      description: Size of /dev/shm
      deprecated: false
      experimental: false
    - option: squash
      value_type: bool
      default_value: "false"
      description: Squash newly built layers into a single new layer
      deprecated: false
      min_api_version: "1.25"
      experimental: true

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: a8ba6f93d9
Component: cli
2017-09-14 00:47:42 +02:00
c752d6bc2e Update system prune docs for --volumes flag
The `--volumes` flag was added in 37fd6128dc,
but the documentation was not updated.

This patch updates the documentation.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: b4db84de69
Component: cli
2017-09-14 00:42:12 +02:00
d011c4127f LCOW: Add GCS debugging
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 5a0e2beac330d49c2b7436bf29e87d52dab4f557
Component: engine
2017-09-13 14:54:34 -07:00
08356f8921 Fix fetching LVM2 sources
Version 2.02.173 has disappeared, let's revert back to latest stable
one.

https://github.com/moby/moby/issues/34843

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: a436d8a634392f9e82b6930a560d56900d887ce7
Component: engine
2017-09-13 14:34:36 -07:00
69753f2d25 Merge pull request #513 from shouze/reset-id-pair-during-build-to-avoid-cache-busting
Reset uid/gid to 0 in build context to fix cache busting issues on ADD/COPY
Upstream-commit: 7b77ab5c60
Component: cli
2017-09-13 15:19:26 -04:00
57a43e8ab0 Merge pull request #34775 from darrenstahlmsft/RevendorHcsshim
Update hcsshim to v0.6.5
Upstream-commit: a15cdd707acc37e7bc5dd618a461618c3a0cda20
Component: engine
2017-09-13 11:14:36 -07:00
07369b8b77 Merge pull request #34809 from dnephin/add-gosimple-linter
Add gosimple linter
Upstream-commit: e51bc3ecd04d950f8854947ec8906937eaf87129
Component: engine
2017-09-13 12:44:59 -04:00
1a8ec36d61 Merge pull request #529 from thaJeztah/bump-version
Bump version to 17.10.0-dev
Upstream-commit: acc29884fa
Component: cli
2017-09-13 18:21:01 +02:00
7742f2c56c Merge pull request #481 from cdrage/add-build-to-service-config
Add 'build' to types.go
Upstream-commit: 2eb31e6b60
Component: cli
2017-09-13 18:20:42 +02:00
8453ea8ddd Merge pull request #525 from thaJeztah/change-detach-default
Use non-detached mode as default for service commands
Upstream-commit: e5aeb4b5e8
Component: cli
2017-09-13 11:35:08 -04:00
f7e5e8fdc8 Add 'build' to types.go
This adds 'build' to types.go in order for projects that use docker/cli
to parse Docker Compose files to correctly retrieve `build` keys

Signed-off-by: Charlie Drage <charlie@charliedrage.com>
Upstream-commit: 9bdb0763b9
Component: cli
2017-09-13 10:47:17 -04:00
002e234c45 Merge pull request #34829 from Microsoft/jjh/spotfix
LCOW: Spot fix for multi-os image pulling
Upstream-commit: 0dbc182b6c4f6a72933680f98a6240a7681d94ee
Component: engine
2017-09-13 14:32:15 +02:00
b402c14275 Bump version to 17.10.0-dev
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: e17475e935
Component: cli
2017-09-13 14:08:56 +02:00
ad105d4aec Use non-detached mode as default for service commands
Commit 330a0035334871d92207b583c1c36d52a244753f added a `--detach=false` option
to various service-related commands, with the intent to make this the default in
a future version (17.09).

This patch changes the default to use "interactive" (non-detached), allowing
users to override this by setting the `--detach` option.

To prevent problems when connecting to older daemon versions (17.05 and below,
see commit db60f25561), the detach option is
ignored for those versions, and detach is always true.

Before this change, a warning was printed to announce the upcoming default:

    $ docker service create nginx:alpine
    saxiyn3pe559d753730zr0xer
    Since --detach=false was not specified, tasks will be created in the background.
    In a future release, --detach=false will become the default.

After this change, no warning is printed, but `--detach` is disabled;

    $ docker service create nginx:alpine
    y9jujwzozi0hwgj5yaadzliq6
    overall progress: 1 out of 1 tasks
    1/1: running   [==================================================>]
    verify: Service converged

Setting the `--detach` flag makes the cli use the pre-17.06 behavior:

    $ docker service create --detach nginx:alpine
    280hjnzy0wzje5o56gr22a46n

Running against a 17.03 daemon, without specifying the `--detach` flag;

    $ docker service create nginx:alpine
    kqheg7ogj0kszoa34g4p73i8q

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 0c27355f7b
Component: cli
2017-09-13 12:27:55 +02:00
806d838e90 LCOW: Spot fix for multi-os image pulling
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: b291f5a31728f7ff6386bb37f15e7c0885d3b2a7
Component: engine
2017-09-12 23:33:34 -07:00
523435549c add configs tag in swagger.yml
Signed-off-by: Allen Sun <allensun.shl@alibaba-inc.com>
Upstream-commit: 16929d337a5dbd9aaa029271db1cdba25dd0d2f2
Component: engine
2017-09-13 09:48:05 +08:00
9d7caf267c Update gometalinter
This is mostly to include the following fix:
https://github.com/alecthomas/gometalinter/commit/78e3fbd90a20b03a

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 6be4b3703c2a2b41ccdf97fcf8d2da6863a402bd
Component: engine
2017-09-12 18:46:37 -07:00
99b37c7406 Update hcsshim to v0.6.5
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: bffc7a423f20730f086c30bc189d6c6ad81d16dd
Component: engine
2017-09-12 18:46:12 -07:00
57c34191f2 gometalinter: add per-platform configurable options
I have run into two separate issues while doing 'make all' on armhf
(a Scaleway C1 machine, same as used in CI). This commit fixes both.

1. There were a lot of "not enough memory" errors, and after that
in a few runs gometalinter just stuck forever on FUTEX_WAIT with
no children left.

Looking into docs, I found the --enable-gc option which solved the issue.

[Update: this has already been added]

2. Timeout of 2 minutes is not enough for the abovementioned platform.
The longest running linter is goimports which takes almost 6 minutes to run.

Set the timeout to the observable run time roughly doubled.

In addition, ARM platforms does not have too much RAM (2GB), so
running too many processes in parallel might be problematic. Limit
it by using -j2

[v2: make the timeout arch-dependent, also tested on aarch64 (2m15s)]
[v3: moved timeout setting to Dockerfiles]
[v4: generalized to GOMETALINTER_OPTS, added -j2 for ARM platforms]
[v5: rebase to master]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: b96093fa56a9c085cb3123010be2430753c40cbc
Component: engine
2017-09-12 18:45:34 -07:00
4219a83be8 overlay gd: fix build for 32-bit ARM
This commit reverts a hunk of commit 2f5f0af3f ("Add unconvert linter")
and adds a hint for unconvert linter to ignore excessive conversion as
it is required on 32-bit platforms (e.g. armhf).

The exact error on armhf is this:

	19:06:45 ---> Making bundle: dynbinary (in bundles/17.06.0-dev/dynbinary)
	19:06:48 Building: bundles/17.06.0-dev/dynbinary-daemon/dockerd-17.06.0-dev
	19:10:58 # github.com/docker/docker/daemon/graphdriver/overlay
	19:10:58 daemon/graphdriver/overlay/copy.go:161: cannot use stat.Atim.Sec (type int32) as type int64 in argument to time.Unix
	19:10:58 daemon/graphdriver/overlay/copy.go:161: cannot use stat.Atim.Nsec (type int32) as type int64 in argument to time.Unix
	19:10:58 daemon/graphdriver/overlay/copy.go:162: cannot use stat.Mtim.Sec (type int32) as type int64 in argument to time.Unix
	19:10:58 daemon/graphdriver/overlay/copy.go:162: cannot use stat.Mtim.Nsec (type int32) as type int64 in argument to time.Unix

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 21b2c278cc86f0fc411018becbcbf2a7e44b6057
Component: engine
2017-09-12 18:44:55 -07:00
a87f17c01b Fix 'make all' for other platforms
Since commit d7e2c4ce7 ("Use gometalinter for linting") command
"make all" fails on all the non-default platforms (i.e. ARMs, PPC, and
s390) in this way:

	# make all
	...
	Congratulations!  All commits are properly signed with the DCO!
	/go/src/github.com/docker/docker/hack/validate/gometalinter: line 6: gometalinter: command not found
	Makefile:105: recipe for target 'all' failed
	make: *** [all] Error 127

Make sure gometalinter is installed for those platforms

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: fc3040a4c41d3916739639b70fc3efd92888a0f5
Component: engine
2017-09-12 18:44:55 -07:00
053e3db35e Merge pull request #528 from andrewhsu/ven
vndr github.com/docker/docker to 84144a8 to fix stuff
Upstream-commit: f697de32b9
Component: cli
2017-09-12 17:52:55 -07:00
e18e2f39e3 vndr github.com/docker/docker to 84144a8 to fix stuff
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
Upstream-commit: 850b46e67c
Component: cli
2017-09-12 17:27:15 -07:00
6e9f643bb2 Reset idPair during build to avoid cache busting
Signed-off-by: Sébastien HOUZÉ <cto@verylastroom.com>
Upstream-commit: 7e407610d4
Component: cli
2017-09-13 02:04:03 +02:00
eae7cc4c29 Merge pull request #516 from andrewhsu/v
vndr docker/docker to ea220e7 to bring in fix for arm
Upstream-commit: b60413264d
Component: cli
2017-09-12 16:01:04 -07:00
ca1972776d Merge pull request #34826 from cezarsa/usagefix
Fix variable shadowing causing LayersSize to be reported as 0
Upstream-commit: 84144a8c66c1bb2af8fa997288f51ef2719971b4
Component: engine
2017-09-12 15:51:26 -07:00
baffbb54c8 remove unused vndr github.com/docker/libtrust
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
Upstream-commit: 536da4a07a
Component: cli
2017-09-12 13:48:21 -07:00
fda4a38658 vndr golang.org/x/sys to 07c1829
To satisfy requirements of the vndr of docker/docker

Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
Upstream-commit: 50696bbf72
Component: cli
2017-09-12 12:11:18 -07:00
55cb898a72 Fix variable shadowing causing LayersSize to be reported as 0
Signed-off-by: Cezar Sa Espinola <cezarsa@gmail.com>
Upstream-commit: 313bc1e339fa4292d9ef5bc74acc82436eab7e1e
Component: engine
2017-09-12 14:11:11 -03:00
18c29c5c5f Add gosimple linter
Update gometalinter

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: f7f101d57ef8cbf2d8723a18b7d723c5c5dd04b6
Component: engine
2017-09-12 12:09:59 -04:00
1d65628454 Merge pull request #34754 from Microsoft/jjh/read-only
LCOW: VHDX boot to readonly.
Upstream-commit: 969b76d85f93e214cbc44f25a3f44b67cb0dc078
Component: engine
2017-09-12 08:35:21 -07:00
52611dee7a Merge pull request #34796 from donutloop/fix_typos_in_locker_example
Fix typos in Locker example
Upstream-commit: 099b4de391696b740779bfcb8322b4f4186e297e
Component: engine
2017-09-12 15:48:23 +02:00
a300c8a80f Update deprecated.md for "api-enable-cors"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 7c69bf1d24
Component: cli
2017-09-12 12:47:57 +02:00
3e4a18de4d Remove deprecated --enable-api-cors flag
The `--enable-api-cors` flag was deprecated in f3dd2db4ff7de1399a49af928cd3eae4fccf8764,
and marked for removal in docker 17.09 through 85f92ef3590b386ea17e3948262725a2d3ce4db5.

This patch removes the deprecated flag.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 7d4eab554379524c2421a7ecd3319d1d087d1de2
Component: engine
2017-09-12 12:43:34 +02:00
ee7b60968b Cleanup client not found errors.
And fix remove calls to return a notFound error

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 81bb9978ab5ac99e84a5bf62d0d469f0aec1d506
Component: engine
2017-09-11 19:53:18 -04:00
7f5ba34576 Merge pull request #48 from seemethere/remove_version_dependency_from_package_building
Removes engine VERSION dependency
Upstream-commit: 3c05e034e76cb3025a9f10cf6086fed312dc7670
Component: packaging
2017-09-11 13:19:31 -07:00
528c150b8c Removes engine VERSION dependency
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 89d8a83e20172e66c16c6ddbc46f43e5f67f7045
Component: packaging
2017-09-11 12:11:59 -07:00
99e268ef3c Merge pull request #508 from docker/revert-493-patch-1
Revert "Change sshfs by cloudstor on Installing and using a plugin"
Upstream-commit: 04390f8a74
Component: cli
2017-09-11 11:25:50 -07:00
599a2ae3b1 Merge pull request #521 from dnephin/add-albers-to-maintainers
Add albers to maintainers
Upstream-commit: d0bda815d2
Component: cli
2017-09-11 19:47:20 +02:00
591014017f Add albers to maintainers.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 92cf825238
Component: cli
2017-09-11 11:22:10 -04:00
2c45bc6a92 Merge pull request #34770 from dnephin/fix-client-with-empty-id
Fix volume inspect with empty ID
Upstream-commit: 63a9ea58eb4c704ed7d7dab950f12f708cf220f7
Component: engine
2017-09-11 07:01:50 -07:00
8e2757c531 Merge pull request #421 from thaJeztah/refactor-docker-info
Refactor/cleanup of docker info
Upstream-commit: e77dc2232e
Component: cli
2017-09-11 15:25:02 +02:00
033298b8f6 Refactor/cleanup of docker info
Some mild refactoring of the docker info command;

- Use `fmt.Fprinln()` instead of `fmt.Fprintf()` where possible
- Rename `fprintfIfNotEmpty()` to `fprintlnNonEmpty()`, and removed
  return variables, because they were not used. `fprintlnNonEmpty()`
  now uses fmt.Fprintln()` instead of `fmt.Fprintf()`, because
  formatting was not used.
- Use `fprintlnNonEmpty()` to get rid of some `if` statements
- Extract printing Swarm-related information to a `printSwarmInfo()` function
- Change `Http Proxy` and `Https Proxy` to `HTTP Proxy` / `HTTPS Proxy`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 6f1b510843
Component: cli
2017-09-11 15:13:06 +02:00
95956aa7ef Merge pull request #519 from gesellix/typo-configration
[docs] Fix typo in configration.
Upstream-commit: 202205365a
Component: cli
2017-09-11 14:57:08 +02:00
1b8f2ad866 [docs] Fix typo in configration.
Signed-off-by: Tobias Gesellchen <tobias@gesellix.de>
Upstream-commit: f8ed8d22c6
Component: cli
2017-09-10 23:12:29 +02:00
e388be9473 Fix typos in Locker example
Signed-off-by: Marcel Edmund Franke <marcel.edmund.franke@gmail.com>
Upstream-commit: 6d3bc28289c265a65879a7f28264e6bacb95fbe1
Component: engine
2017-09-10 11:34:19 +02:00
af0adf66d4 Merge pull request #34790 from dnephin/add-ineffassign-linter
Add ineffassign linter
Upstream-commit: 13fec0607394f7c6da0148f8d513b6fcbf7cce61
Component: engine
2017-09-09 15:41:55 -07:00
4b9c2f5fd5 vndr docker/docker to ea220e7 to bring in fix for arm
Primarily to bring in fix for "Clear Architecture field in platform
constraint for arm architectures".

Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
Upstream-commit: ef027b6d72
Component: cli
2017-09-08 16:27:56 -07:00
fdd3e06a77 Add ineffassign linter
Also enable GC in linting to reduce memory usage.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 09652bf8789142a5a5a1de2d41590300761b4954
Component: engine
2017-09-08 18:23:21 -04:00
30a4e0ab8e Merge pull request #510 from dnephin/add-parse-log-details
Use a local copy of ParseLogDetails
Upstream-commit: aae519d0f6
Component: cli
2017-09-08 11:38:24 -07:00
fbd21afa80 Merge pull request #511 from dnephin/fix-end-of-line-whitespace-tests
Use golden files for tests that expect end-of-line whitespace
Upstream-commit: d3d9b38d55
Component: cli
2017-09-08 11:37:28 -07:00
94dd311bdc Merge pull request #495 from dnephin/container-run-e2e
Add en e2e test for `container run`
Upstream-commit: cc517f2d8a
Component: cli
2017-09-08 11:36:32 -07:00
9211237d01 Merge pull request #34767 from dnephin/deprecate-some-client
Cleanup client/ interface
Upstream-commit: 96255ba07ae7de2bb2a18567c478b63d5ac74ee4
Component: engine
2017-09-08 13:29:10 -04:00
b363a8f8a7 sort secrets and configs to ensure idempotence
`docker stack deploy` keeps restarting services it doesn't need to (no changes)
because the entries' order gets randomized at some previous (de)serialization.
Maybe it would be worth looking into this at a higher level and ensure
all (de)serialization happens in an ordered collection.

This quick fix sorts secrets and configs (in place, mutably) which ensures the
same order for each run.

Based on
https://github.com/moby/moby/pull/30506

Fixes
https://github.com/moby/moby/issues/34746

Signed-off-by: Peter Nagy <xificurC@gmail.com>
Upstream-commit: 27e8bdf32b
Component: cli
2017-09-08 16:09:48 +02:00
66ae0e70f8 Merge pull request #34771 from Microsoft/jjh/hcsshim
Revendor Microsoft/hcsshim @ v0.6.4
Upstream-commit: 8ec484ff4bef7698cc4b3ba8195dd182c2af8045
Component: engine
2017-09-07 14:51:07 -07:00
d7ed53048b Use golden files for tests that expect end-of-line whitespace
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 51587de1c4
Component: cli
2017-09-07 17:50:44 -04:00
b543555e86 Merge pull request #34761 from dnephin/fix-mount-create-api-test
Some cleanup of mount create API test
Upstream-commit: bf3a8bddeb5e1ae04b6f73bfe811372ee3e78e36
Component: engine
2017-09-07 17:09:19 -04:00
58743c32f5 Merge pull request #34756 from dnephin/better-filters
Improve docs and interface for api/types/filters
Upstream-commit: c8400bf24dcea8e160d6b614d996b0f659c7d8d9
Component: engine
2017-09-07 17:00:59 -04:00
810209d155 Revendor Microsoft/hcsshim @ v0.6.4
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: e47c626e0a5e7285782620c027b3d5195c643a5a
Component: engine
2017-09-07 12:08:40 -07:00
f1b816d854 Merge pull request #34685 from dnephin/remove-bundle-version
Remove version from bundle path
Upstream-commit: f69188aec9f74a946422a256c14bf8efc82f20d4
Component: engine
2017-09-07 11:53:53 -07:00
2e7d5b113f Merge pull request #34757 from dnephin/fix-test-run-environment
Fix TestRunEnvironment
Upstream-commit: d76f0d4e0694f5adcaab327e801ee8553620c5b3
Component: engine
2017-09-07 11:28:57 -07:00
5899c64938 Fix volume inspect with empty ID
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 5ac298fd0e5c065483653970be587626026971c2
Component: engine
2017-09-07 13:46:23 -04:00
56f259f37d Revert "Change sshfs by cloudstor on Installing and using a plugin"
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: eb77961399
Component: cli
2017-09-07 10:15:59 -07:00
0d3330814c Use a local copy of ParseLogDetails
It's being removed from client/

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: a747389bf4
Component: cli
2017-09-07 12:50:25 -04:00
d7504f67d1 Merge pull request #34738 from wgliang/optimization1
Optimize some wrong usage and spelling
Upstream-commit: 2dcb77b24c80dd95b52358c92436f68f2a33eb01
Component: engine
2017-09-07 09:45:14 -07:00
980d05f2ea Cleanup client/ interface
- Remove ParseLogDetails, this is not part of the client. Moved to docker/cli
- Deprecate ParseHost and replace with ParseHostURL
- Deprecate redundant IsErr helpers

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 54242cd067c234960d1295a67271475f9d099f22
Component: engine
2017-09-07 12:32:38 -04:00
5f49aab36a Merge pull request #34687 from tych0/bump-runc
bump runc version
Upstream-commit: a68ee8c8950b1923c3a92b9cec0d9a723897111d
Component: engine
2017-09-07 14:52:18 +02:00
6f155f233b Merge pull request #34021 from nishanttotla/dont-set-architecture-constraint
Clear Architecture field in platform constraint for arm architectures
Upstream-commit: ea220e70a13963da544645376cd9331021eec6b4
Component: engine
2017-09-07 11:18:12 +02:00
a8b7a6b071 Merge pull request #34730 from simonferquel/fix-TestEventsOOMDisableTrue-flakkyness
Events CLI tests: fix flakyness of TestEventsOOMDisableTrue
Upstream-commit: 72eb1d0a47488d279df2b80bfd3f6091eaff66a7
Component: engine
2017-09-07 11:16:37 +02:00
3aa4929239 Plugable secret backend
This commit extends SwarmKit secret management with pluggable secret
backends support.
Following previous commits:
1. docker/swarmkit@eebac27434
2. docker/docker@08f7cf0526
Added driver parameter to `docker secret` command.

Specifically:

1. `docker secret create [secret_name] --driver [driver_name]`
2.  Displaying the driver in
```
    $ docker secret ls
    $ docker secret inspect [secret_name]
    $ docker secret inspect [secret_name] -pretty
```

Signed-off-by: Liron Levin <liron@twistlock.com>
Upstream-commit: 0ee9e05d8f
Component: cli
2017-09-07 11:10:44 +03:00
eec1d4ef54 Optimize some wrong usage and spelling
Signed-off-by: wgliang <liangcszzu@163.com>
Upstream-commit: 94cefa21459a0c620e5a9c2da04df6d3a43dae17
Component: engine
2017-09-07 09:44:08 +08:00
567b25fb28 Some cleanup of mount create API test
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 58b96aced87b33c4175fa5d3422289f763ab599d
Component: engine
2017-09-06 19:32:35 -04:00
5063459b89 Merge pull request #34748 from dnephin/cleanup-client-deps
Cleanup client/ package dependencies
Upstream-commit: be97c66708c24727836a22247319ff2943d91a03
Component: engine
2017-09-06 16:14:29 -07:00
9fb93d3c84 Add TCP support for GELF log driver
Signed-off-by: Ghislain Bourgeois <ghislain.bourgeois@gmail.com>
Upstream-commit: e17f3511144b37855d56a009d7e7622029242d2d
Component: engine
2017-09-06 17:45:26 -04:00
74473d87d6 Merge pull request #493 from jmaitrehenry/patch-1
Change sshfs by cloudstor on Installing and using a plugin
Upstream-commit: af94015b8c
Component: cli
2017-09-06 14:42:34 -07:00
11b376603e Fix a bad assumption
If the empty variable happens to be sorted to the end of the list then TrimSpace()
would remove it. Instead only strip the single trailing newline.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: fff605c3b3557acf6bf793813d695fba59d7fa21
Component: engine
2017-09-06 17:32:56 -04:00
4a595ff1d9 Add an end-to-end test for container run
for testing attach, remove, and pull image when missing.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: c34360cc8e
Component: cli
2017-09-06 17:07:38 -04:00
6fc4c48771 Move common e2e things into an internal package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 677d17150a
Component: cli
2017-09-06 17:07:38 -04:00
e65a64c87e Add gotestyourself/poll
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 683b6226ed
Component: cli
2017-09-06 17:07:35 -04:00
cb4257d5fb Cleanup filter package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 065118390a3ecaf0dbd2fa752d54d43f8f1e8ec6
Component: engine
2017-09-06 16:41:47 -04:00
9f20b18453 Move tlsconfig to client package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 6916c215b00ab4d7edf4be14848ab2e695697381
Component: engine
2017-09-06 16:39:55 -04:00
b82f223f2c Add support for TCP parameters
Signed-off-by: Ghislain Bourgeois <ghislain.bourgeois@gmail.com>
Upstream-commit: e21f7b6e76d578ba2ab9a6e85f4ece49290ee084
Component: engine
2017-09-06 15:55:58 -04:00
d9bec8489e Remove empty gelf_unsupported.go
Signed-off-by: Ghislain Bourgeois <ghislain.bourgeois@gmail.com>
Upstream-commit: 72f5e5e84f402f175ec08964053e1af688dad265
Component: engine
2017-09-06 15:55:58 -04:00
fe4a918058 Update to latest go-gelf version and add tests
Signed-off-by: Ghislain Bourgeois <ghislain.bourgeois@gmail.com>
Upstream-commit: b24c8e07f1f2619f0a6d73b808dffceb314e7081
Component: engine
2017-09-06 15:55:58 -04:00
c87a482794 Revendor Microsoft/opengcs @v0.3.3
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: bf898b7a0cedfec5b7e8104a1ac684f9dd232638
Component: engine
2017-09-06 12:55:25 -07:00
8db4d9c803 LCOW: VHDX boot to read-only
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 17a24034bb4281e2b63949beaa5d3846c0891726
Component: engine
2017-09-06 10:55:19 -07:00
cc7b3620f0 Remove libtrust dep from api
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 2f007e46d0100d865a061c1a8e544bddc0b7a368
Component: engine
2017-09-06 12:05:19 -04:00
33519380e5 Move names to a more appropriate package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 22b246417f52aa6bd0e358e41e2bfb9c0a59c867
Component: engine
2017-09-06 12:05:16 -04:00
67de569278 Merge pull request #34745 from simonferquel/fix-pkg-archive-conversion
Re-enable some conversion for darwin-amd64 platform
Upstream-commit: 945d80cd6ad5fc9d30a947ab8872721272ac7bff
Component: engine
2017-09-06 09:00:29 -07:00
6ee8cdfa2e Merge pull request #34697 from fcrisciani/ln-vendoring
Vendoring libnetwork
Upstream-commit: 3b449dbfbad4374f618a901ff585d2ea62b1029e
Component: engine
2017-09-06 17:52:56 +02:00
0bd644faaf re-enable some conversion for darwin-amd64 platform
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
Upstream-commit: 7c9e64a2e1891bf1020d9312a18741c734fa1cd6
Component: engine
2017-09-06 12:22:41 +02:00
87c0724076 devicemapper: remove container rootfs mountPath after umount
libdm currently has a fairly substantial DoS bug that makes certain
operations fail on a libdm device if the device has active references
through mountpoints. This is a significant problem with the advent of
mount namespaces and MS_PRIVATE, and can cause certain --volume mounts
to cause libdm to no longer be able to remove containers:

  % docker run -d --name testA busybox top
  % docker run -d --name testB -v /var/lib/docker:/docker busybox top
  % docker rm -f testA
  [fails on libdm with dm_task_run errors.]

This also solves the problem of unprivileged users being able to DoS
docker by using unprivileged mount namespaces to preseve mounts that
Docker has dropped.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
Upstream-commit: 92e45b81e0a8b68d9567a2068247460a1ba59600
Component: engine
2017-09-06 20:11:01 +10:00
fd94302cba Relabel config files.
Without relabel these files, SELinux-enabled containers will show
"permission denied" errors for configuration files mounted with
`docker server create ... --config ... ...`.

Signed-off-by: Wenxuan Zhao <viz@linux.com>
Upstream-commit: 472c03a8c364090afb88258b3dd9748183c29d05
Component: engine
2017-09-05 18:39:48 -03:00
54efaca689 Merge pull request #34707 from vieux/force_format
force inspect test format
Upstream-commit: d7b4c7e0eac223eda54940adbb4c44bf71ec039c
Component: engine
2017-09-05 13:35:07 -07:00
50ebf89669 Merge pull request #219 from seemethere/update_makefile
Add update-components target, Fix PHONY Targets
2017-09-05 13:10:56 -07:00
57918230aa Add update-components target, Fix PHONY Targets
This allows easier updating of Docker CE components

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2017-09-05 12:57:43 -07:00
f109c25168 Merge pull request #34682 from dnephin/fail-build-on-integration-suite
Fix integration suite and propagate failures
Upstream-commit: 975675e9245e1d9a18cae978a0231ff83772048b
Component: engine
2017-09-05 12:40:00 -07:00
8570202308 Add bash completion for dockerd --network-control-plane-mtu
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 36068e8763
Component: cli
2017-09-05 21:29:44 +02:00
33d6fdcfda Merge pull request #353 from albers/completion-nodelist
Use native formatting in bash completion of nodes
Upstream-commit: 0426ea1443
Component: cli
2017-09-05 15:09:00 -04:00
28cf6767d3 Merge pull request #424 from simonferquel/update-vendoring
updated vendoring
Upstream-commit: 5c5cdd0e36
Component: cli
2017-09-05 15:06:09 -04:00
56b8d8a2a0 Remove version from bundle path
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: bac2447964c8cdfcf35f928841d60310db997c76
Component: engine
2017-09-05 13:38:32 -04:00
33179f56a2 force inspect test format
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: 8e6567cb837e1c885de5146517557c7a5d8a5f17
Component: engine
2017-09-05 08:31:44 -07:00
e76adc6a0e Merge pull request #406 from ksouf/issue_37_network_list_test
adding network list test
Upstream-commit: ec99774a85
Component: cli
2017-09-05 11:24:32 -04:00
30986cbc05 Avoid failing the test if container is already stopped
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
Upstream-commit: adf75503dba2e782139173c011999eacd0c3d7e2
Component: engine
2017-09-05 17:19:57 +02:00
db0c7d8918 Merge pull request #34704 from seemethere/add_overwriteable_version
Allows VERSION to be overwritten by env variable
Upstream-commit: 9e0a1845f23327c4623a49329b2480d98e02173f
Component: engine
2017-09-04 16:47:52 -07:00
2f974e7293 Add bash completion for search --format
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: f6219ac3c6
Component: cli
2017-09-04 18:21:47 +02:00
09edca8b4e Merge pull request #491 from FrenchBen/fix-stack
Move output of stack rm to stdout
Upstream-commit: 38c1895021
Component: cli
2017-09-04 15:56:30 +02:00
55c903723c Add support for .Node.Hostname templating in swarm services
Signed-off-by: Carlo Mion <mion00@gmail.com>
Upstream-commit: e2f09fa6dd1705eb69ab97fbf759253a4162228a
Component: engine
2017-09-02 10:06:16 +02:00
444c2e65a4 Remove unused depdendencies from vendor
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 724f03bb23
Component: cli
2017-09-01 19:41:06 -04:00
4bafd44516 updated vendoring
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
Upstream-commit: a0113c3a44
Component: cli
2017-09-01 19:41:06 -04:00
0699e6b42a Allows VERSION to be overwritten by env variable
VERSION was hardcoded to be used as the `VERSION` file from the root
directory, this makes it so that you have the option to overwrite this.

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 76643025793ca742b1c19bd35cab35c8ff7d3e77
Component: engine
2017-09-01 15:47:15 -07:00
ee07288be3 Move output of stack rm to stdout
Signed-off-by: French Ben <frenchben@docker.com>

Update for the test to capture the proper removal

Signed-off-by: French Ben <frenchben@docker.com>

Satisfy lint length limit

Signed-off-by: French Ben <frenchben@docker.com>

Updated e2e test

Signed-off-by: French Ben <frenchben@docker.com>
Upstream-commit: bb8f49773c
Component: cli
2017-09-01 14:25:20 -07:00
2578773887 Clear Architecture field in platform constraint for arm architectures
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
Upstream-commit: 772af6040ed4f2f26c22901597333a900be17aae
Component: engine
2017-09-01 13:08:20 -07:00
d99a5ff6bf Change sshfs by cloudstor on Installing and using a plugin
Signed-off-by: Julien Maitrehenry <julien.maitrehenry@me.com>
Upstream-commit: e97d72334f
Component: cli
2017-09-01 14:42:01 -04:00
58ef7a0132 Fix integration suite and propagate failures
Failures from the integration suite were not propagating to the outter shell
for some reason. Handle the failure with an if exit 1.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 96707bc600747257e82917ca079fa5006d636b2c
Component: engine
2017-09-01 13:07:47 -04:00
35c8905315 Vendoring libnetwork
Diff:
5b28c0ec98...d5c8223190

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
Upstream-commit: 1ddeb11835600127a3319fc0dd3764e57ffbf521
Component: engine
2017-08-31 19:10:23 -07:00
3c0eab373a bump runc version
This picks up 66eb2a3e8fc930e1bb6703561152edf5ab550bff, which fixes
readonly containers in user namespaces.

Signed-off-by: Tycho Andersen <tycho@docker.com>
Upstream-commit: 47e9d856c43b6b251d86afc099ec092aa83b1534
Component: engine
2017-08-30 14:26:59 -07:00
6eb6b7d9d2 adding network list test
Signed-off-by: khaled souf <khaled.souf@gmail.com>
Upstream-commit: 15d92a9e03
Component: cli
2017-08-29 16:30:37 +02:00
b812e1036b Use native formatting in bash completion of nodes
Completion of nodes now uses native Docker commands that were not available
when this function was created.

Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: e391e34801
Component: cli
2017-08-28 09:59:19 +02:00
b132c15093 Improve bash completion for --credential-spec
This option is Windows specific and should be only available if the
daemon runs on Windows.

Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 056ccf88be
Component: cli
2017-08-28 09:53:58 +02:00
ce23144495 Fixed raw mode splunk logger
Splunk HEC does not accept log events with an empty string or a
whitespace-only string.

Signed-off-by: Florian Noeding <florian@noeding.com>
Upstream-commit: 5f6d6a5093a4db799f9c1a6bb82eed1eea13ec0c
Component: engine
2017-08-18 12:03:43 +02:00
934616e542 Replacing os.Lstat with os.Stat to determine directory status in CopyInfoDestinationPath
Signed-off-by: Douglas Curtis <dougcurtis1@gmail.com>

Commenting out tests for now

Signed-off-by: Doug Curtis <dougcurtis1@gmail.com>

Added unit test for CopyInfoDestionationPath.

Signed-off-by: Doug Curtis <dougcurtis1@gmail.com>

Removing integration-cli test case additions

Signed-off-by: Doug Curtis <dougcurtis1@gmail.com>

Removing extra spaces between archive_unix_test.go test cases

Signed-off-by: Doug Curtis <dougcurtis1@gmail.com>

Fixed gofmt issues in archive_unix_test.go

Signed-off-by: Doug Curtis <dougcurtis1@gmail.com>
Upstream-commit: cd7489f2b745578e0d8855aa44213b07b495f86f
Component: engine
2017-08-15 23:19:42 +00:00
615f3700ae Docs for Windows daemon graphdriver options
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: c848f9acb6
Component: cli
2017-08-15 10:20:15 -07:00
2982 changed files with 221996 additions and 75330 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.helpers/

View File

@ -5,4 +5,103 @@ information on the list of deprecated flags and APIs please have a look at
https://docs.docker.com/engine/deprecated/ where target removal dates can also
be found.
## 17.09.0-ce (2017-09-DD)
IMPORTANT:
You should stop all containers and plugins **BEFORE** upgrading to Docker CE 17.12.
See related PR: [moby/moby#35812](https://github.com/moby/moby/pull/35812)
## 17.12.0-ce (2017-12-DD)
### Builder
- Fix build cache hash for broken symlink [moby/moby#34271](https://github.com/moby/moby/pull/34271)
- Fix long stream sync [moby/moby#35404](https://github.com/moby/moby/pull/35404)
- Fix dockerfile parser failing silently on long tokens [moby/moby#35429](https://github.com/moby/moby/pull/35429)
### Client
* Remove secret/config duplication in cli/compose [docker/cli#671](https://github.com/docker/cli/pull/671)
* Add `--local` flag to `docker trust sign` [docker/cli#575](https://github.com/docker/cli/pull/575)
* Add `docker trust inspect` [docker/cli#694](https://github.com/docker/cli/pull/694)
+ Add `name` field to secrets and configs to allow interpolation in Compose files [docker/cli#668](https://github.com/docker/cli/pull/668)
+ Add `--isolation` for setting swarm service isolation mode [docker/cli#426](https://github.com/docker/cli/pull/426)
* Remove deprecated "daemon" subcommand [docker/cli#689](https://github.com/docker/cli/pull/689)
- Fix behaviour of `rmi -f` with unexpected errors [docker/cli#654](https://github.com/docker/cli/pull/654)
* Integrated Generic resource in service create [docker/cli#429](https://github.com/docker/cli/pull/429)
- Fix external networks in stacks [docker/cli#743](https://github.com/docker/cli/pull/743)
* Remove support for referencing images by image shortid [docker/cli#753](https://github.com/docker/cli/pull/753) and [moby/moby#35790](https://github.com/moby/moby/pull/35790)
* Use commit-sha instead of tag for containerd [moby/moby#35770](https://github.com/moby/moby/pull/35770)
### Documentation
* Update API version history for 1.35 [moby/moby#35724](https://github.com/moby/moby/pull/35724)
### Logging
* Logentries driver line-only=true []byte output fix [moby/moby#35612](https://github.com/moby/moby/pull/35612)
* Logentries line-only logopt fix to maintain backwards compatibility [moby/moby#35628](https://github.com/moby/moby/pull/35628)
+ Add `--until` flag for docker logs [moby/moby#32914](https://github.com/moby/moby/pull/32914)
+ Add gelf log driver plugin to Windows build [moby/moby#35073](https://github.com/moby/moby/pull/35073)
* Set timeout on splunk batch send [moby/moby#35496](https://github.com/moby/moby/pull/35496)
* Update Graylog2/go-gelf [moby/moby#35765](https://github.com/moby/moby/pull/35765)
- Fix aws logs batch size calculation [moby/moby#35726](https://github.com/moby/moby/pull/35726)
### Networking
* Move load balancer sandbox creation/deletion into libnetwork [moby/moby#35422](https://github.com/moby/moby/pull/35422)
* Only chown network files within container metadata [moby/moby#34224](https://github.com/moby/moby/pull/34224)
* Restore error type in FindNetwork [moby/moby#35634](https://github.com/moby/moby/pull/35634)
- Fix consumes MIME type for NetworkConnect [moby/moby#35542](https://github.com/moby/moby/pull/35542)
+ Added support for persisting Windows network driver specific options [moby/moby#35563](https://github.com/moby/moby/pull/35563)
- Fix timeout on netlink sockets and watchmiss leak [moby/moby#35677](https://github.com/moby/moby/pull/35677)
+ New daemon config for networking diagnosis [moby/moby#35677](https://github.com/moby/moby/pull/35677)
- Clean up node management logic [docker/libnetwork#2036](https://github.com/docker/libnetwork/pull/2036)
- Allocate VIPs when endpoints are restored [docker/swarmkit#2474](https://github.com/docker/swarmkit/pull/2474)
### Runtime
* Update to containerd v1.0.0 [moby/moby#35707](https://github.com/moby/moby/pull/35707)
* Have VFS graphdriver use accelerated in-kernel copy [moby/moby#35537](https://github.com/moby/moby/pull/35537)
* Introduce `workingdir` option for docker exec [moby/moby#35661](https://github.com/moby/moby/pull/35661)
* Bump Go to 1.9.2 [moby/moby#33892](https://github.com/moby/moby/pull/33892) [docker/cli#716](https://github.com/docker/cli/pull/716)
* `/dev` should not be readonly with `--readonly` flag [moby/moby#35344](https://github.com/moby/moby/pull/35344)
+ Add custom build-time Graphdrivers priority list [moby/moby#35522](https://github.com/moby/moby/pull/35522)
* LCOW: CLI changes to add platform flag - pull, run, create and build [docker/cli#474](https://github.com/docker/cli/pull/474)
* Fix width/height on Windoes for `docker exec` [moby/moby#35631](https://github.com/moby/moby/pull/35631)
* Detect overlay2 support on pre-4.0 kernels [moby/moby#35527](https://github.com/moby/moby/pull/35527)
* Devicemapper: remove container rootfs mountPath after umount [moby/moby#34573](https://github.com/moby/moby/pull/34573)
* Disallow overlay/overlay2 on top of NFS [moby/moby#35483](https://github.com/moby/moby/pull/35483)
- Fix potential panic during plugin set. [moby/moby#35632](https://github.com/moby/moby/pull/35632)
- Fix some issues with locking on the container [moby/moby#35501](https://github.com/moby/moby/pull/35501)
- Fixup some issues with plugin refcounting [moby/moby#35265](https://github.com/moby/moby/pull/35265)
+ Add missing lock in ProcessEvent [moby/moby#35516](https://github.com/moby/moby/pull/35516)
+ Add vfs quota support [moby/moby#35231](https://github.com/moby/moby/pull/35231)
* Skip empty directories on prior graphdriver detection [moby/moby#35528](https://github.com/moby/moby/pull/35528)
* Skip xfs quota tests when running in user namespace [moby/moby#35526](https://github.com/moby/moby/pull/35526)
+ Added SubSecondPrecision to config option. [moby/moby#35529](https://github.com/moby/moby/pull/35529)
* Update fsnotify to fix deadlock in removing watch [moby/moby#35453](https://github.com/moby/moby/pull/35453)
- Fix "duplicate mount point" when `--tmpfs /dev/shm` is used [moby/moby#35467](https://github.com/moby/moby/pull/35467)
- Fix honoring tmpfs-size for user `/dev/shm` mount [moby/moby#35316](https://github.com/moby/moby/pull/35316)
- Fix EBUSY errors under overlayfs and v4.13+ kernels [moby/moby#34948](https://github.com/moby/moby/pull/34948)
* Container: protect health monitor channel [moby/moby#35482](https://github.com/moby/moby/pull/35482)
* Container: protect the health status with mutex [moby/moby#35517](https://github.com/moby/moby/pull/35517)
* Container: update real-time resources [moby/moby#33731](https://github.com/moby/moby/pull/33731)
* Create labels when volume exists only remotely [moby/moby#34896](https://github.com/moby/moby/pull/34896)
- Fix leaking container/exec state [moby/moby#35484](https://github.com/moby/moby/pull/35484)
* Disallow using legacy (v1) registries [moby/moby#35751](https://github.com/moby/moby/pull/35751) and [docker/cli#747](https://github.com/docker/cli/pull/747)
- Windows: Fix case insensitive filename matching against builder cache [moby/moby#35793](https://github.com/moby/moby/pull/35793)
- Fix race conditions around process handling and error checks [moby/moby#35809](https://github.com/moby/moby/pull/35809)
* Ensure containers are stopped on daemon startup [moby/moby#35805](https://github.com/moby/moby/pull/35805)
* Follow containerd namespace conventions [moby/moby#35812](https://github.com/moby/moby/pull/35812)
### Swarm Mode
+ Added support for swarm service isolation mode [moby/moby#34424](https://github.com/moby/moby/pull/34424)
- Fix task clean up for tasks that are complete [docker/swarmkit#2477](https://github.com/docker/swarmkit/pull/2477)
### Packaging
+ Add Packaging for Fedora 27 [docker/docker-ce-packaging#59](https://github.com/docker/docker-ce-packaging/pull/59)
* Change default versioning scheme to 0.0.0-dev unless specified for packaging [docker/docker-ce-packaging#67](https://github.com/docker/docker-ce-packaging/pull/67)
* Pass Version to engine static builds [docker/docker-ce-packaging#70](https://github.com/docker/docker-ce-packaging/pull/70)

View File

@ -1,27 +1,56 @@
CLI_DIR:=$(CURDIR)/components/cli
ENGINE_DIR:=$(CURDIR)/components/engine
PACKAGING_DIR:=$(CURDIR)/components/packaging
MOBY_COMPONENTS_SHA=ab7c118272b02d8672dc0255561d0c4015979780
MOBY_COMPONENTS_URL=https://raw.githubusercontent.com/shykes/moby-extras/$(MOBY_COMPONENTS_SHA)/cmd/moby-components
MOBY_COMPONENTS=.helpers/moby-components-$(MOBY_COMPONENTS_SHA)
VERSION=$(shell cat VERSION)
.PHONY: help
help: ## show make targets
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
.PHONY: test-integration-cli
test-integration-cli: $(CLI_DIR)/build/docker ## test integration of cli and engine
$(MAKE) -C $(ENGINE_DIR) DOCKER_CLI_PATH=$< test-integration-cli
$(CLI_DIR)/build/docker:
$(MAKE) -C $(CLI_DIR) -f docker.Makefile build
.PHONY: deb
deb: ## build deb packages
$(MAKE) VERSION=$(VERSION) CLI_DIR=$(CLI_DIR) ENGINE_DIR=$(ENGINE_DIR) -C $(PACKAGING_DIR) deb
.PHONY: rpm
rpm: ## build rpm packages
$(MAKE) VERSION=$(VERSION) CLI_DIR=$(CLI_DIR) ENGINE_DIR=$(ENGINE_DIR) -C $(PACKAGING_DIR) rpm
.PHONY: static
static: ## build static packages
$(MAKE) VERSION=$(VERSION) CLI_DIR=$(CLI_DIR) ENGINE_DIR=$(ENGINE_DIR) -C $(PACKAGING_DIR) static
.PHONY: clean
clean: ## clean the build artifacts
-$(MAKE) -C $(CLI_DIR) clean
-$(MAKE) -C $(ENGINE_DIR) clean
-$(MAKE) -C $(PACKAGING_DIR) clean
$(MOBY_COMPONENTS):
mkdir -p .helpers
curl -fsSL $(MOBY_COMPONENTS_URL) > $(MOBY_COMPONENTS)
chmod +x $(MOBY_COMPONENTS)
.PHONY: update-components
update-components: update-components-cli update-components-engine update-components-packaging ## udpate components using moby extra tool
.PHONY: update-components-cli
update-components-cli: $(MOBY_COMPONENTS)
$(MOBY_COMPONENTS) update cli
.PHONY: update-components-engine
update-components-engine: $(MOBY_COMPONENTS)
$(MOBY_COMPONENTS) update engine
.PHONY: update-components-packaging
update-components-packaging: $(MOBY_COMPONENTS)
$(MOBY_COMPONENTS) update packaging

View File

@ -1 +1 @@
17.09.0-dev
17.12.0-ce-rc4

View File

@ -1,9 +1,9 @@
# Github code owners
# GitHub code owners
# See https://github.com/blog/2392-introducing-code-owners
cli/command/stack/** @dnephin @vdemeester
cli/compose/** @dnephin @vdemeester
contrib/completion/bash/** @albers
contrib/completion/zsh/** @sdurrheimer
docs/** @mstanleyjones @vdemeester @thaJeztah
docs/** @mistyhacks @vdemeester @thaJeztah
scripts/** @dnephin

View File

@ -27,6 +27,7 @@
people = [
"aaronlehmann",
"albers",
"aluzzardi",
"anusha",
"cpuguy83",
@ -84,6 +85,11 @@
Email = "aaron.lehmann@docker.com"
GitHub = "aaronlehmann"
[people.albers]
Name = "Harald Albers"
Email = "github@albersweb.de"
GitHub = "albers"
[people.aluzzardi]
Name = "Andrea Luzzardi"
Email = "al@docker.com"
@ -97,7 +103,7 @@
[people.cpuguy83]
Name = "Brian Goff"
Email = "cpuguy83@gmail.com"
Github = "cpuguy83"
GitHub = "cpuguy83"
[people.crosbymichael]
Name = "Michael Crosby"
@ -127,7 +133,7 @@
[people.misty]
Name = "Misty Stanley-Jones"
Email = "misty@docker.com"
GitHub = "mstanleyjones"
GitHub = "mistyhacks"
[people.mlaventure]
Name = "Kenfe-Mickaël Laventure"

View File

@ -34,6 +34,14 @@ binary: ## build executable for Linux
cross: ## build executable for macOS and Windows
./scripts/build/cross
.PHONY: binary-windows
binary-windows: ## build executable for Windows
./scripts/build/windows
.PHONY: binary-osx
binary-osx: ## build executable for macOS
./scripts/build/osx
.PHONY: dynbinary
dynbinary: ## build dynamically linked binary
./scripts/build/dynbinary

View File

@ -1,4 +1,4 @@
[![build status](https://circleci.com/gh/docker/cli.svg?style=shield)](https://circleci.com/gh/docker/cli/tree/master)
[![build status](https://circleci.com/gh/docker/cli.svg?style=shield)](https://circleci.com/gh/docker/cli/tree/master) [![Build Status](https://jenkins.dockerproject.org/job/docker/job/cli/job/master/badge/icon)](https://jenkins.dockerproject.org/job/docker/job/cli/job/master/)
docker/cli
==========

View File

@ -1 +1 @@
17.08.0-dev
17.12.0-ce-rc4

View File

@ -17,6 +17,7 @@ func SetupRootCommand(rootCmd *cobra.Command) {
cobra.AddTemplateFunc("operationSubCommands", operationSubCommands)
cobra.AddTemplateFunc("managementSubCommands", managementSubCommands)
cobra.AddTemplateFunc("wrappedFlagUsages", wrappedFlagUsages)
cobra.AddTemplateFunc("useLine", UseLine)
rootCmd.SetUsageTemplate(usageTemplate)
rootCmd.SetHelpTemplate(helpTemplate)
@ -25,6 +26,7 @@ func SetupRootCommand(rootCmd *cobra.Command) {
rootCmd.PersistentFlags().BoolP("help", "h", false, "Print usage")
rootCmd.PersistentFlags().MarkShorthandDeprecated("help", "please use --help")
rootCmd.PersistentFlags().Lookup("help").Hidden = true
}
// FlagErrorFunc prints an error message which matches the format of the
@ -97,9 +99,19 @@ func managementSubCommands(cmd *cobra.Command) []*cobra.Command {
return cmds
}
// UseLine returns the usage line for a command. This implementation is different
// from the default Command.UseLine in that it does not add a `[flags]` to the
// end of the line.
func UseLine(cmd *cobra.Command) string {
if cmd.HasParent() {
return cmd.Parent().CommandPath() + " " + cmd.Use
}
return cmd.Use
}
var usageTemplate = `Usage:
{{- if not .HasSubCommands}} {{.UseLine}}{{end}}
{{- if not .HasSubCommands}} {{ useLine . }}{{end}}
{{- if .HasSubCommands}} {{ .CommandPath}} COMMAND{{end}}
{{ .Short | trim }}

View File

@ -9,11 +9,11 @@ import (
// NewCheckpointCommand returns the `checkpoint` subcommand (only in experimental)
func NewCheckpointCommand(dockerCli command.Cli) *cobra.Command {
cmd := &cobra.Command{
Use: "checkpoint",
Short: "Manage checkpoints",
Args: cli.NoArgs,
RunE: command.ShowHelp(dockerCli.Err()),
Tags: map[string]string{"experimental": "", "version": "1.25"},
Use: "checkpoint",
Short: "Manage checkpoints",
Args: cli.NoArgs,
RunE: command.ShowHelp(dockerCli.Err()),
Annotations: map[string]string{"experimental": "", "version": "1.25"},
}
cmd.AddCommand(
newCreateCommand(dockerCli),

View File

@ -12,14 +12,17 @@ import (
cliconfig "github.com/docker/cli/cli/config"
"github.com/docker/cli/cli/config/configfile"
cliflags "github.com/docker/cli/cli/flags"
"github.com/docker/cli/cli/trust"
dopts "github.com/docker/cli/opts"
"github.com/docker/docker/api"
"github.com/docker/docker/client"
"github.com/docker/go-connections/sockets"
"github.com/docker/go-connections/tlsconfig"
"github.com/docker/notary/passphrase"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/theupdateframework/notary"
notaryclient "github.com/theupdateframework/notary/client"
"github.com/theupdateframework/notary/passphrase"
"golang.org/x/net/context"
)
@ -39,6 +42,7 @@ type Cli interface {
SetIn(in *InStream)
ConfigFile() *configfile.ConfigFile
ServerInfo() ServerInfo
NotaryClient(imgRefAndAuth trust.ImageRefAndAuth, actions []string) (notaryclient.Repository, error)
}
// DockerCli is an instance the docker command line client.
@ -111,44 +115,58 @@ func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions) error {
var err error
cli.client, err = NewAPIClientFromFlags(opts.Common, cli.configFile)
if tlsconfig.IsErrEncryptedKey(err) {
var (
passwd string
giveup bool
)
passRetriever := passphrase.PromptRetrieverWithInOut(cli.In(), cli.Out(), nil)
for attempts := 0; tlsconfig.IsErrEncryptedKey(err); attempts++ {
// some code and comments borrowed from notary/trustmanager/keystore.go
passwd, giveup, err = passRetriever("private", "encrypted TLS private", false, attempts)
// Check if the passphrase retriever got an error or if it is telling us to give up
if giveup || err != nil {
return errors.Wrap(err, "private key is encrypted, but could not get passphrase")
}
opts.Common.TLSOptions.Passphrase = passwd
cli.client, err = NewAPIClientFromFlags(opts.Common, cli.configFile)
newClient := func(password string) (client.APIClient, error) {
opts.Common.TLSOptions.Passphrase = password
return NewAPIClientFromFlags(opts.Common, cli.configFile)
}
cli.client, err = getClientWithPassword(passRetriever, newClient)
}
if err != nil {
return err
}
cli.initializeFromClient()
return nil
}
func (cli *DockerCli) initializeFromClient() {
cli.defaultVersion = cli.client.ClientVersion()
if ping, err := cli.client.Ping(context.Background()); err == nil {
cli.server = ServerInfo{
HasExperimental: ping.Experimental,
OSType: ping.OSType,
}
cli.client.NegotiateAPIVersionPing(ping)
} else {
ping, err := cli.client.Ping(context.Background())
if err != nil {
// Default to true if we fail to connect to daemon
cli.server = ServerInfo{HasExperimental: true}
if ping.APIVersion != "" {
cli.client.NegotiateAPIVersionPing(ping)
}
return
}
return nil
cli.server = ServerInfo{
HasExperimental: ping.Experimental,
OSType: ping.OSType,
}
cli.client.NegotiateAPIVersionPing(ping)
}
func getClientWithPassword(passRetriever notary.PassRetriever, newClient func(password string) (client.APIClient, error)) (client.APIClient, error) {
for attempts := 0; ; attempts++ {
passwd, giveup, err := passRetriever("private", "encrypted TLS private", false, attempts)
if giveup || err != nil {
return nil, errors.Wrap(err, "private key is encrypted, but could not get passphrase")
}
apiclient, err := newClient(passwd)
if !tlsconfig.IsErrEncryptedKey(err) {
return apiclient, err
}
}
}
// NotaryClient provides a Notary Repository to interact with signed metadata for an image
func (cli *DockerCli) NotaryClient(imgRefAndAuth trust.ImageRefAndAuth, actions []string) (notaryclient.Repository, error) {
return trust.GetNotaryRepository(cli.In(), cli.Out(), UserAgent(), imgRefAndAuth.RepoInfo(), imgRefAndAuth.AuthConfig(), actions...)
}
// ServerInfo stores details about the supported features and platform of the
@ -189,7 +207,8 @@ func NewAPIClientFromFlags(opts *cliflags.CommonOptions, configFile *configfile.
return client.NewClient(host, verStr, httpClient, customHeaders)
}
func getServerHost(hosts []string, tlsOptions *tlsconfig.Options) (host string, err error) {
func getServerHost(hosts []string, tlsOptions *tlsconfig.Options) (string, error) {
var host string
switch len(hosts) {
case 0:
host = os.Getenv("DOCKER_HOST")
@ -199,8 +218,7 @@ func getServerHost(hosts []string, tlsOptions *tlsconfig.Options) (host string,
return "", errors.New("Please specify only one -H")
}
host, err = dopts.ParseHost(tlsOptions != nil, host)
return
return dopts.ParseHost(tlsOptions != nil, host)
}
func newHTTPClient(host string, tlsOptions *tlsconfig.Options) (*http.Client, error) {

View File

@ -4,12 +4,18 @@ import (
"os"
"testing"
"crypto/x509"
"github.com/docker/cli/cli/config/configfile"
"github.com/docker/cli/cli/flags"
"github.com/docker/cli/internal/test/testutil"
"github.com/docker/docker/api"
"github.com/docker/docker/api/types"
"github.com/docker/docker/client"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/net/context"
)
func TestNewAPIClientFromFlags(t *testing.T) {
@ -43,7 +49,7 @@ func TestNewAPIClientFromFlagsWithAPIVersionFromEnv(t *testing.T) {
assert.Equal(t, customVersion, apiclient.ClientVersion())
}
// TODO: move to gotestyourself
// TODO: use gotestyourself/env.Patch
func patchEnvVariable(t *testing.T, key, value string) func() {
oldValue, ok := os.LookupEnv(key)
require.NoError(t, os.Setenv(key, value))
@ -55,3 +61,138 @@ func patchEnvVariable(t *testing.T, key, value string) func() {
require.NoError(t, os.Setenv(key, oldValue))
}
}
type fakeClient struct {
client.Client
pingFunc func() (types.Ping, error)
version string
negotiated bool
}
func (c *fakeClient) Ping(_ context.Context) (types.Ping, error) {
return c.pingFunc()
}
func (c *fakeClient) ClientVersion() string {
return c.version
}
func (c *fakeClient) NegotiateAPIVersionPing(types.Ping) {
c.negotiated = true
}
func TestInitializeFromClient(t *testing.T) {
defaultVersion := "v1.55"
var testcases = []struct {
doc string
pingFunc func() (types.Ping, error)
expectedServer ServerInfo
negotiated bool
}{
{
doc: "successful ping",
pingFunc: func() (types.Ping, error) {
return types.Ping{Experimental: true, OSType: "linux", APIVersion: "v1.30"}, nil
},
expectedServer: ServerInfo{HasExperimental: true, OSType: "linux"},
negotiated: true,
},
{
doc: "failed ping, no API version",
pingFunc: func() (types.Ping, error) {
return types.Ping{}, errors.New("failed")
},
expectedServer: ServerInfo{HasExperimental: true},
},
{
doc: "failed ping, with API version",
pingFunc: func() (types.Ping, error) {
return types.Ping{APIVersion: "v1.33"}, errors.New("failed")
},
expectedServer: ServerInfo{HasExperimental: true},
negotiated: true,
},
}
for _, testcase := range testcases {
t.Run(testcase.doc, func(t *testing.T) {
apiclient := &fakeClient{
pingFunc: testcase.pingFunc,
version: defaultVersion,
}
cli := &DockerCli{client: apiclient}
cli.initializeFromClient()
assert.Equal(t, defaultVersion, cli.defaultVersion)
assert.Equal(t, testcase.expectedServer, cli.server)
assert.Equal(t, testcase.negotiated, apiclient.negotiated)
})
}
}
func TestGetClientWithPassword(t *testing.T) {
expected := "password"
var testcases = []struct {
doc string
password string
retrieverErr error
retrieverGiveup bool
newClientErr error
expectedErr string
}{
{
doc: "successful connect",
password: expected,
},
{
doc: "password retriever exhausted",
retrieverGiveup: true,
retrieverErr: errors.New("failed"),
expectedErr: "private key is encrypted, but could not get passphrase",
},
{
doc: "password retriever error",
retrieverErr: errors.New("failed"),
expectedErr: "failed",
},
{
doc: "newClient error",
newClientErr: errors.New("failed to connect"),
expectedErr: "failed to connect",
},
}
for _, testcase := range testcases {
t.Run(testcase.doc, func(t *testing.T) {
passRetriever := func(_, _ string, _ bool, attempts int) (passphrase string, giveup bool, err error) {
// Always return an invalid pass first to test iteration
switch attempts {
case 0:
return "something else", false, nil
default:
return testcase.password, testcase.retrieverGiveup, testcase.retrieverErr
}
}
newClient := func(currentPassword string) (client.APIClient, error) {
if testcase.newClientErr != nil {
return nil, testcase.newClientErr
}
if currentPassword == expected {
return &client.Client{}, nil
}
return &client.Client{}, x509.IncorrectPasswordError
}
_, err := getClientWithPassword(passRetriever, newClient)
if testcase.expectedErr != "" {
testutil.ErrorContains(t, err, testcase.expectedErr)
return
}
assert.NoError(t, err)
})
}
}

View File

@ -17,6 +17,7 @@ import (
"github.com/docker/cli/cli/command/stack"
"github.com/docker/cli/cli/command/swarm"
"github.com/docker/cli/cli/command/system"
"github.com/docker/cli/cli/command/trust"
"github.com/docker/cli/cli/command/volume"
"github.com/spf13/cobra"
)
@ -69,6 +70,9 @@ func AddCommands(cmd *cobra.Command, dockerCli *command.DockerCli) {
// swarm
swarm.NewSwarmCommand(dockerCli),
// trust
trust.NewTrustCommand(dockerCli),
// volume
volume.NewVolumeCommand(dockerCli),

View File

@ -8,14 +8,13 @@ import (
)
// NewConfigCommand returns a cobra command for `config` subcommands
// nolint: interfacer
func NewConfigCommand(dockerCli *command.DockerCli) *cobra.Command {
func NewConfigCommand(dockerCli command.Cli) *cobra.Command {
cmd := &cobra.Command{
Use: "config",
Short: "Manage Docker configs",
Args: cli.NoArgs,
RunE: command.ShowHelp(dockerCli.Err()),
Tags: map[string]string{"version": "1.30"},
Use: "config",
Short: "Manage Docker configs",
Args: cli.NoArgs,
RunE: command.ShowHelp(dockerCli.Err()),
Annotations: map[string]string{"version": "1.30"},
}
cmd.AddCommand(
newConfigListCommand(dockerCli),

View File

@ -1,15 +1,27 @@
package config
import (
"sort"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/cli/command/formatter"
"github.com/docker/cli/opts"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/swarm"
"github.com/spf13/cobra"
"golang.org/x/net/context"
"vbom.ml/util/sortorder"
)
type byConfigName []swarm.Config
func (r byConfigName) Len() int { return len(r) }
func (r byConfigName) Swap(i, j int) { r[i], r[j] = r[j], r[i] }
func (r byConfigName) Less(i, j int) bool {
return sortorder.NaturalLess(r[i].Spec.Name, r[j].Spec.Name)
}
type listOptions struct {
quiet bool
format string
@ -55,6 +67,8 @@ func runConfigList(dockerCli command.Cli, options listOptions) error {
}
}
sort.Sort(byConfigName(configs))
configCtx := formatter.Context{
Output: dockerCli.Out(),
Format: formatter.NewConfigFormat(format, options.quiet),

View File

@ -50,14 +50,20 @@ func TestConfigList(t *testing.T) {
cli := test.NewFakeCli(&fakeClient{
configListFunc: func(options types.ConfigListOptions) ([]swarm.Config, error) {
return []swarm.Config{
*Config(ConfigID("ID-foo"),
ConfigName("foo"),
*Config(ConfigID("ID-1-foo"),
ConfigName("1-foo"),
ConfigVersion(swarm.Version{Index: 10}),
ConfigCreatedAt(time.Now().Add(-2*time.Hour)),
ConfigUpdatedAt(time.Now().Add(-1*time.Hour)),
),
*Config(ConfigID("ID-bar"),
ConfigName("bar"),
*Config(ConfigID("ID-10-foo"),
ConfigName("10-foo"),
ConfigVersion(swarm.Version{Index: 11}),
ConfigCreatedAt(time.Now().Add(-2*time.Hour)),
ConfigUpdatedAt(time.Now().Add(-1*time.Hour)),
),
*Config(ConfigID("ID-2-foo"),
ConfigName("2-foo"),
ConfigVersion(swarm.Version{Index: 11}),
ConfigCreatedAt(time.Now().Add(-2*time.Hour)),
ConfigUpdatedAt(time.Now().Add(-1*time.Hour)),
@ -66,9 +72,8 @@ func TestConfigList(t *testing.T) {
},
})
cmd := newConfigListCommand(cli)
cmd.SetOutput(cli.OutBuffer())
assert.NoError(t, cmd.Execute())
golden.Assert(t, cli.OutBuffer().String(), "config-list.golden")
golden.Assert(t, cli.OutBuffer().String(), "config-list-sort.golden")
}
func TestConfigListWithQuietOption(t *testing.T) {

View File

@ -0,0 +1,4 @@
ID NAME CREATED UPDATED
ID-1-foo 1-foo 2 hours ago About an hour ago
ID-2-foo 2-foo 2 hours ago About an hour ago
ID-10-foo 10-foo 2 hours ago About an hour ago

View File

@ -1,2 +1,2 @@
foo
bar label=label-bar
foo

View File

@ -1,3 +1,3 @@
ID NAME CREATED UPDATED
ID-foo foo 2 hours ago About an hour ago
ID-bar bar 2 hours ago About an hour ago
ID-foo foo 2 hours ago About an hour ago

View File

@ -1,2 +1,2 @@
foo
bar label=label-bar
foo

View File

@ -1,2 +1,2 @@
ID-foo
ID-bar
ID-foo

View File

@ -1,3 +0,0 @@
ID NAME CREATED UPDATED
ID-foo foo 2 hours ago About an hour ago
ID-bar bar 2 hours ago About an hour ago

View File

@ -4,13 +4,13 @@ import (
"io"
"net/http/httputil"
"github.com/Sirupsen/logrus"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/docker/api/types"
"github.com/docker/docker/client"
"github.com/docker/docker/pkg/signal"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"golang.org/x/net/context"
)

View File

@ -12,12 +12,15 @@ import (
type fakeClient struct {
client.Client
inspectFunc func(string) (types.ContainerJSON, error)
execInspectFunc func(execID string) (types.ContainerExecInspect, error)
execCreateFunc func(container string, config types.ExecConfig) (types.IDResponse, error)
createContainerFunc func(config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, containerName string) (container.ContainerCreateCreatedBody, error)
imageCreateFunc func(parentReference string, options types.ImageCreateOptions) (io.ReadCloser, error)
infoFunc func() (types.Info, error)
inspectFunc func(string) (types.ContainerJSON, error)
execInspectFunc func(execID string) (types.ContainerExecInspect, error)
execCreateFunc func(container string, config types.ExecConfig) (types.IDResponse, error)
createContainerFunc func(config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, containerName string) (container.ContainerCreateCreatedBody, error)
imageCreateFunc func(parentReference string, options types.ImageCreateOptions) (io.ReadCloser, error)
infoFunc func() (types.Info, error)
containerStatPathFunc func(container, path string) (types.ContainerPathStat, error)
containerCopyFromFunc func(container, srcPath string) (io.ReadCloser, types.ContainerPathStat, error)
logFunc func(string, types.ContainerLogsOptions) (io.ReadCloser, error)
}
func (f *fakeClient) ContainerInspect(_ context.Context, containerID string) (types.ContainerJSON, error) {
@ -71,3 +74,24 @@ func (f *fakeClient) Info(_ context.Context) (types.Info, error) {
}
return types.Info{}, nil
}
func (f *fakeClient) ContainerStatPath(_ context.Context, container, path string) (types.ContainerPathStat, error) {
if f.containerStatPathFunc != nil {
return f.containerStatPathFunc(container, path)
}
return types.ContainerPathStat{}, nil
}
func (f *fakeClient) CopyFromContainer(_ context.Context, container, srcPath string) (io.ReadCloser, types.ContainerPathStat, error) {
if f.containerCopyFromFunc != nil {
return f.containerCopyFromFunc(container, srcPath)
}
return nil, types.ContainerPathStat{}, nil
}
func (f *fakeClient) ContainerLogs(_ context.Context, container string, options types.ContainerLogsOptions) (io.ReadCloser, error) {
if f.logFunc != nil {
return f.logFunc(container, options)
}
return nil, nil
}

View File

@ -7,8 +7,7 @@ import (
)
// NewContainerCommand returns a cobra command for `container` subcommands
// nolint: interfacer
func NewContainerCommand(dockerCli *command.DockerCli) *cobra.Command {
func NewContainerCommand(dockerCli command.Cli) *cobra.Command {
cmd := &cobra.Command{
Use: "container",
Short: "Manage containers",

View File

@ -22,7 +22,7 @@ type commitOptions struct {
}
// NewCommitCommand creates a new cobra.Command for `docker commit`
func NewCommitCommand(dockerCli *command.DockerCli) *cobra.Command {
func NewCommitCommand(dockerCli command.Cli) *cobra.Command {
var options commitOptions
cmd := &cobra.Command{
@ -51,7 +51,7 @@ func NewCommitCommand(dockerCli *command.DockerCli) *cobra.Command {
return cmd
}
func runCommit(dockerCli *command.DockerCli, options *commitOptions) error {
func runCommit(dockerCli command.Cli, options *commitOptions) error {
ctx := context.Background()
name := options.container

View File

@ -26,17 +26,21 @@ type copyOptions struct {
type copyDirection int
const (
fromContainer copyDirection = (1 << iota)
fromContainer copyDirection = 1 << iota
toContainer
acrossContainers = fromContainer | toContainer
)
type cpConfig struct {
followLink bool
copyUIDGID bool
sourcePath string
destPath string
container string
}
// NewCopyCommand creates a new `docker cp` command
func NewCopyCommand(dockerCli *command.DockerCli) *cobra.Command {
func NewCopyCommand(dockerCli command.Cli) *cobra.Command {
var opts copyOptions
cmd := &cobra.Command{
@ -65,58 +69,57 @@ func NewCopyCommand(dockerCli *command.DockerCli) *cobra.Command {
}
flags := cmd.Flags()
flags.BoolVarP(&opts.followLink, "follow-link", "L", false, "Always follow symbol link in SRC_PATH")
flags.BoolVarP(&opts.copyUIDGID, "archive", "a", false, "Archive mode (copy all uid/gid information)")
return cmd
}
func runCopy(dockerCli *command.DockerCli, opts copyOptions) error {
func runCopy(dockerCli command.Cli, opts copyOptions) error {
srcContainer, srcPath := splitCpArg(opts.source)
dstContainer, dstPath := splitCpArg(opts.destination)
destContainer, destPath := splitCpArg(opts.destination)
copyConfig := cpConfig{
followLink: opts.followLink,
copyUIDGID: opts.copyUIDGID,
sourcePath: srcPath,
destPath: destPath,
}
var direction copyDirection
if srcContainer != "" {
direction |= fromContainer
copyConfig.container = srcContainer
}
if dstContainer != "" {
if destContainer != "" {
direction |= toContainer
}
cpParam := &cpConfig{
followLink: opts.followLink,
copyConfig.container = destContainer
}
ctx := context.Background()
switch direction {
case fromContainer:
return copyFromContainer(ctx, dockerCli, srcContainer, srcPath, dstPath, cpParam)
return copyFromContainer(ctx, dockerCli, copyConfig)
case toContainer:
return copyToContainer(ctx, dockerCli, srcPath, dstContainer, dstPath, cpParam, opts.copyUIDGID)
return copyToContainer(ctx, dockerCli, copyConfig)
case acrossContainers:
// Copying between containers isn't supported.
return errors.New("copying between containers is not supported")
default:
// User didn't specify any container.
return errors.New("must specify at least one container source")
}
}
func statContainerPath(ctx context.Context, dockerCli *command.DockerCli, containerName, path string) (types.ContainerPathStat, error) {
return dockerCli.Client().ContainerStatPath(ctx, containerName, path)
}
func resolveLocalPath(localPath string) (absPath string, err error) {
if absPath, err = filepath.Abs(localPath); err != nil {
return
}
return archive.PreserveTrailingDotOrSeparator(absPath, localPath), nil
return archive.PreserveTrailingDotOrSeparator(absPath, localPath, filepath.Separator), nil
}
func copyFromContainer(ctx context.Context, dockerCli *command.DockerCli, srcContainer, srcPath, dstPath string, cpParam *cpConfig) (err error) {
func copyFromContainer(ctx context.Context, dockerCli command.Cli, copyConfig cpConfig) (err error) {
dstPath := copyConfig.destPath
srcPath := copyConfig.sourcePath
if dstPath != "-" {
// Get an absolute destination path.
dstPath, err = resolveLocalPath(dstPath)
@ -125,10 +128,11 @@ func copyFromContainer(ctx context.Context, dockerCli *command.DockerCli, srcCon
}
}
client := dockerCli.Client()
// if client requests to follow symbol link, then must decide target file to be copied
var rebaseName string
if cpParam.followLink {
srcStat, err := statContainerPath(ctx, dockerCli, srcContainer, srcPath)
if copyConfig.followLink {
srcStat, err := client.ContainerStatPath(ctx, copyConfig.container, srcPath)
// If the destination is a symbolic link, we should follow it.
if err == nil && srcStat.Mode&os.ModeSymlink != 0 {
@ -145,20 +149,17 @@ func copyFromContainer(ctx context.Context, dockerCli *command.DockerCli, srcCon
}
content, stat, err := dockerCli.Client().CopyFromContainer(ctx, srcContainer, srcPath)
content, stat, err := client.CopyFromContainer(ctx, copyConfig.container, srcPath)
if err != nil {
return err
}
defer content.Close()
if dstPath == "-" {
// Send the response to STDOUT.
_, err = io.Copy(os.Stdout, content)
_, err = io.Copy(dockerCli.Out(), content)
return err
}
// Prepare source copy info.
srcInfo := archive.CopyInfo{
Path: srcPath,
Exists: true,
@ -171,13 +172,17 @@ func copyFromContainer(ctx context.Context, dockerCli *command.DockerCli, srcCon
_, srcBase := archive.SplitPathDirEntry(srcInfo.Path)
preArchive = archive.RebaseArchiveEntries(content, srcBase, srcInfo.RebaseName)
}
// See comments in the implementation of `archive.CopyTo` for exactly what
// goes into deciding how and whether the source archive needs to be
// altered for the correct copy behavior.
return archive.CopyTo(preArchive, srcInfo, dstPath)
}
func copyToContainer(ctx context.Context, dockerCli *command.DockerCli, srcPath, dstContainer, dstPath string, cpParam *cpConfig, copyUIDGID bool) (err error) {
// In order to get the copy behavior right, we need to know information
// about both the source and destination. The API is a simple tar
// archive/extract API but we can use the stat info header about the
// destination to be more informed about exactly what the destination is.
func copyToContainer(ctx context.Context, dockerCli command.Cli, copyConfig cpConfig) (err error) {
srcPath := copyConfig.sourcePath
dstPath := copyConfig.destPath
if srcPath != "-" {
// Get an absolute source path.
srcPath, err = resolveLocalPath(srcPath)
@ -186,14 +191,10 @@ func copyToContainer(ctx context.Context, dockerCli *command.DockerCli, srcPath,
}
}
// In order to get the copy behavior right, we need to know information
// about both the source and destination. The API is a simple tar
// archive/extract API but we can use the stat info header about the
// destination to be more informed about exactly what the destination is.
client := dockerCli.Client()
// Prepare destination copy info by stat-ing the container path.
dstInfo := archive.CopyInfo{Path: dstPath}
dstStat, err := statContainerPath(ctx, dockerCli, dstContainer, dstPath)
dstStat, err := client.ContainerStatPath(ctx, copyConfig.container, dstPath)
// If the destination is a symbolic link, we should evaluate it.
if err == nil && dstStat.Mode&os.ModeSymlink != 0 {
@ -205,7 +206,7 @@ func copyToContainer(ctx context.Context, dockerCli *command.DockerCli, srcPath,
}
dstInfo.Path = linkTarget
dstStat, err = statContainerPath(ctx, dockerCli, dstContainer, linkTarget)
dstStat, err = client.ContainerStatPath(ctx, copyConfig.container, linkTarget)
}
// Ignore any error and assume that the parent directory of the destination
@ -224,15 +225,14 @@ func copyToContainer(ctx context.Context, dockerCli *command.DockerCli, srcPath,
)
if srcPath == "-" {
// Use STDIN.
content = os.Stdin
resolvedDstPath = dstInfo.Path
if !dstInfo.IsDir {
return errors.Errorf("destination \"%s:%s\" must be a directory", dstContainer, dstPath)
return errors.Errorf("destination \"%s:%s\" must be a directory", copyConfig.container, dstPath)
}
} else {
// Prepare source copy info.
srcInfo, err := archive.CopyInfoSourcePath(srcPath, cpParam.followLink)
srcInfo, err := archive.CopyInfoSourcePath(srcPath, copyConfig.followLink)
if err != nil {
return err
}
@ -267,10 +267,9 @@ func copyToContainer(ctx context.Context, dockerCli *command.DockerCli, srcPath,
options := types.CopyToContainerOptions{
AllowOverwriteDirWithFile: false,
CopyUIDGID: copyUIDGID,
CopyUIDGID: copyConfig.copyUIDGID,
}
return dockerCli.Client().CopyToContainer(ctx, dstContainer, resolvedDstPath, content, options)
return client.CopyToContainer(ctx, copyConfig.container, resolvedDstPath, content, options)
}
// We use `:` as a delimiter between CONTAINER and PATH, but `:` could also be

View File

@ -0,0 +1,160 @@
package container
import (
"io"
"io/ioutil"
"runtime"
"strings"
"testing"
"github.com/docker/cli/internal/test"
"github.com/docker/cli/internal/test/testutil"
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/archive"
"github.com/gotestyourself/gotestyourself/fs"
"github.com/gotestyourself/gotestyourself/skip"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestRunCopyWithInvalidArguments(t *testing.T) {
var testcases = []struct {
doc string
options copyOptions
expectedErr string
}{
{
doc: "copy between container",
options: copyOptions{
source: "first:/path",
destination: "second:/path",
},
expectedErr: "copying between containers is not supported",
},
{
doc: "copy without a container",
options: copyOptions{
source: "./source",
destination: "./dest",
},
expectedErr: "must specify at least one container source",
},
}
for _, testcase := range testcases {
t.Run(testcase.doc, func(t *testing.T) {
err := runCopy(test.NewFakeCli(nil), testcase.options)
assert.EqualError(t, err, testcase.expectedErr)
})
}
}
func TestRunCopyFromContainerToStdout(t *testing.T) {
tarContent := "the tar content"
fakeClient := &fakeClient{
containerCopyFromFunc: func(container, srcPath string) (io.ReadCloser, types.ContainerPathStat, error) {
assert.Equal(t, "container", container)
return ioutil.NopCloser(strings.NewReader(tarContent)), types.ContainerPathStat{}, nil
},
}
options := copyOptions{source: "container:/path", destination: "-"}
cli := test.NewFakeCli(fakeClient)
err := runCopy(cli, options)
require.NoError(t, err)
assert.Equal(t, tarContent, cli.OutBuffer().String())
assert.Equal(t, "", cli.ErrBuffer().String())
}
func TestRunCopyFromContainerToFilesystem(t *testing.T) {
destDir := fs.NewDir(t, "cp-test",
fs.WithFile("file1", "content\n"))
defer destDir.Remove()
fakeClient := &fakeClient{
containerCopyFromFunc: func(container, srcPath string) (io.ReadCloser, types.ContainerPathStat, error) {
assert.Equal(t, "container", container)
readCloser, err := archive.TarWithOptions(destDir.Path(), &archive.TarOptions{})
return readCloser, types.ContainerPathStat{}, err
},
}
options := copyOptions{source: "container:/path", destination: destDir.Path()}
cli := test.NewFakeCli(fakeClient)
err := runCopy(cli, options)
require.NoError(t, err)
assert.Equal(t, "", cli.OutBuffer().String())
assert.Equal(t, "", cli.ErrBuffer().String())
content, err := ioutil.ReadFile(destDir.Join("file1"))
require.NoError(t, err)
assert.Equal(t, "content\n", string(content))
}
func TestRunCopyFromContainerToFilesystemMissingDestinationDirectory(t *testing.T) {
destDir := fs.NewDir(t, "cp-test",
fs.WithFile("file1", "content\n"))
defer destDir.Remove()
fakeClient := &fakeClient{
containerCopyFromFunc: func(container, srcPath string) (io.ReadCloser, types.ContainerPathStat, error) {
assert.Equal(t, "container", container)
readCloser, err := archive.TarWithOptions(destDir.Path(), &archive.TarOptions{})
return readCloser, types.ContainerPathStat{}, err
},
}
options := copyOptions{
source: "container:/path",
destination: destDir.Join("missing", "foo"),
}
cli := test.NewFakeCli(fakeClient)
err := runCopy(cli, options)
testutil.ErrorContains(t, err, destDir.Join("missing"))
}
func TestSplitCpArg(t *testing.T) {
var testcases = []struct {
doc string
path string
os string
expectedContainer string
expectedPath string
}{
{
doc: "absolute path with colon",
os: "linux",
path: "/abs/path:withcolon",
expectedPath: "/abs/path:withcolon",
},
{
doc: "relative path with colon",
path: "./relative:path",
expectedPath: "./relative:path",
},
{
doc: "absolute path with drive",
os: "windows",
path: `d:\abs\path`,
expectedPath: `d:\abs\path`,
},
{
doc: "no separator",
path: "relative/path",
expectedPath: "relative/path",
},
{
doc: "with separator",
path: "container:/opt/foo",
expectedPath: "/opt/foo",
expectedContainer: "container",
},
}
for _, testcase := range testcases {
t.Run(testcase.doc, func(t *testing.T) {
skip.IfCondition(t, testcase.os != "" && testcase.os != runtime.GOOS)
container, path := splitCpArg(testcase.path)
assert.Equal(t, testcase.expectedContainer, container)
assert.Equal(t, testcase.expectedPath, path)
})
}
}

View File

@ -21,7 +21,8 @@ import (
)
type createOptions struct {
name string
name string
platform string
}
// NewCreateCommand creates a new cobra.Command for `docker create`
@ -51,6 +52,7 @@ func NewCreateCommand(dockerCli command.Cli) *cobra.Command {
// with hostname
flags.Bool("help", false, "Print usage")
command.AddPlatformFlag(flags, &opts.platform)
command.AddTrustVerificationFlags(flags)
copts = addFlags(flags)
return cmd
@ -62,7 +64,7 @@ func runCreate(dockerCli command.Cli, flags *pflag.FlagSet, opts *createOptions,
reportError(dockerCli.Err(), "create", err.Error(), true)
return cli.StatusError{StatusCode: 125}
}
response, err := createContainer(context.Background(), dockerCli, containerConfig, opts.name)
response, err := createContainer(context.Background(), dockerCli, containerConfig, opts.name, opts.platform)
if err != nil {
return err
}
@ -70,7 +72,7 @@ func runCreate(dockerCli command.Cli, flags *pflag.FlagSet, opts *createOptions,
return nil
}
func pullImage(ctx context.Context, dockerCli command.Cli, image string, out io.Writer) error {
func pullImage(ctx context.Context, dockerCli command.Cli, image string, platform string, out io.Writer) error {
ref, err := reference.ParseNormalizedNamed(image)
if err != nil {
return err
@ -90,6 +92,7 @@ func pullImage(ctx context.Context, dockerCli command.Cli, image string, out io.
options := types.ImageCreateOptions{
RegistryAuth: encodedAuth,
Platform: platform,
}
responseBody, err := dockerCli.Client().ImageCreate(ctx, image, options)
@ -155,7 +158,7 @@ func newCIDFile(path string) (*cidFile, error) {
return &cidFile{path: path, file: f}, nil
}
func createContainer(ctx context.Context, dockerCli command.Cli, containerConfig *containerConfig, name string) (*container.ContainerCreateCreatedBody, error) {
func createContainer(ctx context.Context, dockerCli command.Cli, containerConfig *containerConfig, name string, platform string) (*container.ContainerCreateCreatedBody, error) {
config := containerConfig.Config
hostConfig := containerConfig.HostConfig
networkingConfig := containerConfig.NetworkingConfig
@ -194,11 +197,11 @@ func createContainer(ctx context.Context, dockerCli command.Cli, containerConfig
//if image not found try to pull it
if err != nil {
if apiclient.IsErrImageNotFound(err) && namedRef != nil {
if apiclient.IsErrNotFound(err) && namedRef != nil {
fmt.Fprintf(stderr, "Unable to find image '%s' locally\n", reference.FamiliarString(namedRef))
// we don't want to write to stdout anything apart from container.ID
if err := pullImage(ctx, dockerCli, config.Image, stderr); err != nil {
if err := pullImage(ctx, dockerCli, config.Image, platform, stderr); err != nil {
return nil, err
}
if taggedRef, ok := namedRef.(reference.NamedTagged); ok && trustedRef != nil {

View File

@ -5,6 +5,7 @@ import (
"io"
"io/ioutil"
"os"
"runtime"
"strings"
"testing"
@ -106,7 +107,7 @@ func TestCreateContainerPullsImageIfMissing(t *testing.T) {
},
HostConfig: &container.HostConfig{},
}
body, err := createContainer(context.Background(), cli, config, "name")
body, err := createContainer(context.Background(), cli, config, "name", runtime.GOOS)
require.NoError(t, err)
expected := container.ContainerCreateCreatedBody{ID: containerID}
assert.Equal(t, expected, *body)

View File

@ -14,7 +14,7 @@ type diffOptions struct {
}
// NewDiffCommand creates a new cobra.Command for `docker diff`
func NewDiffCommand(dockerCli *command.DockerCli) *cobra.Command {
func NewDiffCommand(dockerCli command.Cli) *cobra.Command {
var opts diffOptions
return &cobra.Command{
@ -28,7 +28,7 @@ func NewDiffCommand(dockerCli *command.DockerCli) *cobra.Command {
}
}
func runDiff(dockerCli *command.DockerCli, opts *diffOptions) error {
func runDiff(dockerCli command.Cli, opts *diffOptions) error {
if opts.container == "" {
return errors.New("Container name cannot be empty")
}

View File

@ -4,15 +4,14 @@ import (
"fmt"
"io"
"github.com/Sirupsen/logrus"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/cli/config/configfile"
"github.com/docker/cli/opts"
"github.com/docker/docker/api/types"
apiclient "github.com/docker/docker/client"
"github.com/docker/docker/pkg/promise"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"golang.org/x/net/context"
)
@ -25,6 +24,7 @@ type execOptions struct {
user string
privileged bool
env opts.ListOpts
workdir string
container string
command []string
}
@ -59,6 +59,8 @@ func NewExecCommand(dockerCli command.Cli) *cobra.Command {
flags.BoolVarP(&options.privileged, "privileged", "", false, "Give extended privileges to the command")
flags.VarP(&options.env, "env", "e", "Set environment variables")
flags.SetAnnotation("env", "version", []string{"1.25"})
flags.StringVarP(&options.workdir, "workdir", "w", "", "Working directory inside the container")
flags.SetAnnotation("workdir", "version", []string{"1.35"})
return cmd
}
@ -106,7 +108,6 @@ func interactiveExec(ctx context.Context, dockerCli command.Cli, execConfig *typ
var (
out, stderr io.Writer
in io.ReadCloser
errCh chan error
)
if execConfig.AttachStdin {
@ -124,24 +125,33 @@ func interactiveExec(ctx context.Context, dockerCli command.Cli, execConfig *typ
}
client := dockerCli.Client()
resp, err := client.ContainerExecAttach(ctx, execID, *execConfig)
execStartCheck := types.ExecStartCheck{
Tty: execConfig.Tty,
}
resp, err := client.ContainerExecAttach(ctx, execID, execStartCheck)
if err != nil {
return err
}
defer resp.Close()
errCh = promise.Go(func() error {
streamer := hijackedIOStreamer{
streams: dockerCli,
inputStream: in,
outputStream: out,
errorStream: stderr,
resp: resp,
tty: execConfig.Tty,
detachKeys: execConfig.DetachKeys,
}
return streamer.stream(ctx)
})
errCh := make(chan error, 1)
go func() {
defer close(errCh)
errCh <- func() error {
streamer := hijackedIOStreamer{
streams: dockerCli,
inputStream: in,
outputStream: out,
errorStream: stderr,
resp: resp,
tty: execConfig.Tty,
detachKeys: execConfig.DetachKeys,
}
return streamer.stream(ctx)
}()
}()
if execConfig.Tty && dockerCli.In().IsTerminal() {
if err := MonitorTtySize(ctx, dockerCli, execID, true); err != nil {
@ -183,6 +193,7 @@ func parseExec(opts execOptions, configFile *configfile.ConfigFile) *types.ExecC
Cmd: opts.command,
Detach: opts.detach,
Env: opts.env.GetAll(),
WorkingDir: opts.workdir,
}
// If -d is not set, attach to everything by default

View File

@ -16,7 +16,7 @@ type exportOptions struct {
}
// NewExportCommand creates a new `docker export` command
func NewExportCommand(dockerCli *command.DockerCli) *cobra.Command {
func NewExportCommand(dockerCli command.Cli) *cobra.Command {
var opts exportOptions
cmd := &cobra.Command{
@ -36,7 +36,7 @@ func NewExportCommand(dockerCli *command.DockerCli) *cobra.Command {
return cmd
}
func runExport(dockerCli *command.DockerCli, opts exportOptions) error {
func runExport(dockerCli command.Cli, opts exportOptions) error {
if opts.output == "" && dockerCli.Out().IsTerminal() {
return errors.New("cowardly refusing to save to a terminal. Use the -o flag or redirect")
}

View File

@ -6,12 +6,12 @@ import (
"runtime"
"sync"
"github.com/Sirupsen/logrus"
"github.com/docker/cli/cli/command"
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/ioutils"
"github.com/docker/docker/pkg/stdcopy"
"github.com/docker/docker/pkg/term"
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
)
@ -185,6 +185,7 @@ func setRawTerminal(streams command.Streams) error {
return streams.Out().SetRawTerminal()
}
// nolint: unparam
func restoreTerminal(streams command.Streams, in io.Closer) error {
streams.In().RestoreTerminal()
streams.Out().RestoreTerminal()

View File

@ -15,7 +15,7 @@ type inspectOptions struct {
}
// newInspectCommand creates a new cobra.Command for `docker container inspect`
func newInspectCommand(dockerCli *command.DockerCli) *cobra.Command {
func newInspectCommand(dockerCli command.Cli) *cobra.Command {
var opts inspectOptions
cmd := &cobra.Command{
@ -35,7 +35,7 @@ func newInspectCommand(dockerCli *command.DockerCli) *cobra.Command {
return cmd
}
func runInspect(dockerCli *command.DockerCli, opts inspectOptions) error {
func runInspect(dockerCli command.Cli, opts inspectOptions) error {
client := dockerCli.Client()
ctx := context.Background()

View File

@ -18,7 +18,7 @@ type killOptions struct {
}
// NewKillCommand creates a new cobra.Command for `docker kill`
func NewKillCommand(dockerCli *command.DockerCli) *cobra.Command {
func NewKillCommand(dockerCli command.Cli) *cobra.Command {
var opts killOptions
cmd := &cobra.Command{
@ -36,7 +36,7 @@ func NewKillCommand(dockerCli *command.DockerCli) *cobra.Command {
return cmd
}
func runKill(dockerCli *command.DockerCli, opts *killOptions) error {
func runKill(dockerCli command.Cli, opts *killOptions) error {
var errs []string
ctx := context.Background()
errChan := parallelOperation(ctx, opts.containers, func(ctx context.Context, container string) error {

View File

@ -25,7 +25,7 @@ type psOptions struct {
}
// NewPsCommand creates a new cobra.Command for `docker ps`
func NewPsCommand(dockerCli *command.DockerCli) *cobra.Command {
func NewPsCommand(dockerCli command.Cli) *cobra.Command {
options := psOptions{filter: opts.NewFilterOpt()}
cmd := &cobra.Command{
@ -51,7 +51,7 @@ func NewPsCommand(dockerCli *command.DockerCli) *cobra.Command {
return cmd
}
func newListCommand(dockerCli *command.DockerCli) *cobra.Command {
func newListCommand(dockerCli command.Cli) *cobra.Command {
cmd := *NewPsCommand(dockerCli)
cmd.Aliases = []string{"ps", "list"}
cmd.Use = "ls [OPTIONS]"
@ -109,7 +109,7 @@ func buildContainerListOptions(opts *psOptions) (*types.ContainerListOptions, er
return options, nil
}
func runPs(dockerCli *command.DockerCli, options *psOptions) error {
func runPs(dockerCli command.Cli, options *psOptions) error {
ctx := context.Background()
listOptions, err := buildContainerListOptions(options)

View File

@ -14,6 +14,7 @@ import (
type logsOptions struct {
follow bool
since string
until string
timestamps bool
details bool
tail string
@ -22,7 +23,7 @@ type logsOptions struct {
}
// NewLogsCommand creates a new cobra.Command for `docker logs`
func NewLogsCommand(dockerCli *command.DockerCli) *cobra.Command {
func NewLogsCommand(dockerCli command.Cli) *cobra.Command {
var opts logsOptions
cmd := &cobra.Command{
@ -38,19 +39,22 @@ func NewLogsCommand(dockerCli *command.DockerCli) *cobra.Command {
flags := cmd.Flags()
flags.BoolVarP(&opts.follow, "follow", "f", false, "Follow log output")
flags.StringVar(&opts.since, "since", "", "Show logs since timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes)")
flags.StringVar(&opts.until, "until", "", "Show logs before a timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes)")
flags.SetAnnotation("until", "version", []string{"1.35"})
flags.BoolVarP(&opts.timestamps, "timestamps", "t", false, "Show timestamps")
flags.BoolVar(&opts.details, "details", false, "Show extra details provided to logs")
flags.StringVar(&opts.tail, "tail", "all", "Number of lines to show from the end of the logs")
return cmd
}
func runLogs(dockerCli *command.DockerCli, opts *logsOptions) error {
func runLogs(dockerCli command.Cli, opts *logsOptions) error {
ctx := context.Background()
options := types.ContainerLogsOptions{
ShowStdout: true,
ShowStderr: true,
Since: opts.since,
Until: opts.until,
Timestamps: opts.timestamps,
Follow: opts.follow,
Tail: opts.tail,

View File

@ -0,0 +1,62 @@
package container
import (
"io"
"io/ioutil"
"strings"
"testing"
"github.com/docker/cli/internal/test"
"github.com/docker/cli/internal/test/testutil"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/stretchr/testify/assert"
)
var logFn = func(expectedOut string) func(string, types.ContainerLogsOptions) (io.ReadCloser, error) {
return func(container string, opts types.ContainerLogsOptions) (io.ReadCloser, error) {
return ioutil.NopCloser(strings.NewReader(expectedOut)), nil
}
}
func TestRunLogs(t *testing.T) {
inspectFn := func(containerID string) (types.ContainerJSON, error) {
return types.ContainerJSON{
Config: &container.Config{Tty: true},
ContainerJSONBase: &types.ContainerJSONBase{State: &types.ContainerState{Running: false}},
}, nil
}
var testcases = []struct {
doc string
options *logsOptions
client fakeClient
expectedError string
expectedOut string
expectedErr string
}{
{
doc: "successful logs",
expectedOut: "foo",
options: &logsOptions{},
client: fakeClient{logFunc: logFn("foo"), inspectFunc: inspectFn},
},
}
for _, testcase := range testcases {
t.Run(testcase.doc, func(t *testing.T) {
cli := test.NewFakeCli(&testcase.client)
err := runLogs(cli, testcase.options)
if testcase.expectedError != "" {
testutil.ErrorContains(t, err, testcase.expectedError)
} else {
if !assert.NoError(t, err) {
return
}
}
assert.Equal(t, testcase.expectedOut, cli.OutBuffer().String())
assert.Equal(t, testcase.expectedErr, cli.ErrBuffer().String())
})
}
}

View File

@ -11,7 +11,6 @@ import (
"strings"
"time"
"github.com/Sirupsen/logrus"
"github.com/docker/cli/cli/compose/loader"
"github.com/docker/cli/opts"
"github.com/docker/docker/api/types/container"
@ -20,6 +19,7 @@ import (
"github.com/docker/docker/pkg/signal"
"github.com/docker/go-connections/nat"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/pflag"
)

View File

@ -43,11 +43,9 @@ func TestValidateAttach(t *testing.T) {
}
}
// nolint: unparam
func parseRun(args []string) (*container.Config, *container.HostConfig, *networktypes.NetworkingConfig, error) {
flags := pflag.NewFlagSet("run", pflag.ContinueOnError)
flags.SetOutput(ioutil.Discard)
flags.Usage = nil
copts := addFlags(flags)
flags, copts := setupRunFlags()
if err := flags.Parse(args); err != nil {
return nil, nil, nil, err
}
@ -59,6 +57,14 @@ func parseRun(args []string) (*container.Config, *container.HostConfig, *network
return containerConfig.Config, containerConfig.HostConfig, containerConfig.NetworkingConfig, err
}
func setupRunFlags() (*pflag.FlagSet, *containerOptions) {
flags := pflag.NewFlagSet("run", pflag.ContinueOnError)
flags.SetOutput(ioutil.Discard)
flags.Usage = nil
copts := addFlags(flags)
return flags, copts
}
func parseMustError(t *testing.T, args string) {
_, _, _, err := parseRun(strings.Split(args+" ubuntu bash", " "))
assert.Error(t, err, args)
@ -226,20 +232,21 @@ func TestParseWithMacAddress(t *testing.T) {
}
}
func TestParseWithMemory(t *testing.T) {
invalidMemory := "--memory=invalid"
_, _, _, err := parseRun([]string{invalidMemory, "img", "cmd"})
testutil.ErrorContains(t, err, invalidMemory)
func TestRunFlagsParseWithMemory(t *testing.T) {
flags, _ := setupRunFlags()
args := []string{"--memory=invalid", "img", "cmd"}
err := flags.Parse(args)
testutil.ErrorContains(t, err, `invalid argument "invalid" for "-m, --memory" flag`)
_, hostconfig := mustParse(t, "--memory=1G")
assert.Equal(t, int64(1073741824), hostconfig.Memory)
}
func TestParseWithMemorySwap(t *testing.T) {
invalidMemory := "--memory-swap=invalid"
_, _, _, err := parseRun([]string{invalidMemory, "img", "cmd"})
testutil.ErrorContains(t, err, invalidMemory)
flags, _ := setupRunFlags()
args := []string{"--memory-swap=invalid", "img", "cmd"}
err := flags.Parse(args)
testutil.ErrorContains(t, err, `invalid argument "invalid" for "--memory-swap" flag`)
_, hostconfig := mustParse(t, "--memory-swap=1G")
assert.Equal(t, int64(1073741824), hostconfig.MemorySwap)
@ -364,7 +371,10 @@ func TestParseDevice(t *testing.T) {
func TestParseModes(t *testing.T) {
// pid ko
_, _, _, err := parseRun([]string{"--pid=container:", "img", "cmd"})
flags, copts := setupRunFlags()
args := []string{"--pid=container:", "img", "cmd"}
require.NoError(t, flags.Parse(args))
_, err := parse(flags, copts)
testutil.ErrorContains(t, err, "--pid: invalid PID mode")
// pid ok
@ -384,14 +394,18 @@ func TestParseModes(t *testing.T) {
if !hostconfig.UTSMode.Valid() {
t.Fatalf("Expected a valid UTSMode, got %v", hostconfig.UTSMode)
}
}
func TestRunFlagsParseShmSize(t *testing.T) {
// shm-size ko
expectedErr := `invalid argument "a128m" for --shm-size=a128m: invalid size: 'a128m'`
_, _, _, err = parseRun([]string{"--shm-size=a128m", "img", "cmd"})
flags, _ := setupRunFlags()
args := []string{"--shm-size=a128m", "img", "cmd"}
expectedErr := `invalid argument "a128m" for "--shm-size" flag: invalid size: 'a128m'`
err := flags.Parse(args)
testutil.ErrorContains(t, err, expectedErr)
// shm-size ok
_, hostconfig, _, err = parseRun([]string{"--shm-size=128m", "img", "cmd"})
_, hostconfig, _, err := parseRun([]string{"--shm-size=128m", "img", "cmd"})
require.NoError(t, err)
if hostconfig.ShmSize != 134217728 {
t.Fatalf("Expected a valid ShmSize, got %d", hostconfig.ShmSize)

View File

@ -16,7 +16,7 @@ type pauseOptions struct {
}
// NewPauseCommand creates a new cobra.Command for `docker pause`
func NewPauseCommand(dockerCli *command.DockerCli) *cobra.Command {
func NewPauseCommand(dockerCli command.Cli) *cobra.Command {
var opts pauseOptions
return &cobra.Command{
@ -30,7 +30,7 @@ func NewPauseCommand(dockerCli *command.DockerCli) *cobra.Command {
}
}
func runPause(dockerCli *command.DockerCli, opts *pauseOptions) error {
func runPause(dockerCli command.Cli, opts *pauseOptions) error {
ctx := context.Background()
var errs []string

View File

@ -19,7 +19,7 @@ type portOptions struct {
}
// NewPortCommand creates a new cobra.Command for `docker port`
func NewPortCommand(dockerCli *command.DockerCli) *cobra.Command {
func NewPortCommand(dockerCli command.Cli) *cobra.Command {
var opts portOptions
cmd := &cobra.Command{
@ -37,7 +37,7 @@ func NewPortCommand(dockerCli *command.DockerCli) *cobra.Command {
return cmd
}
func runPort(dockerCli *command.DockerCli, opts *portOptions) error {
func runPort(dockerCli command.Cli, opts *portOptions) error {
ctx := context.Background()
c, err := dockerCli.Client().ContainerInspect(ctx, opts.container)

View File

@ -35,7 +35,7 @@ func NewPruneCommand(dockerCli command.Cli) *cobra.Command {
fmt.Fprintln(dockerCli.Out(), "Total reclaimed space:", units.HumanSize(float64(spaceReclaimed)))
return nil
},
Tags: map[string]string{"version": "1.25"},
Annotations: map[string]string{"version": "1.25"},
}
flags := cmd.Flags()
@ -52,12 +52,12 @@ func runPrune(dockerCli command.Cli, options pruneOptions) (spaceReclaimed uint6
pruneFilters := command.PruneFilters(dockerCli, options.filter.Value())
if !options.force && !command.PromptForConfirmation(dockerCli.In(), dockerCli.Out(), warning) {
return
return 0, "", nil
}
report, err := dockerCli.Client().ContainersPrune(context.Background(), pruneFilters)
if err != nil {
return
return 0, "", err
}
if len(report.ContainersDeleted) > 0 {
@ -68,7 +68,7 @@ func runPrune(dockerCli command.Cli, options pruneOptions) (spaceReclaimed uint6
spaceReclaimed = report.SpaceReclaimed
}
return
return spaceReclaimed, output, nil
}
// RunPrune calls the Container Prune API

View File

@ -17,7 +17,7 @@ type renameOptions struct {
}
// NewRenameCommand creates a new cobra.Command for `docker rename`
func NewRenameCommand(dockerCli *command.DockerCli) *cobra.Command {
func NewRenameCommand(dockerCli command.Cli) *cobra.Command {
var opts renameOptions
cmd := &cobra.Command{
@ -33,7 +33,7 @@ func NewRenameCommand(dockerCli *command.DockerCli) *cobra.Command {
return cmd
}
func runRename(dockerCli *command.DockerCli, opts *renameOptions) error {
func runRename(dockerCli command.Cli, opts *renameOptions) error {
ctx := context.Background()
oldName := strings.TrimSpace(opts.oldName)

View File

@ -20,7 +20,7 @@ type restartOptions struct {
}
// NewRestartCommand creates a new cobra.Command for `docker restart`
func NewRestartCommand(dockerCli *command.DockerCli) *cobra.Command {
func NewRestartCommand(dockerCli command.Cli) *cobra.Command {
var opts restartOptions
cmd := &cobra.Command{
@ -39,7 +39,7 @@ func NewRestartCommand(dockerCli *command.DockerCli) *cobra.Command {
return cmd
}
func runRestart(dockerCli *command.DockerCli, opts *restartOptions) error {
func runRestart(dockerCli command.Cli, opts *restartOptions) error {
ctx := context.Background()
var errs []string
var timeout *time.Duration

View File

@ -21,7 +21,7 @@ type rmOptions struct {
}
// NewRmCommand creates a new cobra.Command for `docker rm`
func NewRmCommand(dockerCli *command.DockerCli) *cobra.Command {
func NewRmCommand(dockerCli command.Cli) *cobra.Command {
var opts rmOptions
cmd := &cobra.Command{
@ -41,7 +41,7 @@ func NewRmCommand(dockerCli *command.DockerCli) *cobra.Command {
return cmd
}
func runRm(dockerCli *command.DockerCli, opts *rmOptions) error {
func runRm(dockerCli command.Cli, opts *rmOptions) error {
ctx := context.Background()
var errs []string

View File

@ -10,16 +10,15 @@ import (
"strings"
"syscall"
"github.com/Sirupsen/logrus"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/opts"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/pkg/promise"
"github.com/docker/docker/pkg/signal"
"github.com/docker/docker/pkg/term"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"golang.org/x/net/context"
@ -30,10 +29,11 @@ type runOptions struct {
sigProxy bool
name string
detachKeys string
platform string
}
// NewRunCommand create a new `docker run` command
func NewRunCommand(dockerCli *command.DockerCli) *cobra.Command {
func NewRunCommand(dockerCli command.Cli) *cobra.Command {
var opts runOptions
var copts *containerOptions
@ -63,6 +63,7 @@ func NewRunCommand(dockerCli *command.DockerCli) *cobra.Command {
// with hostname
flags.Bool("help", false, "Print usage")
command.AddPlatformFlag(flags, &opts.platform)
command.AddTrustVerificationFlags(flags)
copts = addFlags(flags)
return cmd
@ -97,7 +98,7 @@ func isLocalhost(ip string) bool {
return localhostIPRegexp.MatchString(ip)
}
func runRun(dockerCli *command.DockerCli, flags *pflag.FlagSet, ropts *runOptions, copts *containerOptions) error {
func runRun(dockerCli command.Cli, flags *pflag.FlagSet, ropts *runOptions, copts *containerOptions) error {
proxyConfig := dockerCli.ConfigFile().ParseProxyConfig(dockerCli.Client().DaemonHost(), copts.env.GetAll())
newEnv := []string{}
for k, v := range proxyConfig {
@ -118,7 +119,7 @@ func runRun(dockerCli *command.DockerCli, flags *pflag.FlagSet, ropts *runOption
}
// nolint: gocyclo
func runContainer(dockerCli *command.DockerCli, opts *runOptions, copts *containerOptions, containerConfig *containerConfig) error {
func runContainer(dockerCli command.Cli, opts *runOptions, copts *containerOptions, containerConfig *containerConfig) error {
config := containerConfig.Config
hostConfig := containerConfig.HostConfig
stdout, stderr := dockerCli.Out(), dockerCli.Err()
@ -161,7 +162,7 @@ func runContainer(dockerCli *command.DockerCli, opts *runOptions, copts *contain
ctx, cancelFun := context.WithCancel(context.Background())
createResponse, err := createContainer(ctx, dockerCli, containerConfig, opts.name)
createResponse, err := createContainer(ctx, dockerCli, containerConfig, opts.name, opts.platform)
if err != nil {
reportError(stderr, cmdPath, err.Error(), true)
return runStartContainerErr(err)
@ -291,22 +292,27 @@ func attachContainer(
return nil, errAttach
}
*errCh = promise.Go(func() error {
streamer := hijackedIOStreamer{
streams: dockerCli,
inputStream: in,
outputStream: out,
errorStream: cerr,
resp: resp,
tty: config.Tty,
detachKeys: options.DetachKeys,
}
ch := make(chan error, 1)
*errCh = ch
if errHijack := streamer.stream(ctx); errHijack != nil {
return errHijack
}
return errAttach
})
go func() {
ch <- func() error {
streamer := hijackedIOStreamer{
streams: dockerCli,
inputStream: in,
outputStream: out,
errorStream: cerr,
resp: resp,
tty: config.Tty,
detachKeys: options.DetachKeys,
}
if errHijack := streamer.stream(ctx); errHijack != nil {
return errHijack
}
return errAttach
}()
}()
return resp.Close, nil
}

View File

@ -9,7 +9,6 @@ import (
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/promise"
"github.com/docker/docker/pkg/signal"
"github.com/docker/docker/pkg/term"
"github.com/pkg/errors"
@ -28,7 +27,7 @@ type startOptions struct {
}
// NewStartCommand creates a new cobra.Command for `docker start`
func NewStartCommand(dockerCli *command.DockerCli) *cobra.Command {
func NewStartCommand(dockerCli command.Cli) *cobra.Command {
var opts startOptions
cmd := &cobra.Command{
@ -54,7 +53,7 @@ func NewStartCommand(dockerCli *command.DockerCli) *cobra.Command {
}
// nolint: gocyclo
func runStart(dockerCli *command.DockerCli, opts *startOptions) error {
func runStart(dockerCli command.Cli, opts *startOptions) error {
ctx, cancelFun := context.WithCancel(context.Background())
if opts.attach || opts.openStdin {
@ -103,23 +102,28 @@ func runStart(dockerCli *command.DockerCli, opts *startOptions) error {
return errAttach
}
defer resp.Close()
cErr := promise.Go(func() error {
streamer := hijackedIOStreamer{
streams: dockerCli,
inputStream: in,
outputStream: dockerCli.Out(),
errorStream: dockerCli.Err(),
resp: resp,
tty: c.Config.Tty,
detachKeys: options.DetachKeys,
}
errHijack := streamer.stream(ctx)
if errHijack == nil {
return errAttach
}
return errHijack
})
cErr := make(chan error, 1)
go func() {
cErr <- func() error {
streamer := hijackedIOStreamer{
streams: dockerCli,
inputStream: in,
outputStream: dockerCli.Out(),
errorStream: dockerCli.Err(),
resp: resp,
tty: c.Config.Tty,
detachKeys: options.DetachKeys,
}
errHijack := streamer.stream(ctx)
if errHijack == nil {
return errAttach
}
return errHijack
}()
}()
// 3. We should open a channel for receiving status code of the container
// no matter it's detached, removed on daemon side(--rm) or exit normally.
@ -177,7 +181,7 @@ func runStart(dockerCli *command.DockerCli, opts *startOptions) error {
return nil
}
func startContainersWithoutAttachments(ctx context.Context, dockerCli *command.DockerCli, containers []string) error {
func startContainersWithoutAttachments(ctx context.Context, dockerCli command.Cli, containers []string) error {
var failedContainers []string
for _, container := range containers {
if err := dockerCli.Client().ContainerStart(ctx, container, types.ContainerStartOptions{}); err != nil {

View File

@ -21,12 +21,13 @@ import (
type statsOptions struct {
all bool
noStream bool
noTrunc bool
format string
containers []string
}
// NewStatsCommand creates a new cobra.Command for `docker stats`
func NewStatsCommand(dockerCli *command.DockerCli) *cobra.Command {
func NewStatsCommand(dockerCli command.Cli) *cobra.Command {
var opts statsOptions
cmd := &cobra.Command{
@ -42,6 +43,7 @@ func NewStatsCommand(dockerCli *command.DockerCli) *cobra.Command {
flags := cmd.Flags()
flags.BoolVarP(&opts.all, "all", "a", false, "Show all containers (default shows just running)")
flags.BoolVar(&opts.noStream, "no-stream", false, "Disable streaming stats and only pull the first result")
flags.BoolVar(&opts.noTrunc, "no-trunc", false, "Do not truncate output")
flags.StringVar(&opts.format, "format", "", "Pretty-print images using a Go template")
return cmd
}
@ -49,7 +51,7 @@ func NewStatsCommand(dockerCli *command.DockerCli) *cobra.Command {
// runStats displays a live stream of resource usage statistics for one or more containers.
// This shows real-time information on CPU usage, memory usage, and network I/O.
// nolint: gocyclo
func runStats(dockerCli *command.DockerCli, opts *statsOptions) error {
func runStats(dockerCli command.Cli, opts *statsOptions) error {
showAll := len(opts.containers) == 0
closeChan := make(chan error)
@ -214,7 +216,7 @@ func runStats(dockerCli *command.DockerCli, opts *statsOptions) error {
ccstats = append(ccstats, c.GetStatistics())
}
cStats.mu.Unlock()
if err = formatter.ContainerStatsWrite(statsCtx, ccstats, daemonOSType); err != nil {
if err = formatter.ContainerStatsWrite(statsCtx, ccstats, daemonOSType, !opts.noTrunc); err != nil {
break
}
if len(cStats.cs) == 0 && !showAll {

View File

@ -7,11 +7,11 @@ import (
"sync"
"time"
"github.com/Sirupsen/logrus"
"github.com/docker/cli/cli/command/formatter"
"github.com/docker/docker/api/types"
"github.com/docker/docker/client"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
)
@ -200,7 +200,8 @@ func calculateCPUPercentWindows(v *types.StatsJSON) float64 {
return 0.00
}
func calculateBlockIO(blkio types.BlkioStats) (blkRead uint64, blkWrite uint64) {
func calculateBlockIO(blkio types.BlkioStats) (uint64, uint64) {
var blkRead, blkWrite uint64
for _, bioEntry := range blkio.IoServiceBytesRecursive {
switch strings.ToLower(bioEntry.Op) {
case "read":
@ -209,7 +210,7 @@ func calculateBlockIO(blkio types.BlkioStats) (blkRead uint64, blkWrite uint64)
blkWrite = blkWrite + bioEntry.Value
}
}
return
return blkRead, blkWrite
}
func calculateNetwork(network map[string]types.NetworkStats) (float64, float64) {

View File

@ -20,7 +20,7 @@ type stopOptions struct {
}
// NewStopCommand creates a new cobra.Command for `docker stop`
func NewStopCommand(dockerCli *command.DockerCli) *cobra.Command {
func NewStopCommand(dockerCli command.Cli) *cobra.Command {
var opts stopOptions
cmd := &cobra.Command{
@ -39,7 +39,7 @@ func NewStopCommand(dockerCli *command.DockerCli) *cobra.Command {
return cmd
}
func runStop(dockerCli *command.DockerCli, opts *stopOptions) error {
func runStop(dockerCli command.Cli, opts *stopOptions) error {
ctx := context.Background()
var timeout *time.Duration

View File

@ -18,7 +18,7 @@ type topOptions struct {
}
// NewTopCommand creates a new cobra.Command for `docker top`
func NewTopCommand(dockerCli *command.DockerCli) *cobra.Command {
func NewTopCommand(dockerCli command.Cli) *cobra.Command {
var opts topOptions
cmd := &cobra.Command{
@ -38,7 +38,7 @@ func NewTopCommand(dockerCli *command.DockerCli) *cobra.Command {
return cmd
}
func runTop(dockerCli *command.DockerCli, opts *topOptions) error {
func runTop(dockerCli command.Cli, opts *topOptions) error {
ctx := context.Background()
procList, err := dockerCli.Client().ContainerTop(ctx, opts.container, opts.args)

View File

@ -7,11 +7,11 @@ import (
"runtime"
"time"
"github.com/Sirupsen/logrus"
"github.com/docker/cli/cli/command"
"github.com/docker/docker/api/types"
"github.com/docker/docker/client"
"github.com/docker/docker/pkg/signal"
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
)

View File

@ -16,7 +16,7 @@ type unpauseOptions struct {
}
// NewUnpauseCommand creates a new cobra.Command for `docker unpause`
func NewUnpauseCommand(dockerCli *command.DockerCli) *cobra.Command {
func NewUnpauseCommand(dockerCli command.Cli) *cobra.Command {
var opts unpauseOptions
cmd := &cobra.Command{
@ -31,7 +31,7 @@ func NewUnpauseCommand(dockerCli *command.DockerCli) *cobra.Command {
return cmd
}
func runUnpause(dockerCli *command.DockerCli, opts *unpauseOptions) error {
func runUnpause(dockerCli command.Cli, opts *unpauseOptions) error {
ctx := context.Background()
var errs []string

View File

@ -35,7 +35,7 @@ type updateOptions struct {
}
// NewUpdateCommand creates a new cobra.Command for `docker update`
func NewUpdateCommand(dockerCli *command.DockerCli) *cobra.Command {
func NewUpdateCommand(dockerCli command.Cli) *cobra.Command {
var options updateOptions
cmd := &cobra.Command{
@ -72,7 +72,7 @@ func NewUpdateCommand(dockerCli *command.DockerCli) *cobra.Command {
return cmd
}
func runUpdate(dockerCli *command.DockerCli, options *updateOptions) error {
func runUpdate(dockerCli command.Cli, options *updateOptions) error {
var err error
if options.nFlag == 0 {

View File

@ -3,17 +3,17 @@ package container
import (
"strconv"
"github.com/Sirupsen/logrus"
"github.com/docker/cli/cli/command"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/events"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/api/types/versions"
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
)
func waitExitOrRemoved(ctx context.Context, dockerCli *command.DockerCli, containerID string, waitRemove bool) <-chan int {
func waitExitOrRemoved(ctx context.Context, dockerCli command.Cli, containerID string, waitRemove bool) <-chan int {
if len(containerID) == 0 {
// containerID can never be empty
panic("Internal Error: waitExitOrRemoved needs a containerID as parameter")
@ -47,7 +47,7 @@ func waitExitOrRemoved(ctx context.Context, dockerCli *command.DockerCli, contai
return statusC
}
func legacyWaitExitOrRemoved(ctx context.Context, dockerCli *command.DockerCli, containerID string, waitRemove bool) <-chan int {
func legacyWaitExitOrRemoved(ctx context.Context, dockerCli command.Cli, containerID string, waitRemove bool) <-chan int {
var removeErr error
statusChan := make(chan int)
exitCode := 125

View File

@ -16,7 +16,7 @@ type waitOptions struct {
}
// NewWaitCommand creates a new cobra.Command for `docker wait`
func NewWaitCommand(dockerCli *command.DockerCli) *cobra.Command {
func NewWaitCommand(dockerCli command.Cli) *cobra.Command {
var opts waitOptions
cmd := &cobra.Command{
@ -32,7 +32,7 @@ func NewWaitCommand(dockerCli *command.DockerCli) *cobra.Command {
return cmd
}
func runWait(dockerCli *command.DockerCli, opts *waitOptions) error {
func runWait(dockerCli command.Cli, opts *waitOptions) error {
ctx := context.Background()
var errs []string

View File

@ -3,8 +3,8 @@ package command
import (
"sync"
"github.com/Sirupsen/logrus"
eventtypes "github.com/docker/docker/api/types/events"
"github.com/sirupsen/logrus"
)
// EventHandler is abstract interface for user to customize

View File

@ -10,7 +10,6 @@ import (
"github.com/docker/distribution/reference"
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/docker/pkg/stringutils"
"github.com/docker/go-units"
)
@ -165,7 +164,7 @@ func (c *containerContext) Image() string {
func (c *containerContext) Command() string {
command := c.c.Command
if c.trunc {
command = stringutils.Ellipsis(command, 20)
command = Ellipsis(command, 20)
}
return strconv.Quote(command)
}
@ -227,7 +226,7 @@ func (c *containerContext) Mounts() string {
name = m.Name
}
if c.trunc {
name = stringutils.Ellipsis(name, 15)
name = Ellipsis(name, 15)
}
mounts = append(mounts, name)
}

View File

@ -10,6 +10,7 @@ import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/stringid"
"github.com/gotestyourself/gotestyourself/golden"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
@ -65,7 +66,7 @@ func TestContainerPsContext(t *testing.T) {
Source: "/a/path",
},
},
}, true, "this-is-a-lo...", ctx.Mounts},
}, true, "this-is-a-long…", ctx.Mounts},
{types.Container{
Mounts: []types.MountPoint{
{
@ -230,10 +231,7 @@ size: 0B
// Special headers for customized table format
{
Context{Format: NewContainerFormat(`table {{truncate .ID 5}}\t{{json .Image}} {{.RunningFor}}/{{title .Status}}/{{pad .Ports 2 2}}.{{upper .Names}} {{lower .Status}}`, false, true)},
`CONTAINER ID IMAGE CREATED/STATUS/ PORTS .NAMES STATUS
conta "ubuntu" 24 hours ago//.FOOBAR_BAZ
conta "ubuntu" 24 hours ago//.FOOBAR_BAR
`,
string(golden.Get(t, "container-context-write-special-headers.golden")),
},
}

View File

@ -118,11 +118,11 @@ func (ctx *DiskUsageContext) Write() (err error) {
return err
}
func (ctx *DiskUsageContext) verboseWrite() (err error) {
func (ctx *DiskUsageContext) verboseWrite() error {
// First images
tmpl, err := ctx.startSubsection(defaultDiskUsageImageTableFormat)
if err != nil {
return
return err
}
ctx.Output.Write([]byte("Images space usage:\n\n"))
@ -141,14 +141,14 @@ func (ctx *DiskUsageContext) verboseWrite() (err error) {
}
}
err = ctx.contextFormat(tmpl, &imageContext{
err := ctx.contextFormat(tmpl, &imageContext{
repo: repo,
tag: tag,
trunc: true,
i: *i,
})
if err != nil {
return
return err
}
}
ctx.postFormat(tmpl, newImageContext())
@ -157,17 +157,14 @@ func (ctx *DiskUsageContext) verboseWrite() (err error) {
ctx.Output.Write([]byte("\nContainers space usage:\n\n"))
tmpl, err = ctx.startSubsection(defaultDiskUsageContainerTableFormat)
if err != nil {
return
return err
}
for _, c := range ctx.Containers {
// Don't display the virtual size
c.SizeRootFs = 0
err = ctx.contextFormat(tmpl, &containerContext{
trunc: true,
c: *c,
})
err := ctx.contextFormat(tmpl, &containerContext{trunc: true, c: *c})
if err != nil {
return
return err
}
}
ctx.postFormat(tmpl, newContainerContext())
@ -176,21 +173,18 @@ func (ctx *DiskUsageContext) verboseWrite() (err error) {
ctx.Output.Write([]byte("\nLocal Volumes space usage:\n\n"))
tmpl, err = ctx.startSubsection(defaultDiskUsageVolumeTableFormat)
if err != nil {
return
return err
}
for _, v := range ctx.Volumes {
err = ctx.contextFormat(tmpl, &volumeContext{
v: *v,
})
if err != nil {
return
if err := ctx.contextFormat(tmpl, &volumeContext{v: *v}); err != nil {
return err
}
}
ctx.postFormat(tmpl, newVolumeContext())
// And build cache
fmt.Fprintf(ctx.Output, "\nBuild cache usage: %s\n\n", units.HumanSize(float64(ctx.BuilderSize)))
return
return nil
}
type diskUsageImagesContext struct {

View File

@ -4,6 +4,7 @@ import (
"bytes"
"testing"
"github.com/gotestyourself/gotestyourself/golden"
"github.com/stretchr/testify/assert"
)
@ -83,12 +84,7 @@ Build Cache 0B
Format: NewDiskUsageFormat("table {{.Type}}\t{{.Active}}"),
},
},
`TYPE ACTIVE
Images 0
Containers 0
Local Volumes 0
Build Cache
`,
string(golden.Get(t, "disk-usage-context-write-custom.golden")),
},
// Raw Format
{
@ -97,31 +93,7 @@ Build Cache
Format: NewDiskUsageFormat("raw"),
},
},
`type: Images
total: 0
active: 0
size: 0B
reclaimable: 0B
type: Containers
total: 0
active: 0
size: 0B
reclaimable: 0B
type: Local Volumes
total: 0
active: 0
size: 0B
reclaimable: 0B
type: Build Cache
total:
active:
size: 0B
reclaimable: 0B
`,
string(golden.Get(t, "disk-usage-raw-format.golden")),
},
}

View File

@ -0,0 +1,61 @@
package formatter
import (
"unicode/utf8"
"golang.org/x/text/width"
)
// charWidth returns the number of horizontal positions a character occupies,
// and is used to account for wide characters when displaying strings.
//
// In a broad sense, wide characters include East Asian Wide, East Asian Full-width,
// (when not in East Asian context) see http://unicode.org/reports/tr11/.
func charWidth(r rune) int {
switch width.LookupRune(r).Kind() {
case width.EastAsianWide, width.EastAsianFullwidth:
return 2
default:
return 1
}
}
// Ellipsis truncates a string to fit within maxDisplayWidth, and appends ellipsis (…).
// For maxDisplayWidth of 1 and lower, no ellipsis is appended.
// For maxDisplayWidth of 1, first char of string will return even if its width > 1.
func Ellipsis(s string, maxDisplayWidth int) string {
if maxDisplayWidth <= 0 {
return ""
}
rs := []rune(s)
if maxDisplayWidth == 1 {
return string(rs[0])
}
byteLen := len(s)
if byteLen == utf8.RuneCountInString(s) {
if byteLen <= maxDisplayWidth {
return s
}
return string(rs[:maxDisplayWidth-1]) + "…"
}
var (
display []int
displayWidth int
)
for _, r := range rs {
cw := charWidth(r)
displayWidth += cw
display = append(display, displayWidth)
}
if displayWidth <= maxDisplayWidth {
return s
}
for i := range display {
if display[i] <= maxDisplayWidth-1 && display[i+1] > maxDisplayWidth-1 {
return string(rs[:i+1]) + "…"
}
}
return s
}

View File

@ -0,0 +1,30 @@
package formatter
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestEllipsis(t *testing.T) {
var testcases = []struct {
source string
width int
expected string
}{
{source: "t🐳ststring", width: 0, expected: ""},
{source: "t🐳ststring", width: 1, expected: "t"},
{source: "t🐳ststring", width: 2, expected: "t…"},
{source: "t🐳ststring", width: 6, expected: "t🐳st…"},
{source: "t🐳ststring", width: 20, expected: "t🐳ststring"},
{source: "你好世界teststring", width: 0, expected: ""},
{source: "你好世界teststring", width: 1, expected: "你"},
{source: "你好世界teststring", width: 3, expected: "你…"},
{source: "你好世界teststring", width: 6, expected: "你好…"},
{source: "你好世界teststring", width: 20, expected: "你好世界teststring"},
}
for _, testcase := range testcases {
assert.Equal(t, testcase.expected, Ellipsis(testcase.source, testcase.width))
}
}

View File

@ -7,7 +7,6 @@ import (
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/docker/pkg/stringutils"
units "github.com/docker/go-units"
)
@ -93,7 +92,7 @@ func (c *historyContext) CreatedSince() string {
func (c *historyContext) CreatedBy() string {
createdBy := strings.Replace(c.h.CreatedBy, "\t", " ", -1)
if c.trunc {
return stringutils.Ellipsis(createdBy, 45)
return Ellipsis(createdBy, 45)
}
return createdBy
}

View File

@ -10,7 +10,6 @@ import (
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/docker/pkg/stringutils"
"github.com/stretchr/testify/assert"
)
@ -96,7 +95,7 @@ func TestHistoryContext_CreatedBy(t *testing.T) {
historyContext{
h: image.HistoryResponseItem{CreatedBy: withTabs},
trunc: true,
}, stringutils.Ellipsis(expected, 45), ctx.CreatedBy,
}, Ellipsis(expected, 45), ctx.CreatedBy,
},
}
@ -191,7 +190,7 @@ imageID3 24 hours ago /bin/bash ls
imageID4 24 hours ago /bin/bash grep 183MB Hi
`
expectedTrunc := `IMAGE CREATED CREATED BY SIZE COMMENT
imageID1 24 hours ago /bin/bash ls && npm i && npm run test && k... 183MB Hi
imageID1 24 hours ago /bin/bash ls && npm i && npm run test && kar… 183MB Hi
imageID2 24 hours ago /bin/bash echo 183MB Hi
imageID3 24 hours ago /bin/bash ls 183MB Hi
imageID4 24 hours ago /bin/bash grep 183MB Hi

View File

@ -5,7 +5,6 @@ import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/docker/pkg/stringutils"
)
const (
@ -80,7 +79,7 @@ func (c *pluginContext) Description() string {
desc := strings.Replace(c.p.Config.Description, "\n", "", -1)
desc = strings.Replace(desc, "\r", "", -1)
if c.trunc {
desc = stringutils.Ellipsis(desc, 45)
desc = Ellipsis(desc, 45)
}
return desc

View File

@ -5,7 +5,6 @@ import (
"strings"
registry "github.com/docker/docker/api/types/registry"
"github.com/docker/docker/pkg/stringutils"
)
const (
@ -73,7 +72,7 @@ func (c *searchContext) Description() string {
desc := strings.Replace(c.s.Description, "\n", " ", -1)
desc = strings.Replace(desc, "\r", " ", -1)
if c.trunc {
desc = stringutils.Ellipsis(desc, 45)
desc = Ellipsis(desc, 45)
}
return desc
}

View File

@ -7,7 +7,7 @@ import (
"testing"
registrytypes "github.com/docker/docker/api/types/registry"
"github.com/docker/docker/pkg/stringutils"
"github.com/gotestyourself/gotestyourself/golden"
"github.com/stretchr/testify/assert"
)
@ -78,7 +78,7 @@ func TestSearchContextDescription(t *testing.T) {
{searchContext{
s: registrytypes.SearchResult{Description: longDescription},
trunc: true,
}, stringutils.Ellipsis(longDescription, 45), ctx.Description},
}, Ellipsis(longDescription, 45), ctx.Description},
{searchContext{
s: registrytypes.SearchResult{Description: descriptionWReturns},
trunc: false,
@ -86,7 +86,7 @@ func TestSearchContextDescription(t *testing.T) {
{searchContext{
s: registrytypes.SearchResult{Description: descriptionWReturns},
trunc: true,
}, stringutils.Ellipsis(longDescription, 45), ctx.Description},
}, Ellipsis(longDescription, 45), ctx.Description},
}
for _, c := range cases {
@ -120,10 +120,7 @@ func TestSearchContextWrite(t *testing.T) {
// Table format
{
Context{Format: NewSearchFormat("table")},
`NAME DESCRIPTION STARS OFFICIAL AUTOMATED
result1 Official build 5000 [OK]
result2 Not official 5 [OK]
`,
string(golden.Get(t, "search-context-write-table.golden")),
},
{
Context{Format: NewSearchFormat("table {{.Name}}")},
@ -210,9 +207,7 @@ func TestSearchContextWriteStars(t *testing.T) {
// Table format
{
Context{Format: NewSearchFormat("table")},
`NAME DESCRIPTION STARS OFFICIAL AUTOMATED
result1 Official build 5000 [OK]
`,
string(golden.Get(t, "search-context-write-stars-table.golden")),
},
{
Context{Format: NewSearchFormat("table {{.Name}}")},

View File

@ -12,19 +12,20 @@ import (
)
const (
defaultSecretTableFormat = "table {{.ID}}\t{{.Name}}\t{{.CreatedAt}}\t{{.UpdatedAt}}"
defaultSecretTableFormat = "table {{.ID}}\t{{.Name}}\t{{.Driver}}\t{{.CreatedAt}}\t{{.UpdatedAt}}"
secretIDHeader = "ID"
secretCreatedHeader = "CREATED"
secretUpdatedHeader = "UPDATED"
secretInspectPrettyTemplate Format = `ID: {{.ID}}
Name: {{.Name}}
secretInspectPrettyTemplate Format = `ID: {{.ID}}
Name: {{.Name}}
{{- if .Labels }}
Labels:
{{- range $k, $v := .Labels }}
- {{ $k }}{{if $v }}={{ $v }}{{ end }}
{{- end }}{{ end }}
Created at: {{.CreatedAt}}
Updated at: {{.UpdatedAt}}`
Driver: {{.Driver}}
Created at: {{.CreatedAt}}
Updated at: {{.UpdatedAt}}`
)
// NewSecretFormat returns a Format for rendering using a secret Context
@ -61,6 +62,7 @@ func newSecretContext() *secretContext {
sCtx.header = map[string]string{
"ID": secretIDHeader,
"Name": nameHeader,
"Driver": driverHeader,
"CreatedAt": secretCreatedHeader,
"UpdatedAt": secretUpdatedHeader,
"Labels": labelsHeader,
@ -89,6 +91,13 @@ func (c *secretContext) CreatedAt() string {
return units.HumanDuration(time.Now().UTC().Sub(c.s.Meta.CreatedAt)) + " ago"
}
func (c *secretContext) Driver() string {
if c.s.Spec.Driver == nil {
return ""
}
return c.s.Spec.Driver.Name
}
func (c *secretContext) UpdatedAt() string {
return units.HumanDuration(time.Now().UTC().Sub(c.s.Meta.UpdatedAt)) + " ago"
}
@ -153,6 +162,13 @@ func (ctx *secretInspectContext) Labels() map[string]string {
return ctx.Secret.Spec.Labels
}
func (ctx *secretInspectContext) Driver() string {
if ctx.Secret.Spec.Driver == nil {
return ""
}
return ctx.Secret.Spec.Driver.Name
}
func (ctx *secretInspectContext) CreatedAt() string {
return command.PrettyPrint(ctx.Secret.CreatedAt)
}

View File

@ -28,9 +28,9 @@ func TestSecretContextFormatWrite(t *testing.T) {
},
// Table format
{Context{Format: NewSecretFormat("table", false)},
`ID NAME CREATED UPDATED
1 passwords Less than a second ago Less than a second ago
2 id_rsa Less than a second ago Less than a second ago
`ID NAME DRIVER CREATED UPDATED
1 passwords Less than a second ago Less than a second ago
2 id_rsa Less than a second ago Less than a second ago
`},
{Context{Format: NewSecretFormat("table {{.Name}}", true)},
`NAME

View File

@ -504,7 +504,10 @@ func (c *serviceContext) Replicas() string {
}
func (c *serviceContext) Image() string {
image := c.service.Spec.TaskTemplate.ContainerSpec.Image
var image string
if c.service.Spec.TaskTemplate.ContainerSpec != nil {
image = c.service.Spec.TaskTemplate.ContainerSpec.Image
}
if ref, err := reference.ParseNormalizedNamed(image); err == nil {
// update image string for display, (strips any digest)
if nt, ok := ref.(reference.NamedTagged); ok {

View File

@ -8,6 +8,7 @@ import (
"testing"
"github.com/docker/docker/api/types/swarm"
"github.com/gotestyourself/gotestyourself/golden"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
@ -59,21 +60,7 @@ bar
// Raw Format
{
Context{Format: NewServiceListFormat("raw", false)},
`id: id_baz
name: baz
mode: global
replicas: 2/4
image:
ports: *:80->8080/tcp
id: id_bar
name: bar
mode: replicated
replicas: 2/4
image:
ports: *:80->8080/tcp
`,
string(golden.Get(t, "service-context-write-raw.golden")),
},
{
Context{Format: NewServiceListFormat("raw", true)},

View File

@ -4,13 +4,14 @@ import (
"fmt"
"sync"
"github.com/docker/docker/pkg/stringid"
units "github.com/docker/go-units"
)
const (
winOSType = "windows"
defaultStatsTableFormat = "table {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.MemPerc}}\t{{.NetIO}}\t{{.BlockIO}}\t{{.PIDs}}"
winDefaultStatsTableFormat = "table {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.NetIO}}\t{{.BlockIO}}"
defaultStatsTableFormat = "table {{.ID}}\t{{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.MemPerc}}\t{{.NetIO}}\t{{.BlockIO}}\t{{.PIDs}}"
winDefaultStatsTableFormat = "table {{.ID}}\t{{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.NetIO}}\t{{.BlockIO}}"
containerHeader = "CONTAINER"
cpuPercHeader = "CPU %"
@ -114,12 +115,13 @@ func NewContainerStats(container string) *ContainerStats {
}
// ContainerStatsWrite renders the context for a list of containers statistics
func ContainerStatsWrite(ctx Context, containerStats []StatsEntry, osType string) error {
func ContainerStatsWrite(ctx Context, containerStats []StatsEntry, osType string, trunc bool) error {
render := func(format func(subContext subContext) error) error {
for _, cstats := range containerStats {
containerStatsCtx := &containerStatsContext{
s: cstats,
os: osType,
s: cstats,
os: osType,
trunc: trunc,
}
if err := format(containerStatsCtx); err != nil {
return err
@ -149,8 +151,9 @@ func ContainerStatsWrite(ctx Context, containerStats []StatsEntry, osType string
type containerStatsContext struct {
HeaderContext
s StatsEntry
os string
s StatsEntry
os string
trunc bool
}
func (c *containerStatsContext) MarshalJSON() ([]byte, error) {
@ -169,6 +172,9 @@ func (c *containerStatsContext) Name() string {
}
func (c *containerStatsContext) ID() string {
if c.trunc {
return stringid.TruncateID(c.s.ID)
}
return c.s.ID
}

View File

@ -114,7 +114,7 @@ container2 --
}
var out bytes.Buffer
te.context.Output = &out
err := ContainerStatsWrite(te.context, stats, "linux")
err := ContainerStatsWrite(te.context, stats, "linux", false)
if err != nil {
assert.EqualError(t, err, te.expected)
} else {
@ -180,7 +180,7 @@ container2 -- --
}
var out bytes.Buffer
te.context.Output = &out
err := ContainerStatsWrite(te.context, stats, "windows")
err := ContainerStatsWrite(te.context, stats, "windows", false)
if err != nil {
assert.EqualError(t, err, te.expected)
} else {
@ -220,7 +220,7 @@ func TestContainerStatsContextWriteWithNoStats(t *testing.T) {
}
for _, context := range contexts {
ContainerStatsWrite(context.context, []StatsEntry{}, "linux")
ContainerStatsWrite(context.context, []StatsEntry{}, "linux", false)
assert.Equal(t, context.expected, out.String())
// Clean buffer
out.Reset()
@ -258,7 +258,41 @@ func TestContainerStatsContextWriteWithNoStatsWindows(t *testing.T) {
}
for _, context := range contexts {
ContainerStatsWrite(context.context, []StatsEntry{}, "windows")
ContainerStatsWrite(context.context, []StatsEntry{}, "windows", false)
assert.Equal(t, context.expected, out.String())
// Clean buffer
out.Reset()
}
}
func TestContainerStatsContextWriteTrunc(t *testing.T) {
var out bytes.Buffer
contexts := []struct {
context Context
trunc bool
expected string
}{
{
Context{
Format: "{{.ID}}",
Output: &out,
},
false,
"b95a83497c9161c9b444e3d70e1a9dfba0c1840d41720e146a95a08ebf938afc\n",
},
{
Context{
Format: "{{.ID}}",
Output: &out,
},
true,
"b95a83497c91\n",
},
}
for _, context := range contexts {
ContainerStatsWrite(context.context, []StatsEntry{{ID: "b95a83497c9161c9b444e3d70e1a9dfba0c1840d41720e146a95a08ebf938afc"}}, "linux", context.trunc)
assert.Equal(t, context.expected, out.String())
// Clean buffer
out.Reset()

View File

@ -7,6 +7,7 @@ import (
"testing"
"github.com/docker/docker/api/types/swarm"
"github.com/gotestyourself/gotestyourself/golden"
"github.com/stretchr/testify/assert"
)
@ -33,10 +34,7 @@ taskID2
},
{
Context{Format: NewTaskFormat("table {{.Name}}\t{{.Node}}\t{{.Ports}}", false)},
`NAME NODE PORTS
foobar_baz foo1
foobar_bar foo2
`,
string(golden.Get(t, "task-context-write-table-custom.golden")),
},
{
Context{Format: NewTaskFormat("table {{.Name}}", true)},

View File

@ -0,0 +1,3 @@
CONTAINER ID IMAGE CREATED/STATUS/ PORTS .NAMES STATUS
conta "ubuntu" 24 hours ago//.FOOBAR_BAZ
conta "ubuntu" 24 hours ago//.FOOBAR_BAR

View File

@ -0,0 +1,5 @@
TYPE ACTIVE
Images 0
Containers 0
Local Volumes 0
Build Cache

View File

@ -0,0 +1,24 @@
type: Images
total: 0
active: 0
size: 0B
reclaimable: 0B
type: Containers
total: 0
active: 0
size: 0B
reclaimable: 0B
type: Local Volumes
total: 0
active: 0
size: 0B
reclaimable: 0B
type: Build Cache
total:
active:
size: 0B
reclaimable: 0B

View File

@ -0,0 +1,2 @@
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
result1 Official build 5000 [OK]

View File

@ -0,0 +1,3 @@
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
result1 Official build 5000 [OK]
result2 Not official 5 [OK]

View File

@ -0,0 +1,14 @@
id: id_baz
name: baz
mode: global
replicas: 2/4
image:
ports: *:80->8080/tcp
id: id_bar
name: bar
mode: replicated
replicas: 2/4
image:
ports: *:80->8080/tcp

View File

@ -0,0 +1,3 @@
NAME NODE PORTS
foobar_baz foo1
foobar_bar foo2

View File

@ -0,0 +1,150 @@
package formatter
import (
"sort"
"strings"
"github.com/docker/docker/pkg/stringid"
)
const (
defaultTrustTagTableFormat = "table {{.SignedTag}}\t{{.Digest}}\t{{.Signers}}"
signedTagNameHeader = "SIGNED TAG"
trustedDigestHeader = "DIGEST"
signersHeader = "SIGNERS"
defaultSignerInfoTableFormat = "table {{.Signer}}\t{{.Keys}}"
signerNameHeader = "SIGNER"
keysHeader = "KEYS"
)
// SignedTagInfo represents all formatted information needed to describe a signed tag:
// Name: name of the signed tag
// Digest: hex encoded digest of the contents
// Signers: list of entities who signed the tag
type SignedTagInfo struct {
Name string
Digest string
Signers []string
}
// SignerInfo represents all formatted information needed to describe a signer:
// Name: name of the signer role
// Keys: the keys associated with the signer
type SignerInfo struct {
Name string
Keys []string
}
// NewTrustTagFormat returns a Format for rendering using a trusted tag Context
func NewTrustTagFormat() Format {
return defaultTrustTagTableFormat
}
// NewSignerInfoFormat returns a Format for rendering a signer role info Context
func NewSignerInfoFormat() Format {
return defaultSignerInfoTableFormat
}
// TrustTagWrite writes the context
func TrustTagWrite(ctx Context, signedTagInfoList []SignedTagInfo) error {
render := func(format func(subContext subContext) error) error {
for _, signedTag := range signedTagInfoList {
if err := format(&trustTagContext{s: signedTag}); err != nil {
return err
}
}
return nil
}
trustTagCtx := trustTagContext{}
trustTagCtx.header = trustTagHeaderContext{
"SignedTag": signedTagNameHeader,
"Digest": trustedDigestHeader,
"Signers": signersHeader,
}
return ctx.Write(&trustTagCtx, render)
}
type trustTagHeaderContext map[string]string
type trustTagContext struct {
HeaderContext
s SignedTagInfo
}
// SignedTag returns the name of the signed tag
func (c *trustTagContext) SignedTag() string {
return c.s.Name
}
// Digest returns the hex encoded digest associated with this signed tag
func (c *trustTagContext) Digest() string {
return c.s.Digest
}
// Signers returns the sorted list of entities who signed this tag
func (c *trustTagContext) Signers() string {
sort.Strings(c.s.Signers)
return strings.Join(c.s.Signers, ", ")
}
// SignerInfoWrite writes the context
func SignerInfoWrite(ctx Context, signerInfoList []SignerInfo) error {
render := func(format func(subContext subContext) error) error {
for _, signerInfo := range signerInfoList {
if err := format(&signerInfoContext{
trunc: ctx.Trunc,
s: signerInfo,
}); err != nil {
return err
}
}
return nil
}
signerInfoCtx := signerInfoContext{}
signerInfoCtx.header = signerInfoHeaderContext{
"Signer": signerNameHeader,
"Keys": keysHeader,
}
return ctx.Write(&signerInfoCtx, render)
}
type signerInfoHeaderContext map[string]string
type signerInfoContext struct {
HeaderContext
trunc bool
s SignerInfo
}
// Keys returns the sorted list of keys associated with the signer
func (c *signerInfoContext) Keys() string {
sort.Strings(c.s.Keys)
truncatedKeys := []string{}
if c.trunc {
for _, keyID := range c.s.Keys {
truncatedKeys = append(truncatedKeys, stringid.TruncateID(keyID))
}
return strings.Join(truncatedKeys, ", ")
}
return strings.Join(c.s.Keys, ", ")
}
// Signer returns the name of the signer
func (c *signerInfoContext) Signer() string {
return c.s.Name
}
// SignerInfoList helps sort []SignerInfo by signer names
type SignerInfoList []SignerInfo
func (signerInfoComp SignerInfoList) Len() int {
return len(signerInfoComp)
}
func (signerInfoComp SignerInfoList) Less(i, j int) bool {
return signerInfoComp[i].Name < signerInfoComp[j].Name
}
func (signerInfoComp SignerInfoList) Swap(i, j int) {
signerInfoComp[i], signerInfoComp[j] = signerInfoComp[j], signerInfoComp[i]
}

View File

@ -0,0 +1,238 @@
package formatter
import (
"bytes"
"testing"
"github.com/docker/docker/pkg/stringid"
"github.com/stretchr/testify/assert"
)
func TestTrustTag(t *testing.T) {
digest := stringid.GenerateRandomID()
trustedTag := "tag"
var ctx trustTagContext
cases := []struct {
trustTagCtx trustTagContext
expValue string
call func() string
}{
{
trustTagContext{
s: SignedTagInfo{Name: trustedTag,
Digest: digest,
Signers: nil,
},
},
digest,
ctx.Digest,
},
{
trustTagContext{
s: SignedTagInfo{Name: trustedTag,
Digest: digest,
Signers: nil,
},
},
trustedTag,
ctx.SignedTag,
},
// Empty signers makes a row with empty string
{
trustTagContext{
s: SignedTagInfo{Name: trustedTag,
Digest: digest,
Signers: nil,
},
},
"",
ctx.Signers,
},
{
trustTagContext{
s: SignedTagInfo{Name: trustedTag,
Digest: digest,
Signers: []string{"alice", "bob", "claire"},
},
},
"alice, bob, claire",
ctx.Signers,
},
// alphabetic signing on Signers
{
trustTagContext{
s: SignedTagInfo{Name: trustedTag,
Digest: digest,
Signers: []string{"claire", "bob", "alice"},
},
},
"alice, bob, claire",
ctx.Signers,
},
}
for _, c := range cases {
ctx = c.trustTagCtx
v := c.call()
if v != c.expValue {
t.Fatalf("Expected %s, was %s\n", c.expValue, v)
}
}
}
func TestTrustTagContextWrite(t *testing.T) {
cases := []struct {
context Context
expected string
}{
// Errors
{
Context{
Format: "{{InvalidFunction}}",
},
`Template parsing error: template: :1: function "InvalidFunction" not defined
`,
},
{
Context{
Format: "{{nil}}",
},
`Template parsing error: template: :1:2: executing "" at <nil>: nil is not a command
`,
},
// Table Format
{
Context{
Format: NewTrustTagFormat(),
},
`SIGNED TAG DIGEST SIGNERS
tag1 deadbeef alice
tag2 aaaaaaaa alice, bob
tag3 bbbbbbbb
`,
},
}
for _, testcase := range cases {
signedTags := []SignedTagInfo{
{Name: "tag1", Digest: "deadbeef", Signers: []string{"alice"}},
{Name: "tag2", Digest: "aaaaaaaa", Signers: []string{"alice", "bob"}},
{Name: "tag3", Digest: "bbbbbbbb", Signers: []string{}},
}
out := bytes.NewBufferString("")
testcase.context.Output = out
err := TrustTagWrite(testcase.context, signedTags)
if err != nil {
assert.EqualError(t, err, testcase.expected)
} else {
assert.Equal(t, testcase.expected, out.String())
}
}
}
// With no trust data, the TrustTagWrite will print an empty table:
// it's up to the caller to decide whether or not to print this versus an error
func TestTrustTagContextEmptyWrite(t *testing.T) {
emptyCase := struct {
context Context
expected string
}{
Context{
Format: NewTrustTagFormat(),
},
`SIGNED TAG DIGEST SIGNERS
`,
}
emptySignedTags := []SignedTagInfo{}
out := bytes.NewBufferString("")
emptyCase.context.Output = out
err := TrustTagWrite(emptyCase.context, emptySignedTags)
assert.NoError(t, err)
assert.Equal(t, emptyCase.expected, out.String())
}
func TestSignerInfoContextEmptyWrite(t *testing.T) {
emptyCase := struct {
context Context
expected string
}{
Context{
Format: NewSignerInfoFormat(),
},
`SIGNER KEYS
`,
}
emptySignerInfo := []SignerInfo{}
out := bytes.NewBufferString("")
emptyCase.context.Output = out
err := SignerInfoWrite(emptyCase.context, emptySignerInfo)
assert.NoError(t, err)
assert.Equal(t, emptyCase.expected, out.String())
}
func TestSignerInfoContextWrite(t *testing.T) {
cases := []struct {
context Context
expected string
}{
// Errors
{
Context{
Format: "{{InvalidFunction}}",
},
`Template parsing error: template: :1: function "InvalidFunction" not defined
`,
},
{
Context{
Format: "{{nil}}",
},
`Template parsing error: template: :1:2: executing "" at <nil>: nil is not a command
`,
},
// Table Format
{
Context{
Format: NewSignerInfoFormat(),
Trunc: true,
},
`SIGNER KEYS
alice key11, key12
bob key21
eve foobarbazqux, key31, key32
`,
},
// No truncation
{
Context{
Format: NewSignerInfoFormat(),
},
`SIGNER KEYS
alice key11, key12
bob key21
eve foobarbazquxquux, key31, key32
`,
},
}
for _, testcase := range cases {
signerInfo := SignerInfoList{
{Name: "alice", Keys: []string{"key11", "key12"}},
{Name: "bob", Keys: []string{"key21"}},
{Name: "eve", Keys: []string{"key31", "key32", "foobarbazquxquux"}},
}
out := bytes.NewBufferString("")
testcase.context.Output = out
err := SignerInfoWrite(testcase.context, signerInfo)
if err != nil {
assert.EqualError(t, err, testcase.expected)
} else {
assert.Equal(t, testcase.expected, out.String())
}
}
}

View File

@ -12,7 +12,6 @@ import (
"regexp"
"runtime"
"github.com/Sirupsen/logrus"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/cli/command/image/build"
@ -22,12 +21,14 @@ import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/idtools"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/docker/pkg/progress"
"github.com/docker/docker/pkg/streamformatter"
"github.com/docker/docker/pkg/urlutil"
units "github.com/docker/go-units"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"golang.org/x/net/context"
)
@ -63,6 +64,7 @@ type buildOptions struct {
target string
imageIDFile string
stream bool
platform string
}
// dockerfileFromStdin returns true when the user specified that the Dockerfile
@ -134,6 +136,7 @@ func NewBuildCommand(dockerCli command.Cli) *cobra.Command {
flags.StringVar(&options.imageIDFile, "iidfile", "", "Write the image ID to the file")
command.AddTrustVerificationFlags(flags)
command.AddPlatformFlag(flags, &options.platform)
flags.BoolVar(&options.squash, "squash", false, "Squash newly built layers into a single new layer")
flags.SetAnnotation("squash", "experimental", nil)
@ -243,6 +246,7 @@ func runBuild(dockerCli command.Cli, options buildOptions) error {
excludes = build.TrimBuildFilesFromExcludes(excludes, relDockerfile, options.dockerfileFromStdin())
buildCtx, err = archive.TarWithOptions(contextDir, &archive.TarOptions{
ExcludePatterns: excludes,
ChownOpts: &idtools.IDPair{UID: 0, GID: 0},
})
if err != nil {
return err
@ -303,8 +307,8 @@ func runBuild(dockerCli command.Cli, options buildOptions) error {
progressOutput = &lastProgressOutput{output: progressOutput}
}
// if up to this point nothing has set the context then we must have have
// another way for sending it(streaming) and set the context to the Dockerfile
// if up to this point nothing has set the context then we must have another
// way for sending it(streaming) and set the context to the Dockerfile
if dockerfileCtx != nil && buildCtx == nil {
buildCtx = dockerfileCtx
}
@ -372,17 +376,18 @@ func runBuild(dockerCli command.Cli, options buildOptions) error {
ExtraHosts: options.extraHosts.GetAll(),
Target: options.target,
RemoteContext: remote,
Platform: options.platform,
}
if s != nil {
go func() {
logrus.Debugf("running session: %v", s.UUID())
logrus.Debugf("running session: %v", s.ID())
if err := s.Run(ctx, dockerCli.Client().DialSession); err != nil {
logrus.Error(err)
cancel() // cancel progress context
}
}()
buildOptions.SessionID = s.UUID()
buildOptions.SessionID = s.ID()
}
response, err := dockerCli.Client().ImageBuild(ctx, body, buildOptions)

View File

@ -17,9 +17,9 @@ import (
"github.com/docker/cli/cli/command/image/build"
cliconfig "github.com/docker/cli/cli/config"
"github.com/docker/docker/api/types/versions"
"github.com/docker/docker/client/session"
"github.com/docker/docker/client/session/filesync"
"github.com/docker/docker/pkg/progress"
"github.com/moby/buildkit/session"
"github.com/moby/buildkit/session/filesync"
"github.com/pkg/errors"
"golang.org/x/time/rate"
)
@ -53,7 +53,9 @@ func addDirToSession(session *session.Session, contextDir string, progressOutput
p := &sizeProgress{out: progressOutput, action: "Streaming build context to Docker daemon"}
workdirProvider := filesync.NewFSSyncProvider(contextDir, excludes)
workdirProvider := filesync.NewFSSyncProvider([]filesync.SyncedDir{
{Dir: contextDir, Excludes: excludes},
})
session.Allow(workdirProvider)
// this will be replaced on parallel build jobs. keep the current
@ -126,18 +128,18 @@ func getBuildSharedKey(dir string) (string, error) {
return hex.EncodeToString(s[:]), nil
}
func tryNodeIdentifier() (out string) {
out = cliconfig.Dir() // return config dir as default on permission error
func tryNodeIdentifier() string {
out := cliconfig.Dir() // return config dir as default on permission error
if err := os.MkdirAll(cliconfig.Dir(), 0700); err == nil {
sessionFile := filepath.Join(cliconfig.Dir(), ".buildNodeID")
if _, err := os.Lstat(sessionFile); err != nil {
if os.IsNotExist(err) { // create a new file with stored randomness
b := make([]byte, 32)
if _, err := rand.Read(b); err != nil {
return
return out
}
if err := ioutil.WriteFile(sessionFile, []byte(hex.EncodeToString(b)), 0600); err != nil {
return
return out
}
}
}
@ -147,5 +149,5 @@ func tryNodeIdentifier() (out string) {
return string(dt)
}
}
return
return out
}

View File

@ -6,18 +6,57 @@ import (
"io/ioutil"
"os"
"path/filepath"
"runtime"
"sort"
"syscall"
"testing"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/internal/test"
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/archive"
"github.com/gotestyourself/gotestyourself/fs"
"github.com/gotestyourself/gotestyourself/skip"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/net/context"
)
func TestRunBuildResetsUidAndGidInContext(t *testing.T) {
skip.IfCondition(t, runtime.GOOS == "windows", "uid and gid not relevant on windows")
dest := fs.NewDir(t, "test-build-context-dest")
defer dest.Remove()
fakeImageBuild := func(_ context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error) {
assert.NoError(t, archive.Untar(context, dest.Path(), nil))
body := new(bytes.Buffer)
return types.ImageBuildResponse{Body: ioutil.NopCloser(body)}, nil
}
cli := test.NewFakeCli(&fakeClient{imageBuildFunc: fakeImageBuild})
dir := fs.NewDir(t, "test-build-context",
fs.WithFile("foo", "some content", fs.AsUser(65534, 65534)),
fs.WithFile("Dockerfile", `
FROM alpine:3.6
COPY foo bar /
`),
)
defer dir.Remove()
options := newBuildOptions()
options.context = dir.Path()
err := runBuild(cli, options)
require.NoError(t, err)
files, err := ioutil.ReadDir(dest.Path())
require.NoError(t, err)
for _, fileInfo := range files {
assert.Equal(t, uint32(0), fileInfo.Sys().(*syscall.Stat_t).Uid)
assert.Equal(t, uint32(0), fileInfo.Sys().(*syscall.Stat_t).Gid)
}
}
func TestRunBuildDockerfileFromStdinWithCompress(t *testing.T) {
dest, err := ioutil.TempDir("", "test-build-compress-dest")
require.NoError(t, err)

View File

@ -37,7 +37,7 @@ func NewPruneCommand(dockerCli command.Cli) *cobra.Command {
fmt.Fprintln(dockerCli.Out(), "Total reclaimed space:", units.HumanSize(float64(spaceReclaimed)))
return nil
},
Tags: map[string]string{"version": "1.25"},
Annotations: map[string]string{"version": "1.25"},
}
flags := cmd.Flags()
@ -65,12 +65,12 @@ func runPrune(dockerCli command.Cli, options pruneOptions) (spaceReclaimed uint6
warning = allImageWarning
}
if !options.force && !command.PromptForConfirmation(dockerCli.In(), dockerCli.Out(), warning) {
return
return 0, "", nil
}
report, err := dockerCli.Client().ImagesPrune(context.Background(), pruneFilters)
if err != nil {
return
return 0, "", err
}
if len(report.ImagesDeleted) > 0 {
@ -85,7 +85,7 @@ func runPrune(dockerCli command.Cli, options pruneOptions) (spaceReclaimed uint6
spaceReclaimed = report.SpaceReclaimed
}
return
return spaceReclaimed, output, nil
}
// RunPrune calls the Image Prune API

View File

@ -6,16 +6,17 @@ import (
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/cli/trust"
"github.com/docker/distribution/reference"
"github.com/docker/docker/registry"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"golang.org/x/net/context"
)
type pullOptions struct {
remote string
all bool
remote string
all bool
platform string
}
// NewPullCommand creates a new `docker pull` command
@ -35,44 +36,39 @@ func NewPullCommand(dockerCli command.Cli) *cobra.Command {
flags := cmd.Flags()
flags.BoolVarP(&opts.all, "all-tags", "a", false, "Download all tagged images in the repository")
command.AddPlatformFlag(flags, &opts.platform)
command.AddTrustVerificationFlags(flags)
return cmd
}
func runPull(dockerCli command.Cli, opts pullOptions) error {
func runPull(cli command.Cli, opts pullOptions) error {
distributionRef, err := reference.ParseNormalizedNamed(opts.remote)
if err != nil {
switch {
case err != nil:
return err
}
if opts.all && !reference.IsNameOnly(distributionRef) {
case opts.all && !reference.IsNameOnly(distributionRef):
return errors.New("tag can't be used with --all-tags/-a")
}
if !opts.all && reference.IsNameOnly(distributionRef) {
case !opts.all && reference.IsNameOnly(distributionRef):
distributionRef = reference.TagNameOnly(distributionRef)
if tagged, ok := distributionRef.(reference.Tagged); ok {
fmt.Fprintf(dockerCli.Out(), "Using default tag: %s\n", tagged.Tag())
fmt.Fprintf(cli.Out(), "Using default tag: %s\n", tagged.Tag())
}
}
// Resolve the Repository name from fqn to RepositoryInfo
repoInfo, err := registry.ParseRepositoryInfo(distributionRef)
ctx := context.Background()
imgRefAndAuth, err := trust.GetImageReferencesAndAuth(ctx, AuthResolver(cli), distributionRef.String())
if err != nil {
return err
}
ctx := context.Background()
authConfig := command.ResolveAuthConfig(ctx, dockerCli, repoInfo.Index)
requestPrivilege := command.RegistryAuthenticationPrivilegedFunc(dockerCli, repoInfo.Index, "pull")
// Check if reference has a digest
_, isCanonical := distributionRef.(reference.Canonical)
if command.IsTrusted() && !isCanonical {
err = trustedPull(ctx, dockerCli, repoInfo, distributionRef, authConfig, requestPrivilege)
err = trustedPull(ctx, cli, imgRefAndAuth, opts.platform)
} else {
err = imagePullPrivileged(ctx, dockerCli, authConfig, reference.FamiliarString(distributionRef), requestPrivilege, opts.all)
err = imagePullPrivileged(ctx, cli, imgRefAndAuth, opts.all, opts.platform)
}
if err != nil {
if strings.Contains(err.Error(), "when fetching 'plugin'") {
@ -80,6 +76,5 @@ func runPull(dockerCli command.Cli, opts pullOptions) error {
}
return err
}
return nil
}

View File

@ -2,11 +2,14 @@ package image
import (
"fmt"
"io"
"io/ioutil"
"strings"
"testing"
"github.com/docker/cli/internal/test"
"github.com/docker/cli/internal/test/testutil"
"github.com/docker/docker/api/types"
"github.com/gotestyourself/gotestyourself/golden"
"github.com/stretchr/testify/assert"
)
@ -32,11 +35,6 @@ func TestNewPullCommandErrors(t *testing.T) {
expectedError: "tag can't be used with --all-tags/-a",
args: []string{"--all-tags", "image:tag"},
},
{
name: "pull-error",
args: []string{"--disable-content-trust=false", "image:tag"},
expectedError: "you are not authorized to perform this operation: server returned 401.",
},
}
for _, tc := range testCases {
cli := test.NewFakeCli(&fakeClient{})
@ -49,20 +47,28 @@ func TestNewPullCommandErrors(t *testing.T) {
func TestNewPullCommandSuccess(t *testing.T) {
testCases := []struct {
name string
args []string
name string
args []string
expectedTag string
}{
{
name: "simple",
args: []string{"image:tag"},
name: "simple",
args: []string{"image:tag"},
expectedTag: "image:tag",
},
{
name: "simple-no-tag",
args: []string{"image"},
name: "simple-no-tag",
args: []string{"image"},
expectedTag: "image:latest",
},
}
for _, tc := range testCases {
cli := test.NewFakeCli(&fakeClient{})
cli := test.NewFakeCli(&fakeClient{
imagePullFunc: func(ref string, options types.ImagePullOptions) (io.ReadCloser, error) {
assert.Equal(t, tc.expectedTag, ref, tc.name)
return ioutil.NopCloser(strings.NewReader("")), nil
},
})
cmd := NewPullCommand(cli)
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)

View File

@ -48,7 +48,7 @@ func runPush(dockerCli command.Cli, remote string) error {
requestPrivilege := command.RegistryAuthenticationPrivilegedFunc(dockerCli, repoInfo.Index, "push")
if command.IsTrusted() {
return trustedPush(ctx, dockerCli, repoInfo, ref, authConfig, requestPrivilege)
return TrustedPush(ctx, dockerCli, repoInfo, ref, authConfig, requestPrivilege)
}
responseBody, err := imagePushPrivileged(ctx, dockerCli, authConfig, ref, requestPrivilege)

View File

@ -9,6 +9,7 @@ import (
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/docker/api/types"
apiclient "github.com/docker/docker/client"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)
@ -56,9 +57,13 @@ func runRemove(dockerCli command.Cli, opts removeOptions, images []string) error
}
var errs []string
var fatalErr = false
for _, img := range images {
dels, err := client.ImageRemove(ctx, img, options)
if err != nil {
if !apiclient.IsErrNotFound(err) {
fatalErr = true
}
errs = append(errs, err.Error())
} else {
for _, del := range dels {
@ -73,7 +78,7 @@ func runRemove(dockerCli command.Cli, opts removeOptions, images []string) error
if len(errs) > 0 {
msg := strings.Join(errs, "\n")
if !opts.force {
if !opts.force || fatalErr {
return errors.New(msg)
}
fmt.Fprintf(dockerCli.Err(), msg)

View File

@ -13,6 +13,18 @@ import (
"github.com/stretchr/testify/assert"
)
type notFound struct {
imageID string
}
func (n notFound) Error() string {
return fmt.Sprintf("Error: No such image: %s", n.imageID)
}
func (n notFound) NotFound() bool {
return true
}
func TestNewRemoveCommandAlias(t *testing.T) {
cmd := newRemoveCommand(test.NewFakeCli(&fakeClient{}))
assert.True(t, cmd.HasAlias("rmi"))
@ -31,6 +43,15 @@ func TestNewRemoveCommandErrors(t *testing.T) {
name: "wrong args",
expectedError: "requires at least 1 argument.",
},
{
name: "ImageRemove fail with force option",
args: []string{"-f", "image1"},
expectedError: "error removing image",
imageRemoveFunc: func(image string, options types.ImageRemoveOptions) ([]types.ImageDeleteResponseItem, error) {
assert.Equal(t, "image1", image)
return []types.ImageDeleteResponseItem{}, errors.Errorf("error removing image")
},
},
{
name: "ImageRemove fail",
args: []string{"arg1"},
@ -43,12 +64,14 @@ func TestNewRemoveCommandErrors(t *testing.T) {
},
}
for _, tc := range testCases {
cmd := NewRemoveCommand(test.NewFakeCli(&fakeClient{
imageRemoveFunc: tc.imageRemoveFunc,
}))
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
testutil.ErrorContains(t, cmd.Execute(), tc.expectedError)
t.Run(tc.name, func(t *testing.T) {
cmd := NewRemoveCommand(test.NewFakeCli(&fakeClient{
imageRemoveFunc: tc.imageRemoveFunc,
}))
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
testutil.ErrorContains(t, cmd.Execute(), tc.expectedError)
})
}
}
@ -57,7 +80,7 @@ func TestNewRemoveCommandSuccess(t *testing.T) {
name string
args []string
imageRemoveFunc func(image string, options types.ImageRemoveOptions) ([]types.ImageDeleteResponseItem, error)
expectedErrMsg string
expectedStderr string
}{
{
name: "Image Deleted",
@ -68,14 +91,16 @@ func TestNewRemoveCommandSuccess(t *testing.T) {
},
},
{
name: "Image Deleted with force option",
name: "Image not found with force option",
args: []string{"-f", "image1"},
imageRemoveFunc: func(image string, options types.ImageRemoveOptions) ([]types.ImageDeleteResponseItem, error) {
assert.Equal(t, "image1", image)
return []types.ImageDeleteResponseItem{}, errors.Errorf("error removing image")
assert.Equal(t, true, options.Force)
return []types.ImageDeleteResponseItem{}, notFound{"image1"}
},
expectedErrMsg: "error removing image",
expectedStderr: "Error: No such image: image1",
},
{
name: "Image Untagged",
args: []string{"image1"},
@ -96,14 +121,14 @@ func TestNewRemoveCommandSuccess(t *testing.T) {
},
}
for _, tc := range testCases {
cli := test.NewFakeCli(&fakeClient{imageRemoveFunc: tc.imageRemoveFunc})
cmd := NewRemoveCommand(cli)
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
assert.NoError(t, cmd.Execute())
if tc.expectedErrMsg != "" {
assert.Equal(t, tc.expectedErrMsg, cli.ErrBuffer().String())
}
golden.Assert(t, cli.OutBuffer().String(), fmt.Sprintf("remove-command-success.%s.golden", tc.name))
t.Run(tc.name, func(t *testing.T) {
cli := test.NewFakeCli(&fakeClient{imageRemoveFunc: tc.imageRemoveFunc})
cmd := NewRemoveCommand(cli)
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
assert.NoError(t, cmd.Execute())
assert.Equal(t, tc.expectedStderr, cli.ErrBuffer().String())
golden.Assert(t, cli.OutBuffer().String(), fmt.Sprintf("remove-command-success.%s.golden", tc.name))
})
}
}

View File

@ -5,20 +5,20 @@ import (
"encoding/json"
"fmt"
"io"
"path"
"sort"
"github.com/Sirupsen/logrus"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/cli/trust"
"github.com/docker/distribution/reference"
"github.com/docker/docker/api/types"
registrytypes "github.com/docker/docker/api/types/registry"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/docker/registry"
"github.com/docker/notary/client"
"github.com/docker/notary/tuf/data"
"github.com/opencontainers/go-digest"
digest "github.com/opencontainers/go-digest"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/theupdateframework/notary/client"
"github.com/theupdateframework/notary/tuf/data"
"golang.org/x/net/context"
)
@ -28,8 +28,8 @@ type target struct {
size int64
}
// trustedPush handles content trust pushing of an image
func trustedPush(ctx context.Context, cli command.Cli, repoInfo *registry.RepositoryInfo, ref reference.Named, authConfig types.AuthConfig, requestPrivilege types.RequestPrivilegeFunc) error {
// TrustedPush handles content trust pushing of an image
func TrustedPush(ctx context.Context, cli command.Cli, repoInfo *registry.RepositoryInfo, ref reference.Named, authConfig types.AuthConfig, requestPrivilege types.RequestPrivilegeFunc) error {
responseBody, err := imagePushPrivileged(ctx, cli, authConfig, ref, requestPrivilege)
if err != nil {
return err
@ -84,7 +84,7 @@ func PushTrustedReference(streams command.Streams, repoInfo *registry.Repository
if err := jsonmessage.DisplayJSONMessagesToStream(in, streams.Out(), nil); err != nil {
return err
}
fmt.Fprintln(streams.Out(), "No tag specified, skipping trust metadata push")
fmt.Fprintln(streams.Err(), "No tag specified, skipping trust metadata push")
return nil
}
@ -97,31 +97,29 @@ func PushTrustedReference(streams command.Streams, repoInfo *registry.Repository
}
if target == nil {
fmt.Fprintln(streams.Out(), "No targets found, please provide a specific tag in order to sign it")
return nil
return errors.Errorf("no targets found, please provide a specific tag in order to sign it")
}
fmt.Fprintln(streams.Out(), "Signing and pushing trust metadata")
repo, err := trust.GetNotaryRepository(streams, repoInfo, authConfig, "push", "pull")
repo, err := trust.GetNotaryRepository(streams.In(), streams.Out(), command.UserAgent(), repoInfo, &authConfig, "push", "pull")
if err != nil {
fmt.Fprintf(streams.Out(), "Error establishing connection to notary repository: %s\n", err)
return err
return errors.Wrap(err, "error establishing connection to trust repository")
}
// get the latest repository metadata so we can figure out which roles to sign
err = repo.Update(false)
_, err = repo.ListTargets()
switch err.(type) {
case client.ErrRepoNotInitialized, client.ErrRepositoryNotExist:
keys := repo.CryptoService.ListKeys(data.CanonicalRootRole)
keys := repo.GetCryptoService().ListKeys(data.CanonicalRootRole)
var rootKeyID string
// always select the first root key
if len(keys) > 0 {
sort.Strings(keys)
rootKeyID = keys[0]
} else {
rootPublicKey, err := repo.CryptoService.Create(data.CanonicalRootRole, "", data.ECDSAKey)
rootPublicKey, err := repo.GetCryptoService().Create(data.CanonicalRootRole, "", data.ECDSAKey)
if err != nil {
return err
}
@ -136,7 +134,7 @@ func PushTrustedReference(streams command.Streams, repoInfo *registry.Repository
err = repo.AddTarget(target, data.CanonicalTargetsRole)
case nil:
// already initialized and we have successfully downloaded the latest metadata
err = addTargetToAllSignableRoles(repo, target)
err = AddTargetToAllSignableRoles(repo, target)
default:
return trust.NotaryError(repoInfo.Name.Name(), err)
}
@ -146,59 +144,24 @@ func PushTrustedReference(streams command.Streams, repoInfo *registry.Repository
}
if err != nil {
fmt.Fprintf(streams.Out(), "Failed to sign %q:%s - %s\n", repoInfo.Name.Name(), tag, err.Error())
err = errors.Wrapf(err, "failed to sign %s:%s", repoInfo.Name.Name(), tag)
return trust.NotaryError(repoInfo.Name.Name(), err)
}
fmt.Fprintf(streams.Out(), "Successfully signed %q:%s\n", repoInfo.Name.Name(), tag)
fmt.Fprintf(streams.Out(), "Successfully signed %s:%s\n", repoInfo.Name.Name(), tag)
return nil
}
// Attempt to add the image target to all the top level delegation roles we can
// AddTargetToAllSignableRoles attempts to add the image target to all the top level delegation roles we can
// (based on whether we have the signing key and whether the role's path allows
// us to).
// If there are no delegation roles, we add to the targets role.
func addTargetToAllSignableRoles(repo *client.NotaryRepository, target *client.Target) error {
var signableRoles []string
// translate the full key names, which includes the GUN, into just the key IDs
allCanonicalKeyIDs := make(map[string]struct{})
for fullKeyID := range repo.CryptoService.ListAllKeys() {
allCanonicalKeyIDs[path.Base(fullKeyID)] = struct{}{}
}
allDelegationRoles, err := repo.GetDelegationRoles()
func AddTargetToAllSignableRoles(repo client.Repository, target *client.Target) error {
signableRoles, err := trust.GetSignableRoles(repo, target)
if err != nil {
return err
}
// if there are no delegation roles, then just try to sign it into the targets role
if len(allDelegationRoles) == 0 {
return repo.AddTarget(target, data.CanonicalTargetsRole)
}
// there are delegation roles, find every delegation role we have a key for, and
// attempt to sign into into all those roles.
for _, delegationRole := range allDelegationRoles {
// We do not support signing any delegation role that isn't a direct child of the targets role.
// Also don't bother checking the keys if we can't add the target
// to this role due to path restrictions
if path.Dir(delegationRole.Name) != data.CanonicalTargetsRole || !delegationRole.CheckPaths(target.Name) {
continue
}
for _, canonicalKeyID := range delegationRole.KeyIDs {
if _, ok := allCanonicalKeyIDs[canonicalKeyID]; ok {
signableRoles = append(signableRoles, delegationRole.Name)
break
}
}
}
if len(signableRoles) == 0 {
return errors.Errorf("no valid signing keys for delegation roles")
}
return repo.AddTarget(target, signableRoles...)
}
@ -217,57 +180,13 @@ func imagePushPrivileged(ctx context.Context, cli command.Cli, authConfig types.
}
// trustedPull handles content trust pulling of an image
func trustedPull(ctx context.Context, cli command.Cli, repoInfo *registry.RepositoryInfo, ref reference.Named, authConfig types.AuthConfig, requestPrivilege types.RequestPrivilegeFunc) error {
var refs []target
notaryRepo, err := trust.GetNotaryRepository(cli, repoInfo, authConfig, "pull")
func trustedPull(ctx context.Context, cli command.Cli, imgRefAndAuth trust.ImageRefAndAuth, platform string) error {
refs, err := getTrustedPullTargets(cli, imgRefAndAuth)
if err != nil {
fmt.Fprintf(cli.Out(), "Error establishing connection to trust repository: %s\n", err)
return err
}
if tagged, isTagged := ref.(reference.NamedTagged); !isTagged {
// List all targets
targets, err := notaryRepo.ListTargets(trust.ReleasesRole, data.CanonicalTargetsRole)
if err != nil {
return trust.NotaryError(ref.Name(), err)
}
for _, tgt := range targets {
t, err := convertTarget(tgt.Target)
if err != nil {
fmt.Fprintf(cli.Out(), "Skipping target for %q\n", reference.FamiliarName(ref))
continue
}
// Only list tags in the top level targets role or the releases delegation role - ignore
// all other delegation roles
if tgt.Role != trust.ReleasesRole && tgt.Role != data.CanonicalTargetsRole {
continue
}
refs = append(refs, t)
}
if len(refs) == 0 {
return trust.NotaryError(ref.Name(), errors.Errorf("No trusted tags for %s", ref.Name()))
}
} else {
t, err := notaryRepo.GetTargetByName(tagged.Tag(), trust.ReleasesRole, data.CanonicalTargetsRole)
if err != nil {
return trust.NotaryError(ref.Name(), err)
}
// Only get the tag if it's in the top level targets role or the releases delegation role
// ignore it if it's in any other delegation roles
if t.Role != trust.ReleasesRole && t.Role != data.CanonicalTargetsRole {
return trust.NotaryError(ref.Name(), errors.Errorf("No trust data for %s", tagged.Tag()))
}
logrus.Debugf("retrieving target for %s role\n", t.Role)
r, err := convertTarget(t.Target)
if err != nil {
return err
}
refs = append(refs, r)
}
ref := imgRefAndAuth.Reference()
for i, r := range refs {
displayTag := r.name
if displayTag != "" {
@ -279,7 +198,11 @@ func trustedPull(ctx context.Context, cli command.Cli, repoInfo *registry.Reposi
if err != nil {
return err
}
if err := imagePullPrivileged(ctx, cli, authConfig, reference.FamiliarString(trustedRef), requestPrivilege, false); err != nil {
updatedImgRefAndAuth, err := trust.GetImageReferencesAndAuth(ctx, AuthResolver(cli), trustedRef.String())
if err != nil {
return err
}
if err := imagePullPrivileged(ctx, cli, updatedImgRefAndAuth, false, platform); err != nil {
return err
}
@ -295,19 +218,70 @@ func trustedPull(ctx context.Context, cli command.Cli, repoInfo *registry.Reposi
return nil
}
// imagePullPrivileged pulls the image and displays it to the output
func imagePullPrivileged(ctx context.Context, cli command.Cli, authConfig types.AuthConfig, ref string, requestPrivilege types.RequestPrivilegeFunc, all bool) error {
func getTrustedPullTargets(cli command.Cli, imgRefAndAuth trust.ImageRefAndAuth) ([]target, error) {
notaryRepo, err := cli.NotaryClient(imgRefAndAuth, trust.ActionsPullOnly)
if err != nil {
return nil, errors.Wrap(err, "error establishing connection to trust repository")
}
encodedAuth, err := command.EncodeAuthToBase64(authConfig)
ref := imgRefAndAuth.Reference()
tagged, isTagged := ref.(reference.NamedTagged)
if !isTagged {
// List all targets
targets, err := notaryRepo.ListTargets(trust.ReleasesRole, data.CanonicalTargetsRole)
if err != nil {
return nil, trust.NotaryError(ref.Name(), err)
}
var refs []target
for _, tgt := range targets {
t, err := convertTarget(tgt.Target)
if err != nil {
fmt.Fprintf(cli.Err(), "Skipping target for %q\n", reference.FamiliarName(ref))
continue
}
// Only list tags in the top level targets role or the releases delegation role - ignore
// all other delegation roles
if tgt.Role != trust.ReleasesRole && tgt.Role != data.CanonicalTargetsRole {
continue
}
refs = append(refs, t)
}
if len(refs) == 0 {
return nil, trust.NotaryError(ref.Name(), errors.Errorf("No trusted tags for %s", ref.Name()))
}
return refs, nil
}
t, err := notaryRepo.GetTargetByName(tagged.Tag(), trust.ReleasesRole, data.CanonicalTargetsRole)
if err != nil {
return nil, trust.NotaryError(ref.Name(), err)
}
// Only get the tag if it's in the top level targets role or the releases delegation role
// ignore it if it's in any other delegation roles
if t.Role != trust.ReleasesRole && t.Role != data.CanonicalTargetsRole {
return nil, trust.NotaryError(ref.Name(), errors.Errorf("No trust data for %s", tagged.Tag()))
}
logrus.Debugf("retrieving target for %s role", t.Role)
r, err := convertTarget(t.Target)
return []target{r}, err
}
// imagePullPrivileged pulls the image and displays it to the output
func imagePullPrivileged(ctx context.Context, cli command.Cli, imgRefAndAuth trust.ImageRefAndAuth, all bool, platform string) error {
ref := reference.FamiliarString(imgRefAndAuth.Reference())
encodedAuth, err := command.EncodeAuthToBase64(*imgRefAndAuth.AuthConfig())
if err != nil {
return err
}
requestPrivilege := command.RegistryAuthenticationPrivilegedFunc(cli, imgRefAndAuth.RepoInfo().Index, "pull")
options := types.ImagePullOptions{
RegistryAuth: encodedAuth,
PrivilegeFunc: requestPrivilege,
All: all,
Platform: platform,
}
responseBody, err := cli.Client().ImagePull(ctx, ref, options)
if err != nil {
return err
@ -335,10 +309,9 @@ func TrustedReference(ctx context.Context, cli command.Cli, ref reference.NamedT
// Resolve the Auth config relevant for this server
authConfig := command.ResolveAuthConfig(ctx, cli, repoInfo.Index)
notaryRepo, err := trust.GetNotaryRepository(cli, repoInfo, authConfig, "pull")
notaryRepo, err := trust.GetNotaryRepository(cli.In(), cli.Out(), command.UserAgent(), repoInfo, &authConfig, "pull")
if err != nil {
fmt.Fprintf(cli.Out(), "Error establishing connection to trust repository: %s\n", err)
return nil, err
return nil, errors.Wrap(err, "error establishing connection to trust repository")
}
t, err := notaryRepo.GetTargetByName(ref.Tag(), trust.ReleasesRole, data.CanonicalTargetsRole)
@ -348,14 +321,13 @@ func TrustedReference(ctx context.Context, cli command.Cli, ref reference.NamedT
// Only list tags in the top level targets role or the releases delegation role - ignore
// all other delegation roles
if t.Role != trust.ReleasesRole && t.Role != data.CanonicalTargetsRole {
return nil, trust.NotaryError(repoInfo.Name.Name(), errors.Errorf("No trust data for %s", ref.Tag()))
return nil, trust.NotaryError(repoInfo.Name.Name(), client.ErrNoSuchTarget(ref.Tag()))
}
r, err := convertTarget(t.Target)
if err != nil {
return nil, err
}
return reference.WithDigest(reference.TrimNamed(ref), r.digest)
}
@ -378,7 +350,14 @@ func TagTrusted(ctx context.Context, cli command.Cli, trustedRef reference.Canon
familiarRef := reference.FamiliarString(ref)
trustedFamiliarRef := reference.FamiliarString(trustedRef)
fmt.Fprintf(cli.Out(), "Tagging %s as %s\n", trustedFamiliarRef, familiarRef)
fmt.Fprintf(cli.Err(), "Tagging %s as %s\n", trustedFamiliarRef, familiarRef)
return cli.Client().ImageTag(ctx, trustedFamiliarRef, familiarRef)
}
// AuthResolver returns an auth resolver function from a command.Cli
func AuthResolver(cli command.Cli) func(ctx context.Context, index *registrytypes.IndexInfo) types.AuthConfig {
return func(ctx context.Context, index *registrytypes.IndexInfo) types.AuthConfig {
return command.ResolveAuthConfig(ctx, cli, index)
}
}

View File

@ -1,12 +1,18 @@
package image
import (
"io/ioutil"
"os"
"testing"
"github.com/docker/cli/cli/trust"
registrytypes "github.com/docker/docker/api/types/registry"
"github.com/docker/docker/registry"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/theupdateframework/notary/client"
"github.com/theupdateframework/notary/passphrase"
"github.com/theupdateframework/notary/trustpinning"
)
func unsetENV() {
@ -55,3 +61,15 @@ func TestNonOfficialTrustServer(t *testing.T) {
t.Fatalf("Expected server to be %s, got %s", expectedStr, output)
}
}
func TestAddTargetToAllSignableRolesError(t *testing.T) {
tmpDir, err := ioutil.TempDir("", "notary-test-")
assert.NoError(t, err)
defer os.RemoveAll(tmpDir)
notaryRepo, err := client.NewFileCachedRepository(tmpDir, "gun", "https://localhost", nil, passphrase.ConstantRetriever("password"), trustpinning.TrustPinConfig{})
require.NoError(t, err)
target := client.Target{}
err = AddTargetToAllSignableRoles(notaryRepo, &target)
assert.EqualError(t, err, "client is offline")
}

View File

@ -7,10 +7,10 @@ import (
"strings"
"text/template"
"github.com/Sirupsen/logrus"
"github.com/docker/cli/cli"
"github.com/docker/cli/templates"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
// Inspector defines an interface to implement to process elements

Some files were not shown because too many files have changed in this diff Show More