Compare commits

..

1177 Commits

Author SHA1 Message Date
9ee9f402cd Merge pull request #75 from andrewhsu/v3
[18.03] bump version to 18.03.1-ce
2018-04-25 21:27:49 -07:00
c32349b9a9 Merge pull request #77 from andrewhsu/c3
[18.03] update changelog for 18.03.1-ce
2018-04-25 21:27:33 -07:00
6d0d01b238 Merge pull request #74 from andrewhsu/c03
[18.03] vndr hcsshim to 79062a5
2018-04-25 17:51:37 -07:00
fda40de70c update changelog for 18.03.1-ce
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2018-04-26 00:22:09 +00:00
fdb8850492 bump version to 18.03.1-ce
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2018-04-26 00:15:38 +00:00
56e55727a8 vndr hcsshim to 79062a5
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2018-04-25 22:09:31 +00:00
fcdc984cfd Merge pull request #517 from jose-bigio/18.03_version_bump
[18.03] version bump to 18.03.1-ce-rc2
2018-04-18 23:23:53 -07:00
8921f8bec1 Merge pull request #518 from jose-bigio/18.03_changelog
[18.03] Update changelog for 18.03.1
2018-04-18 23:23:35 -07:00
6f1fe53965 fixup changelog
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2018-04-19 06:22:38 +00:00
af03317180 Merge pull request #507 from thaJeztah/18.03-backport-plugin_exec_fixes
[18.03] Make sure plugin container is removed on failure
2018-04-18 21:53:37 -07:00
76cbc5d636 Merge pull request #509 from cpuguy83/18.03_backport_authz_buffer_fix_36595
[18.03] backport authz buffer fix
2018-04-18 20:42:44 -07:00
14b513f77d Merge pull request #520 from thaJeztah/18.03-backport-libcontainerd_client_locking
[18.03] Relax global client lock on containerd restore.
2018-04-18 20:35:00 -07:00
a78f916dfb Add more updates for 18.03.1-ce
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2018-04-19 00:25:35 +00:00
be3f367578 Merge pull request #515 from thaJeztah/18.03-backport-election
[18.03] Increase raft ElectionTick to 10xHeartbeatTick
2018-04-18 17:01:37 -07:00
db5f5c037d Merge pull request #516 from thaJeztah/18.03-backport-booo
[18.03] Don't make container mount unbindable
2018-04-18 17:01:03 -07:00
905f71561a Relax global client lock on containerd restore.
This unblocks the client to take other restore requests and makes sure
that a long/stuck request can't block the client forever.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 806700e410a1b30aa1033d71d825e57880c75298)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-18 16:49:38 -07:00
60dc869e44 Limit authz response buffer
When the authz response buffer limit is hit, perform a flush.
This prevents excessive buffer sizes, especially on large responses
(e.g. `/containers/<id>/archive` or `/containers/<id>/export`).

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 74f8e47352e71aad4015d8d9dea8f16e7a055863)
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-18 16:27:50 -07:00
ce2f874741 Make sure plugin container is removed on failure
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit f81172b9031160218e51fb2a7dbeee19962a60a9)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-18 16:24:51 -07:00
e79a05793b Merge pull request #513 from thaJeztah/18.03-backport-test-improvements
[18.03] Updates to integration tests, migrate to "gotestyourself"
2018-04-18 16:19:12 -07:00
4fd6bf8c4a Merge pull request #514 from thaJeztah/18.03-bump-libnetwork
[18.03] Update libnetwork
2018-04-18 15:44:33 -07:00
3d5ce4f418 Merge pull request #477 from thaJeztah/18.03-distribution-cache
[18.03] fix(distribution): digest cache should not be moved if it was an auth error
2018-04-18 15:27:38 -07:00
edee73b51b Merge pull request #511 from thaJeztah/18.03-backport-fix-stack-deploy-after-force
[18.03] Fix stack deploy re-deploying service after --force
2018-04-18 14:48:17 -07:00
02e93e419f Merge pull request #479 from thaJeztah/18.03-err_return
[18.03] Add missing error return for plugin creation.
2018-04-18 14:47:52 -07:00
68acf3c023 Merge pull request #468 from thaJeztah/18.03-do-not-panic
[18.03] ExportContainer: do not panic
2018-04-18 14:47:18 -07:00
b522d934b9 Merge pull request #498 from thaJeztah/18.03-backport-fix-version-output
[18.03] Fix docker version output alignment
2018-04-18 14:46:15 -07:00
029cfa0956 Merge pull request #519 from thaJeztah/18.03-backport-docs-fixes
[18.03] backport docs and completion fixes
2018-04-18 14:45:46 -07:00
da69d9e253 Add bash completion for secret|config create --template-driver
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 43024e2d57)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-18 10:18:01 -07:00
79e8ae0e9d docker load: Typofix in examples
Remove the double "docker docker" from example

Signed-off-by: Henry Ne <henrynmail-github@yahoo.de>
(cherry picked from commit 79c489d812)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-18 10:17:55 -07:00
39f7e7efd0 build.md: Document --build-arg without value
This use case is currently _working correctly_, which is nice, but there is no documentation to be found about it. This PR fixes that.

Signed-off-by: Per Lundberg <perlun@gmail.com>
(cherry picked from commit 82c23208ee)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-18 10:17:50 -07:00
766c24e554 Update examples to reflect docker-runc's runtime root for plugins.
Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
(cherry picked from commit 5fd9eab3d0)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-18 10:17:44 -07:00
4e72a2fd51 Fix --format example for docker history
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 2f7bf40e73)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-18 10:17:39 -07:00
24306165c5 Use printf, not echo when creating secrets
Update the docs so that users don't use `echo` when creating
secrets from STDIN. `echo` adds a trailing new line, so users
will probably be confused when their passwords don't work.

Signed-off-by: Joao Fernandes <joao.fernandes@docker.com>
(cherry picked from commit 5238f3e93e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-18 10:17:33 -07:00
27540de1ad Update build.md
Explicitly stated that you must add --build-arg for each build argument.
Added multiple arguments to example of `--build-arg` usage.
Fix for https://github.com/docker/docker.github.io/issues/6248

Signed-off-by: Preston Cowley <cowlinator@gmail.com>
(cherry picked from commit ad44e2d45e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-18 10:17:26 -07:00
1df656a2f0 Clarify behaviour of restart policy in run ref doc
This clarifies that the behaviour of `unless-stopped` will restart the container on daemon start.  This was implied before, but now the restart-on-daemon-start behaviour is mentioned directly.

Signed-off-by: David Beitey <david@davidjb.com>
(cherry picked from commit 8ca237054f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-18 10:17:18 -07:00
bb68afd0fc Docs touch-ups for "autoremove" and broken anchor
`--rm` moved to the daemon, so is now also supported
when combined with `-d`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit e9ce688d6e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-18 10:17:11 -07:00
35fc88bcd9 Update changelog for 18.03.1
Signed-off-by: jose-bigio <jose.bigio@docker.com>
2018-04-18 09:51:43 -07:00
b45862f481 Version bum to 18.03.1-ce-rc2
Signed-off-by: jose-bigio <jose.bigio@docker.com>
2018-04-18 09:17:16 -07:00
72f31848f8 Don't make container mount unbindable
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit 4c000662feb3c8e3d63cbcb044a47f627cd9bb45)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 23:55:02 -07:00
0e66a94980 Increase raft ElectionTick to 10xHeartbeatTick
Signed-off-by: Anshul Pundir <anshul.pundir@docker.com>
(cherry picked from commit 6abee2008b314a65553202b15d9a333d171e3433)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 23:43:11 -07:00
85143bcb4d Bump libnetwork commit
Full diff
5c1218c956...c15b372ef2

Fixes a panic on concurrent read/write to a map.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 248aed5766ba330ab8cb2b10b03b6ce57dc64283)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 19:24:33 -07:00
a4b56ba187 update libnetwork to improve scalabiltiy of bridge network isolation rules
* libnetwork#2121: Retry other external DNS servers on ServFail
* libnetwork#2125: Fix README flag and expose orphan network peers
* libnetwork#2126: Adding goreport card
* libnetwork#2130: Modify awk to use cut in check_ip_overlap
* libnetwork#2117: [Carry 1534] Improve scalabiltiy of bridge network isolation rules

Full changes: 2bf63300c5...5c1218c956

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
(cherry picked from commit b159da19734269c4a162763ebfa28dff07b703f3)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 19:24:27 -07:00
5a884e1a0d Remove (now) extra call to sb.DisableService()
This call was added as part of commit a042e5a20 and at the time was
useful.  sandbox.DisableService() basically calls
endpoint.deleteServiceInfoFromCluster() for every endpoint in the
sandbox.  However, with the libnetwork change, endpoint.sbLeave()
invokes endpoint.deleteServiceInfoFromCluster(). The releaseNetwork()
call invokes sandbox.Delete() immediately after
sandbox.DisableService().  The sandbox.Delete() in turn ultimately
invokes endpoint.sbLeave() for every endpoint in the sandbox which thus
removes the endpoint's load balancing entry via
endpoint.deleteServiceInfoFromCluster().  So the call to
sandbox.DisableService() is now redundant.

It is noteworthy that, while redundant, the presence of the call would
not cause errors.  It would just be sub-optimal.  The DisableService()
call would cause libnetwork to down-weight the load balancing entries
while the call to sandbox.Delete() would cause it to remove the entries
immediately afterwards.  Aside from the wasted computation, the extra
call would also propagate an extra state change in the networkDB gossip
messages.  So, overall, it is much better to just avoid the extra
overhead.

Signed-off-by: Chris Telfer <ctelfer@docker.com>
(cherry picked from commit c27417aa7de46daa415600b39fc8a9c411c8c493)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 19:24:20 -07:00
0fae0d5a40 Import libnetwork fix for rolling updates
This patch allows endpoints to complete servicing connections while
being removed from a service.  The fix is entirely within libnetwork
and requires no changes to the moby codebase proper.  It operates
by initially down-weighting a container endpoint in the load balancer
to 0 while keeping the endpoint present in the load balancer.  This
allows traffic to continue to flow to the endpoint while preventing new
connections from going to the endpoint.  This allows the container
to complete requests during the "stop_grace_period" and then exit when
finished without interruption of service.

This change requires propagating the status of disabled service
endpoints via the networkDB.  Accordingly, the patch includes both code
to generate and handle service update messages.  It also augments the
service structure with a ServiceDisabled boolean to convey whether an
endpoint should ultimately be removed or just disabled.  This,
naturally, required a rebuild of the protocol buffer code.

The protocol buffer encoding is designed to support additions of fields
to messages in a backwards-compatible manner.  Protocol buffer
unmarshalling code automatically skips past any fields that it isn't
aware of.  As a result, an older moby daemon without this fix can
receive and will process correctly networkDB messages from newer moby
daemons with this patch.

As it turns out, the additional field is simply a bool that is otherwise
irrelevent on networkDB create and delete events.  So its absence in
older moby daemon processing has no impact.  However, the fix leverages
the "update" networkDB message which was previously unused in
libnetwork.  Although older libnetwork implementations parse the message
cleanly, they will see the message as unexpected and as such issue a log
at error level indicating the receipt of such.

Other than this there should be no other negative impact for use of this
patch in mixed environments. (Although older mobys won't be able to
gracefully downgrade connections on their nodes of course.)

Signed-off-by: Chris Telfer <ctelfer@docker.com>
(cherry picked from commit 50dbdeff9fd186bb0e9926996436e1f56529a831)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 19:24:13 -07:00
608b278d01 Fix a misused network object name
A minor nit. `test01` never been created and used in
`TestDockerNetworkInspectCustomSpecified()` function, so correct it.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
(cherry picked from commit f041953d04bffa2be05466173f02dd016c68286d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 19:11:29 -07:00
faccf7d3a7 remove the retries for service update
Signed-off-by: Anda Xu <anda.xu@docker.com>
(cherry picked from commit 7380935331f0c35315003578258f6c1f47c1a586)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 19:08:23 -07:00
04b5ed6c10 Migrate image tag tests from integration-cli to api tests
This fix migrates image tag tests from integration-cli to api tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 9bcb960508a6066811cffcca1e35ca44d7f1cf94)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 19:06:13 -07:00
7974841233 Move fakecontext, fakegit and fakestorage to internal/test
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 062564084a22f71cf5807ae5dfad7d29afb12e04)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 18:42:10 -07:00
f70c483990 Some enhancement in integration tests
This fix converts some `client.ContainerCreate` to `container.Create`,
and removes some unneeded `name` fields when test containers are created.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit ab9bb47b05b1dde445a5e4ba78ae97303208dc8b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 18:34:06 -07:00
49acaa1f03 Small daemon refactoring and add swarm init/join helpers
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 239a8a518904dfb51fe62087d8702519c20ce808)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 18:33:54 -07:00
09fa7b76b7 Migrate test-integration-cli experimental build tests to integration
All `docker build` tests that require an `ExperimentalDaemon` are
migrated to `integration/build` package and start an experimental
daemon to test on it.

The end goal being to remove the `experimental` builds.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 183076e89df64928bd2e94ad0da9725b482367cd)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 18:33:46 -07:00
b11c120bdf Clean some integration-cli/fixtures package/files
- Move go package used by both `integration-cli` and `integration` to
  `internal/test/fixtures`.
- Remove fixtures that are not used anymore (moved to `docker/cli` a
  while ago) : deploy, notary, secrets.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 5f56503f583f21d655394f755f71849381bd58c7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 18:29:31 -07:00
f160c829fb Move and refactor integration-cli/registry to internal/test
- Move the code from `integration-cli` to `internal/test`.
- Use `testingT` and `assert` when creating the registry.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 66de2e6e3b6d927a3396743cd7c363aa9f7b776e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 18:29:23 -07:00
fa03812525 Move ipvlan and macvlan tests on their own folder…
… making each folder/suites quicker to run

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit a3323d2e4349b7e8d449c6e571ca3d4aa3e53d63)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 18:24:06 -07:00
997850a2f2 Refactor macvlan tests a bit
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 0ab6116ce868a0fc671a49a89696e3a1ce35e26d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 18:23:56 -07:00
cb93f50ae0 Migrate test-integration-cli experimental ipvlan test to integration
All `Ipvlan` related test on `DockerSuite` and `DockerNetworkSuite`
are migrated to `ipvlan_test.go`.

The end goal being to remove the `experimental` builds.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 24f934751120ea420b7ba4d2e314df805f3eff06)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 18:23:46 -07:00
174c840b96 Make internal/test/daemon.Daemon swarm aware
This remove the daemon.Swarm construction by make the new test Daemon
struct aware of swarm.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 83d18cf4e3e84055f7034816eed2a10c04e777ca)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 18:23:34 -07:00
e0b31bfb7b Using the default PollSettings function
Using the default PollSettings functions to adjust the timeout
value instead of changing the value each time when needed.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
(cherry picked from commit b8912feeffcdfd489c9fc1212277840adac2719c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 18:23:21 -07:00
176c10200c Add default pollSettings adjustment routines
Add the default function per resource to override the `pollSettings`
which will be re-used where it's needed.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
(cherry picked from commit ee6959addc5664a5c55765f2c721f84414ea4779)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 18:23:13 -07:00
16e1ab0f89 Fix for Flaky test TestServiceWithPredefinedNetwork
TestServiceWithPredefinedNetwork test case was failing
	at times. To fix the issue, added new API to check
	for services after we clean up all services. Tested
	multiple times and this sould fix flaky issue.

Signed-off-by: selansen <elango.siva@docker.com>
(cherry picked from commit dabffd806c98ab13dbc25e57bee21c5291b9a50c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 18:23:01 -07:00
1776b7beed Move integration-cli daemon package to internal/test…
… and do not use the `docker` cli in it. One of the reason of this
move is to not make `integration` package using legacy
`integration-cli` package.

Next move will be to support swarm within this package *and* provide
some helper function using the api (compared to the one using cli in
`integration-cli/daemon` package).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit f0d277fe84a72b29c0d2d541c20d5a9c4d7e4884)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 18:14:34 -07:00
362aa8f58a Migrate test-integration-cli experimental macvlan test to integration
All `Macvlan` related test on `DockerSuite` and `DockerNetworkSuite`
are migrated to `macvlan_test.go`.

Also, as `macvlan` seems to be out of experimental, this removes
the *skip* when the run is not experimental (and doesn't start a
daemon with experimental either).

The end goal being to remove the `experimental` builds.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit ef5bc603266b9fa5df525319d67329ebc14a8ee7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 18:14:14 -07:00
2c0117e268 Network testing with busybox:glibc
Using the `busybox:glibc` instead of `busybox:latest` to the
network related test cases (`ping` issue).

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
(cherry picked from commit 0d31dee5ec724731607e277a415b1ca4ecb7b2c4)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 18:14:03 -07:00
a29f2e130f Add busybox:latest into the frozen images
Adding `busybox:latest` and `busybox:glibc` as the frozen images

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
(cherry picked from commit 3ae45c5f173d88ba621116f9e1b5611fe687e050)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 18:13:56 -07:00
34e1feb36b Skip some tests in certain condition to run with e2e image
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit e55d6fc8573580f6eea009cd7f1034aa912128ef)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 17:59:41 -07:00
23752adb2d use unique names for resources used by integration tests container/inspect_test, container/ps_test, container/stop_test
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
(cherry picked from commit 78e4be91332e2237c0fa14eb3ba0fb5b915c3256)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 17:46:26 -07:00
69f0e0e720 integration/*: make e2e run without failure
… mainly by skipping if daemon is remote.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 6016e79d2552b21643f4bfd093ce76d8ef956d79)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 17:39:11 -07:00
33df5137f7 Update e2e script
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 4bb0f24716f45ac520e73a52d7d7ca2752cabd31)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 17:39:01 -07:00
612f972789 integration/TestContainerShmNoLeak: use --iptables=false
As mentioned in commit 9e31938, test cases that use t.Parallel()
and start a docker daemon might step on each other toes as they
try to configure iptables during startup, resulting in flaky tests.

To avoid this, --iptables=false should be used while starting daemon.

Fixes: eaa5192856c1 ("Make container resource mounts unbindable")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit c125e10a0486623ba3badebf974ea6e582373151)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 17:29:43 -07:00
f03b3e54d7 Update testing doc
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 58de6277821698a2f97d1a0c83664ab34ff2e8d8)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 17:29:34 -07:00
dc814f391e Cleanup pkg/jsonmessage progress tests
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 7d8815ea705e85a73248b5d9e468f9dc65277bb8)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 17:29:28 -07:00
cb1f6242ed Post migration assertion fixes
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit c9e52bd0da0461e605a3678b85702f83081504a7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 17:29:22 -07:00
03ad49ebec Automated migration using
gty-migrate-from-testify --ignore-build-tags

Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 6be0f709830113966f295401327b027ec2f0bbca)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 17:28:49 -07:00
2ad8904abb Update vendor
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 073963e3b770efbdf8bd4b4f92d46b2c62eaf434)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 17:27:37 -07:00
a415a11279 Cleanup some assertions
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit ef01dea8935932486f03a37069720987e805dce6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 17:27:29 -07:00
c4adb3c164 Add missing error return for plugin creation.
Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
(cherry picked from commit 89a882e2f1706e567a8514209701892b40da7a62)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 16:15:07 -07:00
3ca5c31d84 fix(distribution): digest cache should not be moved if it was an auth
error

local digest cache will be removed when error occured on push image
but it should not be removed if it is an auth error while on auth was
provided

https://github.com/moby/moby/issues/36309
Signed-off-by: 慕陶 <jihui.xjh@alibaba-inc.com>
(cherry picked from commit 8b387b165ab2eaab3f9fdac25caa186d05d236a0)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 16:11:13 -07:00
a978050d4f Windows: Fix Hyper-V containers regression from 36586
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit 0f5fe3f9cf17457761dab28473ece5a7c94f4a0c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 15:12:38 -07:00
3c896e300b integration/TestExportContainerAfterDaemonRestart: add
This test case checks that a container created before start
of the currently running dockerd can be exported (as reported
in #36561). To satisfy this condition, either a pre-existing
container is required, or a daemon restart after container
creation.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 6e7141c7a2c0de6fa3d6c9dcc56978a81f9d835e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 15:12:26 -07:00
46ad9721ef container.BaseFS: check for nil before deref
Commit 7a7357dae1bccc ("LCOW: Implemented support for docker cp + build")
changed `container.BaseFS` from being a string (that could be empty but
can't lead to nil pointer dereference) to containerfs.ContainerFS,
which could be be `nil` and so nil dereference is at least theoretically
possible, which leads to panic (i.e. engine crashes).

Such a panic can be avoided by carefully analysing the source code in all
the places that dereference a variable, to make the variable can't be nil.
Practically, this analisys are impossible as code is constantly
evolving.

Still, we need to avoid panics and crashes. A good way to do so is to
explicitly check that a variable is non-nil, returning an error
otherwise. Even in case such a check looks absolutely redundant,
further changes to the code might make it useful, and having an
extra check is not a big price to pay to avoid a panic.

This commit adds such checks for all the places where it is not obvious
that container.BaseFS is not nil (which in this case means we do not
call daemon.Mount() a few lines earlier).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit d6ea46cedaca0098c15843c5254a337d087f5cd6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 15:09:12 -07:00
c9c8799088 daemon.ContainerExport(): do not panic
In case ContainerExport() is called for an unmounted container, it leads
to a daemon panic as container.BaseFS, which is dereferenced here, is
nil.

To fix, do not rely on container.BaseFS; use the one returned from
rwlayer.Mount().

Fixes: 7a7357dae1bccc ("LCOW: Implemented support for docker cp + build")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 81f6307eda44ab3a91de6e29304810a976161d74)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 15:09:01 -07:00
ec3221ac7d Merge pull request #512 from thaJeztah/18.03-backport-tests
[18.03] backport updates to tests, and fix empty LogPath with non-blocking logging mode
2018-04-17 14:56:29 -07:00
d602967356 Merge pull request #495 from thaJeztah/18.03-backport-972-fix-merge-network
[18.03] backport Fix error with merge composefile with networks…
2018-04-16 19:04:36 -07:00
aded7a8259 Fix stack deploy re-deploying service after --force
When updating a service with the `--force` option, the `ForceUpdate`
property of the taskspec is incremented.

Stack deploy did not take this into account, and reset this
field to its default value (0), causing the service to be
re-deployed.

This patch copies the existing value before updating the service.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 76439457d2)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-16 15:42:45 -07:00
a3540962fd Add some tests to the volume store
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 834d0e262ac248191c09bcdb2b86ee92edb6aaf0)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-16 14:44:33 -07:00
c25858e94c TestLinksEtcHostsContentMatch: use container.Exec()
I am not quite sure why but this test is sometimes failing like this:

> 15:21:41 --- FAIL: TestLinksEtcHostsContentMatch (0.53s)
> 15:21:41 	assertions.go:226:
>
> 	Error Trace:	links_linux_test.go:46
> 15:21:41
> 	Error:      	Not equal:
> 15:21:41
> 	            	expected: "127.0.0.1\tlocalhost\n::1\tlocalhost
> ip6-localhost
> ip6-loopback\nfe00::0\tip6-localnet\nff00::0\tip6-mcastprefix\nff02::1\tip6-allnodes\nff02::2\tip6-allrouters\n172.17.0.2\tf53feb6df161\n"
> 15:21:41
> 	            	received: ""

To eliminate some possible failures (like ignoring stderr from `cat` or
its exit code), let's use container.Exec() to read a file from a container.

Fixes: e6bd20edcbf ("Migrate some integration-cli test to api tests")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit ad2f88d8ccbd9dd0a8d9c4f96ece3956f60489df)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-16 14:44:17 -07:00
ae56939688 Remove unnecessary diff tests
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 038f3add5191240058c7a4154556553c5493ea44)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-16 14:44:09 -07:00
df6211ff9e Remove duplicate TestServiceUpdatePort
The TestAPIServiceUpdatePort test performs exactly
the same steps.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 36e1646e4f010ea033643c6df3d9c3dccc166ed2)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-16 14:22:15 -07:00
e945f93024 Adds a unit test for plugin request timeout
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 7ca971fb495e4de4aa4455964625974464d86920)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-16 14:22:10 -07:00
04ebff9f98 Address expected vs actual in integration tests
This fix addresses `expected` vs `actual` in integration tests
so that they match `assert.Equal(t, expected, actual)`

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 8a854e933b3dbb26cfce28b920cff61909412c6f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-16 14:22:04 -07:00
b3929fad23 Remove unnecessary container.WithName in kill test
This fix removes several unnecessary `container.WithName`
usage in docker kill integration test.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 1778719d6ac166250acfaebe5dd99b5e9d151c3e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-16 14:21:58 -07:00
6fbd783f33 Migrate docker rm tests to api tests
This fix migrates docker rm test in integration-cli
to api tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit ed58ba99fb28ceac56063b7f003f38b597ddef80)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-16 14:21:53 -07:00
618f290b37 Improvement in integration tests
This fix adds several improvement:
1. No need for explicit ContainerRemove as it has been handled in setupTest()
2. Added `container.WithImage` helper function and used it in commit tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 6ab465804b0b8cec6c5ac278a21151d49e34885d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-16 14:21:48 -07:00
1f529b2bd2 Fixes some integration/container test to run on remote daemon
```
docker build -f Dockerfile.e2e -t moby-e2e .
docker run -v /var/run/docker.sock:/var/run/docker.sock \
           -e TEST_INTEGRATION_DIR=/tests/integration/container \
           -e DOCKER_API_VERSION=1.36 moby-e2e
```

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 18dd1d9aba3c79d355abaa7f498b88ad816f7d04)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-16 14:21:42 -07:00
e695ffea63 Migrate export tests to api tests
This fix migrates export tests in integration-cli to api tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 4e702cf70d50ee5b0737270f27d9973fd3084c66)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-16 14:21:36 -07:00
d4444e3446 Fix "expected" and "actual" being reversed
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a2517cbf62d75c48861337182aa841c5089f8ac4)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-16 14:21:29 -07:00
53a10ae2bc Enhancement of replacing ContainerCreate with helper funcs in tests
This fix is a minor enhancement to replace several ContainerCreate with
helper funcs of `container.Create` in tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 6ad4720c78d6ac61a60a3e7ed1d0c0119c5d103e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-16 14:21:20 -07:00
0fd259afcb Remove docker_cli_secret_inspect_test.go
as the test (TestSecretInspectMultiple) seems to have been covered pretty well in cli:
https://github.com/docker/cli/blob/master/cli/command/secret/inspect_test.go

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 3d38adb20c619b87edab72e51ff0fd1cf6e08691)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-16 14:21:12 -07:00
8b54bcc057 Migrate events tests to api tests
This fix migrates events tests in integration-cli to api tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 3a749157d2c2b320fea49f7aa4d4eb634f52662f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-16 14:21:06 -07:00
e4022bf934 Migrate config inspect test to api test
This fix migrates config inspect test in integration-cli
to api test.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 4b99d782079dc390c2d8fb78f6973bbeee7d8a47)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-16 14:21:00 -07:00
bae8ccdbd7 Clean-up after container unit test
Remove temp directories and close file loggers in container unit tests.

Signed-off-by: mnussbaum <michael.nussbaum@getbraintree.com>
(cherry picked from commit 07d5446fe27cb92d881df48be6e8a6510d9608b0)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-16 14:20:53 -07:00
b2ff741b5f Fix empty LogPath with non-blocking logging mode
This fixes an issue where the container LogPath was empty when the
non-blocking logging mode was enabled. This change sets the LogPath on
the container as soon as the path is generated, instead of setting the
LogPath on a logger struct and then attempting to pull it off that
logger at a later point. That attempt to pull the LogPath off the logger
was error prone since it assumed that the logger would only ever be a
single type.

Prior to this change docker inspect returned an empty string for
LogPath. This caused issues with tools that rely on docker inspect
output to discover container logs, e.g. Kubernetes.

This commit also removes some LogPath methods that are now unnecessary
and are never invoked.

Signed-off-by: junzhe and mnussbaum <code@getbraintree.com>
(cherry picked from commit 20ca612a59c45c0bd58c71c199a7ebd2a6bf1a9e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-16 14:20:43 -07:00
89f42b5a6e Migrate some config secret tests to api test
This fix migrates some secret create tests to api tests,
and remove redundant TestConfigCreate.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 99e28188507bbcb925b0c09df6b53cdd882d24c5)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-16 14:20:28 -07:00
811b93ac9b Move containerIsStopped/containerIsInState to integration/internal/container
This fix moves helper functions containerIsStopped and
containerIsInState to integration/internal/container,
so that they could be used outside of integration/container.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit eda311c18f388ed4541dc44dcfba08cd4347a685)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-16 14:20:21 -07:00
fd75fd2b45 Clean the teardown process of network test
We need to clean the resources created in some test cases, else
in some cases we'll get below error for other tests:

> FAIL: docker_experimental_network_test.go:37: DockerNetworkSuite.TestDockerNetworkMacvlanPersistance
>  docker_experimental_network_test.go:44:
> ...
> Command:  ip link add dm-dummy0 type dummy
> ExitCode: 2
> Error:    exit status 2
> Stdout:
> Stderr:   RTNETLINK answers: File exists
> ...

Logically, each test case should be independent, the failure of previous
test case should not have side-effect for the test cases followed.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
(cherry picked from commit 57d85e7e54f7d074af8c496cba43ee18d3815207)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-16 14:20:14 -07:00
7aa342f808 Update docker-py
This fix update docker-py so that containers from the tests run
could be cleaned up during teardown:
```diff
-ENV DOCKER_PY_COMMIT 5e28dcaace5f7b70cbe44c313b7a3b288fa38916
+ENV DOCKER_PY_COMMIT 8b246db271a85d6541dc458838627e89c683e42f
```

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 66935a0f64f0a72162fb3919c759f4f500b6c372)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-16 14:20:07 -07:00
15237fd242 Migrate several docker rm tests to api tests
This fix migrates several docker rm tests to api tests

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 6bd4f4801b244555213f0040b9885033e99d4ae8)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-16 14:20:00 -07:00
1331808a09 Migrate volumes tests in integration-cli to api tests
This fix migrates volumes tests in integration-cli to api tests
in integration/

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit d896f87c0595134fa2f0787dad30b237815f233f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-16 14:19:52 -07:00
dc75023a9a Merge pull request #503 from jose-bigio/18.03_version_bump
[18.03] version bump to 18.03.1-ce-rc1
2018-04-11 23:24:42 -07:00
9fb2695fa5 Merge pull request #505 from jose-bigio/18.03_changelog
[18.03] changelog
2018-04-11 23:24:25 -07:00
473116d3a2 Changelog for 18.03.1
Signed-off-by: jose-bigio <jose.bigio@docker.com>
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2018-04-12 05:33:22 +00:00
f10cbe710b Merge pull request #506 from thaJeztah/18.03-backport-defensive-attachment-processing
[18.03] daemon/cluster: handle partial attachment entries during configure
2018-04-11 21:34:44 -07:00
aff214cf5c Merge pull request #497 from thaJeztah/18.03-backport-fix-manifest-docs-typo
[18.03] [docs] Fix typo in manifest command docs: updated `MANFEST` to `MANIFEST`
2018-04-11 21:32:33 -07:00
4cff440f16 Merge pull request #499 from thaJeztah/18.03-backport-bump-golang-1.9.5
[18.03] bump golang to 1.9.5
2018-04-11 21:28:45 -07:00
5770d86dae Merge pull request #458 from thaJeztah/18.03-backport-resilient-cpu-sampling
[18.03] daemon/stats: more resilient cpu sampling
2018-04-11 21:20:16 -07:00
e921cf31fc Merge pull request #487 from thaJeztah/18.03-backport-update-containerd-1.0.3
[18.03] containerd: update to 1.0.3 release
2018-04-11 19:17:35 -07:00
a0c8cc80ab Fix docker version output alignment
Use tabwriter to print the version output

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 48eb7a082d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-11 19:13:58 -07:00
7ee3cf582d Merge pull request #470 from thaJeztah/18.03-fix-exec-apparmor
[18.03] Fix AppArmor not being applied to Exec processes
2018-04-11 17:48:49 -07:00
8e67119f1f Merge pull request #476 from thaJeztah/18.03-systemd-memlimit
[18.03] Test for systemd cgroupdriver memory setting
2018-04-11 17:47:37 -07:00
59875dbe8e Merge pull request #478 from corbin-coleman/update-changelog
[18.03] Remove update runc line
2018-04-11 17:41:57 -07:00
0190af907b Merge pull request #490 from cpuguy83/18.03_backport_36711
[18.03] Don't sort plugin mounts slice
2018-04-11 17:32:14 -07:00
711807560d Merge pull request #508 from thaJeztah/18.03-backport-LayerLeak
[18.03] Fix Windows layer leak when write fails
2018-04-11 17:31:41 -07:00
d6931c2d12 Fix error with merge composefile with networks…
… and other cases too. Updating mergo fixes the bugs (but introduced a
slight behaviour change that had to be fixed too)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 0122730faf)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-11 14:41:04 -07:00
92f0dce1d1 Fix docker stack deploy reference flag
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 2ee9635b1e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-11 14:40:52 -07:00
1556d2d2f9 Merge pull request #504 from thaJeztah/18.03-backport-content-trust-tests
[18.03] backport content trust tests, windows, test-refactoring
2018-04-11 14:06:59 -07:00
d8b4bd5c6f Fix Windows layer leak when write fails
Signed-off-by: Darren Stahl <darst@microsoft.com>
(cherry picked from commit 1f28844d7869609f371ab2a7881e4488a79a7e27)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-11 11:54:18 -07:00
603c7932bb daemon/cluster: handle partial attachment entries during configure
We have seen a panic when re-joining a node to a swarm cluster. The
cause of the issue is unknown, so we just need to add a test for nil
objects and log when we get the condition. Hopefully this can prevent
the crash and we can recover the config at a later time.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
(cherry picked from commit 454128c6e82cded211c1412e3eb350b1f7533ee2)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-11 11:46:06 -07:00
7bfd67bece Fix imports in CLI compose test
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-11 11:39:36 -07:00
010ba8f1dd Fix test for trust inspect --pretty
This fix was part of 8c3d0b93d6,
but was reverted due to the order in which other changes were
backported.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 17:28:16 -07:00
7dd4bb6171 18.03.1-ce-rc1 version bump
Signed-off-by: jose-bigio <jose.bigio@docker.com>
2018-04-10 15:52:21 -07:00
566c20094c Remove filewatcher
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit c0588a9c8f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 15:21:13 -07:00
bc28daf367 Add more content trust tests
Importing from moby's DockerTrustSuite tests.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 8b00c5cfd8)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 15:20:40 -07:00
a20423b7f7 Add a build unit test for symlinked context
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 00b803b2d8)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 15:20:29 -07:00
8723ba6cc0 Remove unused powershell function
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 10baa756b2)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 15:19:06 -07:00
c270672ced Fixes some unit tests to be able to run them on windows
Some of them are skipped for now (because the feature is not supported
or needs more work), some of them are fixed.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 0cf2e6353a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 15:18:59 -07:00
0d45d8f964 Add appveyor setup to build and unit test
Adds a `make.ps1` powershell script to make it easy to compile and test.

```
.\scripts\make.ps1 -Binary
INFO: make.ps1 starting at 03/01/2018 14:37:28
INFO: Building...

 ________   ____  __.
 \_____  \ |    |/ _|
 /   |   \|      <
 /    |    \    |  \
 \_______  /____|__ \
         \/        \/

INFO: make.ps1 ended at 03/01/2018 14:37:30

.\scripts\make.ps1 -TestUnit
```

The next step is to run e2e tests on windows too.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit facb22573d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 15:18:52 -07:00
311944ec04 Small content trust enhancement
- `replaceDockerfileForContentTrust` is only used when content trust is
  enabled, so remove the boolean.
- rename `isContentTrustEnabled` to `contentTrustEnabled`

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 63ebcae382)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 15:14:17 -07:00
ad89cb6a38 Only read trust setting from options
Rename IsTrusted to ContentTrustEnabled

Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit feae0e9756)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 15:12:02 -07:00
aba0bb77e1 Refactor content_trust cli/flags handling
Remove the global variable used. Allows easier unit testing.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 6e21829af4)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 15:07:03 -07:00
a20c69243b Cleanup config load error handling
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 789acb526c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 15:01:36 -07:00
bcb040440f Don't set a default filename for ConfigFile
With a default filename tests will leave a file in the working directory
that is never cleaned up.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 7c8b5708eb)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 15:01:20 -07:00
2cc21bf56f Use new APIClient interface
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit cff874122c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 14:55:17 -07:00
a218857a9a Convert assert.Check(t, is.Error()) to assert.Error
git grep -l -P '^\s+assert\.Check\(t, is\.Error\(' | \
    xargs perl -pi -e 's/^(\s+assert\.)Check\(t, is\.Error\((.*)\)$/\1Error(t, \2/'

Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit e15b208e96)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 14:48:48 -07:00
a723f7351d manual clean of asserts
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit f21276575f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 14:48:41 -07:00
df9ed934e3 Convert assert.Check with
git grep -l -P '^\s+assert\.Check\(t, ' | \
    xargs perl -pi -e 's/^(\s+assert)\.Check(\(t, (?!is).*(\.Execute\(|\.Set\(|\.Write\(|\.Close\(|\.Untar\(|\.WriteFile\(|Validate\().*\)$)/\1.NilError\2/'

Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 078cbc9c4b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 14:48:34 -07:00
f7124ab5e4 Convert to assert.NilError
Using:

  git grep -l '^\s\+assert\.Check(t, err)$' | \
    xargs sed -i -e 's/^\(\s\+assert\)\.Check(t, err)$/\1.NilError(t, err)/'

Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit baf65a5502)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 14:48:09 -07:00
9550f71467 dont prompt for github creds in unit test
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 0f11a310fd)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 14:45:49 -07:00
1f1816b098 Remove testutil
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 681c921528)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 14:40:48 -07:00
7c2863a6e0 Post migration fixes
Fix tests that failed when using cmp.Compare()
internal/test/testutil/assert
InDelta
Fix DeepEqual with kube metav1.Time
Convert some ErrorContains to assert

Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 5155cda716)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 14:33:18 -07:00
fb9700fdbd Automated migration
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 39c2ca57c1)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 14:29:47 -07:00
70083e56be Replace testify vendor with updated gotestyourself
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 5ef8835f23)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 13:54:23 -07:00
659ea5343c Update some assertions.
and fix some tests

Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 93615dd967)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 13:54:15 -07:00
49dc9b064e Update gotestyourself dependency
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 98ba439f67)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 12:12:52 -07:00
9f1c3a6814 Migrate DockerTrustSuite to docker/cli e2e tests
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 5433ceb12ead305d8c85e8e27c4b4d842ef88ae0)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 11:59:36 -07:00
83bc7fbbe0 Revert "update integration-cli tests for stderr output"
This reverts commit d5f8753b88.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 11:51:53 -07:00
fbe9d5d378 Revert "Blacklist tests, will be rewritten later on"
This reverts commit a720337d2e.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-10 11:51:37 -07:00
c925888822 Bump Golang to 1.9.5
go1.9.5 (released 2018/03/28) includes fixes to the compiler, go command, and
net/http/pprof package. See the Go 1.9.5 milestone on the issue tracker for details:

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

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit c62336593118020462d65d4e9784143e07de2da7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-09 17:04:22 -07:00
2032af137d Add Ubuntu 18.04 arm64 builds
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
(cherry picked from commit aac8310bbee3c7480487a624756d25d22d53c7dd)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-09 17:04:13 -07:00
7b5c3637ab Add packaging code for Fedora 28
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
(cherry picked from commit 00148a3c994c753a3e171b1aa2b422342e00fd16)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-09 17:04:06 -07:00
abd6f38345 Add building code for Ubuntu Bionic (18.04) LTS
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
(cherry picked from commit 460f0b5becbbc5ec2bd341df409af8f06c0a70f7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-09 17:03:59 -07:00
212445876d Bump other Dockerfiles to Go 1.9.5
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-09 16:57:14 -07:00
9134da61fe Update Golang to 1.9.5
go1.9.5 (released 2018/03/28) includes fixes to the compiler, go
command, and net/http/pprof package. See the Go 1.9.5 milestone on
the issue tracker for details:

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

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 0b6f8a7eff325a683b10d64db363da2145aa1c36)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-09 16:42:42 -07:00
45c8a7d911 Bump Golang to 1.9.5
go1.9.5 (released 2018/03/28) includes fixes to the compiler, go command, and
net/http/pprof package. See the Go 1.9.5 milestone on the issue tracker for details:

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

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit d3b8ceb52c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-09 16:35:48 -07:00
64fe575962 [docs] Fix typo in manifest command docs: updated MANFEST to MANIFEST.
Signed-off-by: Bogdan Anton <contact@bogdananton.ro>
(cherry picked from commit 9fa6bd4174)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-09 13:31:04 -07:00
4b4614c8b7 Don't sort plugin mounts slice
This was added as part of a53930a04fa81b082aa78e66b342ff19cc63cc5f with
the intent to sort the mounts in the plugin config, but this was sorting
*all* the mounts from the default OCI spec which is problematic.

In reality we don't need to sort this because we are only adding a
self-binded mount to flag it as rshared.

We may want to look at sorting the plugin mounts before they are added
to the OCI spec in the future, but for now I think the existing behavior
is fine since the plugin author has control of the order (except for the
propagated mount).

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit ec90839ca302ca53a7d55e4c7f79e7b4779f5e15)
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-04-04 08:25:55 -04:00
0eadfaeecd containerd: update to 1.0.3 release
Signed-off-by: Stephen J Day <stephen.day@docker.com>
(cherry picked from commit 554d657c1f7a0f4dce51f0d26407fb05a0580fa1)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-03 13:36:06 -07:00
7364fc672e Remove update runc line
Removes a line talking about updating runc to a specific commit.
Runc was updated twice during separate rcs and this line might cause confusion for users in regards to what version of runc to expect in 18.03.

Signed-off-by: corbin-coleman <corbin.coleman@docker.com>
2018-03-23 14:46:04 -07:00
c05a7395f2 Test for systemd cgroupdriver memory setting
This is a test case for issue https://github.com/moby/moby/issues/35123,
making sure we can set container's memory limit when using
`native.cgroupdriver=systemd`.

[v2: skip if no systemd present]
[v3: add --iptables=false to avoid flaky tests with t.Parallel()]
[v4: rebase after PR#36507 merge]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 4ca5c5361059e29ed31074ca5b96f8b2030b5f99)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-03-22 13:46:19 +01:00
0520e24302 Merge pull request #473 from seemethere/vbump
[18.03] bump version to 18.03.0-ce
2018-03-21 15:59:46 -07:00
f178926203 Merge pull request #474 from seemethere/bump_change
[18.03] Bump date for 18.03.0-ce GA
2018-03-21 15:59:23 -07:00
e4b87d5a7d Bump date for 18.03.0-ce GA
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2018-03-21 18:00:38 +00:00
95930e8794 bump version to 18.03.0-ce
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2018-03-21 17:59:46 +00:00
d8bfd4004a Fix AppArmor not being applied to Exec processes
Exec processes do not automatically inherit AppArmor
profiles from the container.

This patch sets the AppArmor profile for the exec
process.

Before this change:

    apparmor_parser -q -r <<EOF
    #include <tunables/global>
    profile deny-write flags=(attach_disconnected) {
      #include <abstractions/base>
      file,
      network,
      deny /tmp/** w,
      capability,
    }
    EOF

    docker run -dit --security-opt "apparmor=deny-write" --name aa busybox

    docker exec aa sh -c 'mkdir /tmp/test'
    (no error)

With this change applied:

    docker exec aa sh -c 'mkdir /tmp/test'
    mkdir: can't create directory '/tmp/test': Permission denied

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 8f3308ae10ec9ad0dd4edfb46fde53a0e1e19b34)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-03-20 10:13:17 +01:00
912261ed44 Fix stats collector spinning CPU if no stats are collected
Commit fd0e24b7189374e0fe7c55b6d26ee916d3ee1655 changed
the stats collection loop to use a `sleep()` instead
of `time.Tick()` in the for-loop.

This change caused a regression in situations where
no stats are being collected, or an error is hit
in the loop (in which case the loop would `continue`,
and the `sleep()` is not hit).

This patch puts the sleep at the start of the loop
to guarantee it's always hit.

This will delay the sampling, which is similar to the
behavior before fd0e24b7189374e0fe7c55b6d26ee916d3ee1655.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 481b8e54b45955e40075f49a9af321afce439320)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-03-19 10:25:58 +01:00
fbedb97a27 Merge pull request #464 from jose-bigio/18.03_versionBump
[18.03] Version bump for 18.03-ce-rc4
2018-03-15 00:28:45 -07:00
1adc2983f8 Merge pull request #465 from andrewhsu/cl
[18.03] changelog for docker-ce 18.03.0 rc4
2018-03-15 00:28:11 -07:00
6bca1f316f changelog for docker-ce 18.03.0 rc4
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2018-03-15 07:27:47 +00:00
78455c2b2f Merge pull request #469 from andrewhsu/hns
[18.03] Update libnetwork to fix stale HNS endpoints on Windows
2018-03-15 00:21:43 -07:00
3b7099798e Update libnetwork to fix stale HNS endpoints on Windows
Update libnetwork to 1b91bc94094ecfdae41daa465cc0c8df37dfb3dd to bring in a fix
for stale HNS endpoints on Windows:

When Windows Server 2016 is restarted with the Docker service running, it is
possible for endpoints to be deleted from the libnetwork store without being
deleted from HNS. This does not occur if the Docker service is stopped cleanly
first, or forcibly terminated (since the endpoints still exist in both). This
change works around the issue by removing any stale HNS endpoints for a network
when creating it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit fb364f07468e94226250a1e77579ee6117c64be2)
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2018-03-15 04:12:34 +00:00
ef0da452ea Merge pull request #466 from thaJeztah/18.03-fix-duplicate-ip-issues
[18.03] Update libnetwork with fixes for duplicate IP addresses
2018-03-14 20:30:56 -07:00
f91125ff08 Update libnetwork with fixes for duplicate IP addresses
This updates libnetwork to 8892d7537c67232591f1f3af60587e3e77e61d41 to bring in
IPAM fixes for duplicate IP addresses.

- IPAM tests (libnetwork PR 2104) (no changes in vendored files)
- Fix for Duplicate IP issues  (libnetwork PR 2105)

Also bump golang/x/sync to match libnetwork (no code-changes, other
than the README being updated)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 55e0fe24db68b16edccb2fa49c3b1b9d3a9ce58c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-03-14 23:05:03 +01:00
1dd3bdc5e9 Merge pull request #459 from thaJeztah/18.03-backport-ipc-ro
[18.03] backport daemon/setMounts(): do not make /dev/shm ro
2018-03-14 12:27:12 -07:00
a3fc95aed5 Merge pull request #463 from thaJeztah/18.03-ingress-fix
[18.03] Fix automatic removal of ingress sandbox when last service leaves
2018-03-14 12:26:22 -07:00
7d9137fefc Merge pull request #461 from vdemeester/trust-updates
[18.03] move trust out of experimental
2018-03-14 10:23:54 -07:00
70cb53f0ba Merge pull request #460 from seemethere/fix_ppc64le_tests
[18.03] skip ppc64le oom tests for now
2018-03-14 10:22:01 -07:00
9cc70ae1b0 Version bump for 18.03-ce-rc4
Signed-off-by: jose-bigio <jose.bigio@docker.com>
2018-03-14 09:25:15 -07:00
30726dd76a Update vendoring for libnetwork PR #2097
This PR prevents automatic removal of the load balancing sandbox
endpoint when the endpoint is the last one in the network but
the network is marked as ingress.

Signed-off-by: Chris Telfer <ctelfer@docker.com>
(cherry picked from commit bebad150c9c3bc6eb63758c10ef24b9298ecf6e2)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-03-14 12:12:40 +01:00
0825e477d8 Delete the load balancer endpoint in Ingress nets
Ingress networks will no longer automatically remove their
load-balancing endpoint (and sandbox) automatically when the network is
otherwise upopulated.   This is to prevent automatic removal of the
ingress networks when all the containers leave them.  Therefore
explicit removal of an ingress network also requires explicit removal
of its load-balancing endpoint.

Signed-off-by: Chris Telfer <ctelfer@docker.com>
(cherry picked from commit 3da4ebf355d3494d1403b2878a1ae6958b2724e9)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-03-14 12:12:32 +01:00
735514a077 Add test for ingress removal on service removal
The commit https://github.com/moby/moby/pull/35422 had the result of
accidentally causing the removal of the ingress network when the
last member of a service left the network.  This did not appear
in swarm instances because the swarm manager would still maintain
and return cluster state about the network even though it had
removed its sandbox and endpoint.  This test verifies that after a
service gets added and removed that the ingress sandbox remains
in a functional state.

Signed-off-by: Chris Telfer <ctelfer@docker.com>
(cherry picked from commit 805b6a7f749a6c7cbb237e21ee7260d536621808)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-03-14 12:12:25 +01:00
093b46e361 Bash: update trust completions
The `docker trust` commands were moved out of experimental,
and the `docker trust view` command was changed to
`docker trust inspect --pretty`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 2a6808db87)
2018-03-14 09:15:23 +01:00
518a7181ad update doc
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
(cherry picked from commit 09ec6d4ad9)
2018-03-14 09:14:58 +01:00
48712f36a6 Move Docker Trust out of experimental
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
(cherry picked from commit ac35e851e8)
2018-03-14 09:14:31 +01:00
3d69121433 Fix comment and misc code issues
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
(cherry picked from commit 8c3d0b93d6)
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-03-14 09:11:25 +01:00
2d81349010 Refactor trust view command into a --pretty flag on trust inspect
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
(cherry picked from commit c5554f811b)
2018-03-14 08:59:32 +01:00
7946f15b56 [integration] skip ppc64le oom tests for now
These tests were enabled by changing a config option on the ci
machines, instead of from a patch, so let me disable them
for now on ppc64le and open up another patch to enable them, where I can find
out what the issues are with them.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
(cherry picked from commit 620ddc78a1437feaa42f40853ef586d268991620)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2018-03-13 17:53:09 +00:00
c64a65bccb daemon/oci_linux_test: add TestIpcPrivateVsReadonly
The test case checks that in case of IpcMode: private and
ReadonlyRootfs: true (as in "docker run --ipc private --read-only")
the resulting /dev/shm mount is NOT made read-only.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 33dd562e3acff71ee18a2543d14fcbecf9bf0e62)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-03-12 14:09:50 +01:00
e22655d04a daemon/setMounts(): do not make /dev/shm ro
It has been pointed out that if --read-only flag is given, /dev/shm
also becomes read-only in case of --ipc private.

This happens because in this case the mount comes from OCI spec
(since commit 7120976d74195), and is a regression caused by that
commit.

The meaning of --read-only flag is to only have a "main" container
filesystem read-only, not the auxiliary stuff (that includes /dev/shm,
other mounts and volumes, --tmpfs, /proc, /dev and so on).

So, let's make sure /dev/shm that comes from OCI spec is not made
read-only.

Fixes: 7120976d74195 ("Implement none, private, and shareable ipc modes")

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit cad74056c09f6276b0f4a996a1511553177cd3d7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-03-12 14:09:44 +01:00
fd1a7dfd47 daemon/stats: more resilient cpu sampling
To avoid noise in sampling CPU usage metrics, we now sample the system
usage closer to the actual response from the underlying runtime. Because
the response from the runtime may be delayed, this makes the sampling
more resilient in loaded conditions. In addition to this, we also
replace the tick with a sleep to avoid situations where ticks can backup
under loaded conditions.

The trade off here is slightly more load reading the system CPU usage
for each container. There may be an optimization required for large
amounts of containers but the cost is on the order of 15 ms per 1000
containers. If this becomes a problem, we can time slot the sampling,
but the complexity may not be worth it unless we can test further.

Unfortunately, there aren't really any good tests for this condition.
Triggering this behavior is highly system dependent. As a matter of
course, we should qualify the fix with the users that are affected.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
(cherry picked from commit fd0e24b7189374e0fe7c55b6d26ee916d3ee1655)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-03-10 00:21:52 +01:00
e7309590a2 Merge pull request #457 from andrewhsu/v
[18.03] Bump version to 18.03.0-ce-rc3
2018-03-08 10:03:02 -08:00
49e42a6151 Merge pull request #456 from andrewhsu/p
[18.03] Use new 'dynamic' args in install.sh
2018-03-08 09:58:32 -08:00
89ec01afcb Bump version to 18.03.0-ce-rc3
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2018-03-08 09:53:33 -08:00
6fa0c6462e Bump version to 18.03.0-ce-rc3
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2018-03-08 09:48:32 -08:00
2329a946f6 Use new 'dynamic' args in install.sh
Scripts were changed around to do static by default, this changes so
that we have "dynamic" inserted where it needs to be inserted

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
(cherry picked from commit 130f74155e39ddc36b59d7c47867230284739710)
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2018-03-08 09:41:50 -08:00
23a9017037 Merge pull request #455 from thaJeztah/18.03-fix_static_builds
[18.03] fix static builds
2018-03-08 09:29:02 -08:00
fb4173d8a8 buildmod => buildmode
There was a typo with the buildmode flag for containerd

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
(cherry picked from commit 5e4885b9afb1de30133627ce751af2c0e7b72a4e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-03-08 15:45:32 +01:00
3638dc65e4 Build containerd, runc, and proxy statically
These were originally static binaries in the first place, this changes
them back to that.

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
(cherry picked from commit 63c7bb24637fdbfd905096ecc75b435ecefd31e9)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-03-08 15:45:24 +01:00
cbc5bef54f Merge pull request #454 from seemethere/cherry_pick_packaging_88
[18.03] Fixes binary installation
2018-03-06 14:11:59 -08:00
88176d01f4 Fixes binary installation
Binary installation was broken after the
hack/dockerfile/install-binaries script was removed.

This remedies that.

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
(cherry picked from commit 59164bedeab571029805a107e8e5a32fc9cd56b3)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2018-03-06 21:50:00 +00:00
3e53917a28 Merge pull request #443 from jose-bigio/18.03_versionBump
[18.03]  Bump version to 18.03.0-ce-rc2
2018-03-06 13:05:52 -08:00
5613f516dd Merge pull request #440 from jose-bigio/18.03_changelog
[18.03] Updating Changelog for 18.03
2018-03-06 13:05:24 -08:00
7bc0502750 Updating Changelog for 18.03
Signed-off-by: jose-bigio <jose.bigio@docker.com>
2018-03-06 11:30:36 -08:00
91bb2aeb67 Merge pull request #453 from thaJeztah/18.03-swarmkit-ingress-attach
[18.03] disallow attaching ingress network
2018-03-06 11:27:15 -08:00
5ba2b1a74d Merge pull request #452 from thaJeztah/18.03-backport-selansen-36247
[18.03] Fix to address regression caused by PR 30897
2018-03-06 10:04:37 -08:00
dbe2a19e83 CLI bump swarmkit to 11d7b06f48bc1d73fc6d8776c3552a4b11c94301
Contains no changes for the CLI, but keeps the version
in sync with engine

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-03-06 17:32:08 +01:00
2d690d4e87 Engine: bump swarmkit to 11d7b06f48bc1d73fc6d8776c3552a4b11c94301
Ingress network should not be attachable

Ingress network is a special network used only to expose
ports. For this reason the network cannot be explicitly
attached during service create or service update

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-03-06 17:31:43 +01:00
3ab4d93c66 Merge pull request #451 from andrewhsu/md
[18.03] vndr swarmkit to 49a9d7f
2018-03-06 07:39:11 -08:00
cb1018ea72 Merge pull request #449 from tonistiigi/layer-leak-fix
[18.03] builder: fix layer lifecycle leak
2018-03-06 07:37:26 -08:00
3310baba0f Fix to address regression caused by PR 30897
With the inclusion of PR 30897, creating service for host network
    fails in 18.02. Modified IsPreDefinedNetwork check and return
    NetworkNameError instead of errdefs.Forbidden to address this issue

Signed-off-by: selansen <elango.siva@docker.com>
(cherry picked from commit 7cf8b20762cc9491f52ff3f3d94c880378183696)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-03-06 13:42:37 +01:00
9dbc108a14 Merge pull request #441 from thaJeztah/18.03-backport-templated-configs-secrets
[18.03] Add --template-driver option for secrets/configs
2018-03-05 22:25:55 -08:00
977f2704b3 Merge pull request #450 from thaJeztah/18.03-backport-bump-runc-1.0-rc5
[18.03] Bump Runc to 1.0.0-rc5
2018-03-05 22:22:01 -08:00
1b39f8bd26 cli: vndr swarmkit 49a9d7f
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2018-03-06 01:45:21 +00:00
652953a81f engine: vndr swarmkit 49a9d7f
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2018-03-06 01:43:57 +00:00
7000ca4203 Merge pull request #447 from vdemeester/tests-fixes
[18.03] Fixes tests to have the ci green
2018-03-05 17:19:37 -08:00
5bc239fe16 bump containerd/console to 2748ece16665b45a47f884001d5831ec79703880
Fix runc exec on big-endian, causing:

    container_linux.go:265: starting container process caused "open /dev/pts/4294967296: no such file or directory"

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit aab5eaddccb8cb196fdb1e285890dfa94a071b14)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-03-05 23:56:22 +01:00
aca674de82 Bump Runc to 1.0.0-rc5 / 4fc53a81fb7c994640722ac585fa9ca548971871
Release notes: https://github.com/opencontainers/runc/releases/tag/v1.0.0-rc5

Possibly relevant changes included:

- chroot when no mount namespaces is provided
- fix systemd slice expansion so that it could be consumed by cAdvisor
- libcontainer/capabilities_linux: Drop os.Getpid() call
- Update console dependency to fix runc exec on BE (causing: `container_linux.go:265: starting container process caused "open /dev/pts/4294967296: no such file or directory"`)
- libcontainer: setupUserNamespace is always called (fixes: Devices are mounted with wrong uid/gid)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a2f5a1a5b2d77d694c5bd47798be15b3c0bcdf70)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-03-05 23:56:13 +01:00
c709b18bfd Split binary installers/commit scripts
Originally I worked on this for the multi-stage build Dockerfile
changes. Decided to split this out as we are still waiting for
multi-stage to be available on CI and rebasing these is pretty annoying.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit b529d1b0936b90ae14d584c73f7332919f8d76b7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-03-05 23:56:02 +01:00
6f6e5c5f2c builder: fix layer lifecycle leak
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 7ad41d53df94c4277574d14809211b42dca2becc)
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-03-05 14:11:22 -08:00
50c9a31b4c Fix --label behavior on run
Commit 2b17f4c8a8 fixed the way empty labels
are taken into account (i.e. not interpolated from environment variable),
but it created a regression.

`ValidateLabel` functions doesn't allow empty label value, but it has
always been possible to pass an empty label via the cli (`docker run --label foo`).

This fixes that by not validating the label flag.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 31dc5c0a9a)
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-03-02 10:21:53 +01:00
f8e0c47b29 Merge pull request #442 from thaJeztah/18.03-docs-cherry-picks
[18.03] docs cherry-picks
2018-02-28 13:32:40 -08:00
767a8f6227 Update run.md --restart to include unless-stopped
Update --restart option to include unless-stopped to be consistent with https://docs.docker.com/config/containers/start-containers-automatically/#use-a-restart-policy

Signed-off-by: Lydell Manganti <lydell.manganti@gmail.com>
(cherry picked from commit d281b72a98)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-02-28 18:10:39 +01:00
36343864e2 Migrate some copy tests to integration
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 00d409f03ed825f623b6ef8ec5a3a91cd26194c2)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-02-28 12:29:10 +01:00
7d395933ee Add more container cp tests
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 07cb69e9bc)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-02-28 11:16:23 +01:00
c70b6c9f35 Clean some docker_cli_build_tests that are cli-only
Remove TestBuildRenamedDockerfile and TestBuildDockerfileOutsideContext
that are cli-only tests (and already tested in the docker/cli
repository).

Also adds some comments on few tests that could be migrate to
docker/cli.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 894c213b3bd6f4d8f344837b5b5084360a013680)
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-02-28 10:13:03 +01:00
dd1b760bad Bump version to 18.03.0-ce-rc2
Signed-off-by: jose-bigio <jose.bigio@docker.com>
2018-02-27 09:34:44 -08:00
de4362e128 docs: mention sctp
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
(cherry picked from commit b85d87b8ab)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-02-26 11:40:06 +01:00
eda1e25f5c Add --template-driver option for secrets/configs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit d11b5ccdfa)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-02-26 11:34:23 +01:00
c160c73353 Merge pull request #438 from jose-bigio/18.03_changelog
[18.03] Changelog for 18.03
2018-02-21 18:31:04 -08:00
5c06a61da4 Merge pull request #437 from andrewhsu/t
[18.03] skip DockerTrustSuite tests for 18.03
2018-02-21 18:30:37 -08:00
9d7d57c20f Merge pull request #439 from andrewhsu/taad
[18.03] Fix TestAttachAfterDetach to work with latest client
2018-02-21 18:30:27 -08:00
138ca8c7ad Deleted the delete section and the triage sections
Signed-off-by: jose-bigio <jose.bigio@docker.com>
2018-02-21 17:50:55 -08:00
9dd6df6ee4 Fix TestAttachAfterDetach to work with latest client
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 847b610620a8b8294d61c717d3c4aa13cb7a8b33)
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2018-02-21 17:50:33 -08:00
9d4514861f 18.03 Changelog
Signed-off-by: jose-bigio <jose.bigio@docker.com>
2018-02-21 17:33:48 -08:00
d5f8753b88 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>
(cherry picked from commit d256539bf4)
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
(cherry picked from commit 5742bd3ccf)
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
(cherry picked from commit 1a2098cecf)
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2018-02-21 16:23:44 -08:00
a720337d2e 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>
(cherry picked from commit fbfecebc0a)
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
(cherry picked from commit e3571070d5)
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
(cherry picked from commit 9d7b9c23f5)
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2018-02-21 16:23:44 -08:00
5ff63c0239 Bump version to 18.03.0-ce-rc1
Signed-off-by: GordonTheTurtle <engine-team@docker.com>
2018-02-21 23:59:01 +00:00
2afc089041 Merge component 'engine' from git@github.com:moby/moby master 2018-02-21 23:57:52 +00:00
66d22efd1f Merge component 'cli' from git@github.com:docker/cli master 2018-02-21 23:32:37 +00:00
02638eae1b Merge pull request #36209 from dnephin/fix-image-prune-mapping
Remove broken container check from image prune
Upstream-commit: 05c751b1be6785b4f8a42c412e858508b137c10e
Component: engine
2018-02-21 18:22:51 -05:00
acea77d537 Merge pull request #843 from sepich/docs-for-pr33130
Document long form of --network and --network-add
Upstream-commit: 84c7dd6057
Component: cli
2018-02-21 23:26:39 +01:00
f1a4158236 Merge pull request #36370 from thaJeztah/update-authors
Update authors
Upstream-commit: f0f41bae5f0f2579784dfa551643b85286d8c899
Component: engine
2018-02-21 21:29:10 +01:00
706ded458f Merge pull request #897 from thaJeztah/update-authors2
Update authors
Upstream-commit: 50b229f533
Component: cli
2018-02-21 21:28:36 +01:00
c3a24a0fbd Update authors
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: fb005971c2bd82de482d1cfe924f2f4ec60c60ae
Component: engine
2018-02-21 21:12:31 +01:00
da1330b479 Update authors
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: ec92c08874
Component: cli
2018-02-21 20:53:40 +01:00
f8157dd468 Merge pull request #884 from shin-/update_3.6_schema_id
Fix typo in 3.6 schema ID
Upstream-commit: 0e81cddd95
Component: cli
2018-02-21 14:49:43 -05:00
86c5b9760f Fix typo in 3.6 schema ID
Signed-off-by: Joffrey F <joffrey@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 56f26d1134
Component: cli
2018-02-21 19:55:12 +01:00
ff7653434c Merge pull request #36368 from justincormack/maskkeys
Add /proc/keys to masked paths
Upstream-commit: 8f6a40a3f126ae1dc0a74dc612a3f7b14de4e7f6
Component: engine
2018-02-21 13:48:19 -05:00
da2e766ea9 Merge pull request #824 from ethan-haynes/820-bind-mount-source-missing-error
added check for empty source in bind mount
Upstream-commit: cea4d37bca
Component: cli
2018-02-21 13:33:24 -05:00
6e4091ce84 Merge pull request #894 from thaJeztah/update-moby
Bump moby to 0ede01237c9ab871f1b8db0364427407f3e46541
Upstream-commit: a160ad89c9
Component: cli
2018-02-21 13:15:58 -05:00
8878228a1f Merge pull request #895 from vdemeester/simplify-yaml-marshal
Simplify the marshaling of compose types.Config
Upstream-commit: 88ee1a67f4
Component: cli
2018-02-21 19:02:04 +01:00
8254c65c9b Bump moby to 0ede01237c9ab871f1b8db0364427407f3e46541
Includes:

- [client] Remove duplicate NewClient functions
- Add API support for templated secrets and configs
- Adjust minimum API version for templated configs/secrets

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 60930d309c
Component: cli
2018-02-21 18:48:42 +01:00
239936c7e1 Simplify the marshaling of compose types.Config
- Add `Version` to `types.Config`
- Add a new `Services` types (that is just `[]ServiceConfig`) and add
  `MarshalYAML` method on it.
- Clean other top-level custom marshaling as `Services` is the only one
  required.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: cf86a4d922
Component: cli
2018-02-21 18:47:10 +01:00
83cba78175 Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2018-02-21 17:06:09 +00:00
b9bcfd701b Merge component 'engine' from git@github.com:moby/moby master 2018-02-21 17:06:03 +00:00
912355fce6 Merge pull request #891 from vdemeester/k8s-loader-make-sure-version
Make sure we marshall version too…
Upstream-commit: 939938b976
Component: cli
2018-02-21 11:45:14 -05:00
e106425236 Merge pull request #36366 from thaJeztah/update-api-version-check
Adjust minimum API version for templated configs/secrets
Upstream-commit: 0ede01237c9ab871f1b8db0364427407f3e46541
Component: engine
2018-02-21 11:44:50 -05:00
3bdf2c5c9a Merge component 'cli' from git@github.com:docker/cli master 2018-02-21 16:41:14 +00:00
87cd2bf7ea Add /proc/keys to masked paths
This leaks information about keyrings on the host. Keyrings are
not namespaced.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: de23cb939858a66829d5b75057c7ac664c5acda5
Component: engine
2018-02-21 16:23:34 +00:00
3ed0ebb0b5 Make sure we marshall version too…
… otherwise the k8s controller might fail to parse the file as it will
think it's version 1.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 9f9f1c8515
Component: cli
2018-02-21 15:36:51 +01:00
e09ff74ed5 Adjust minimum API version for templated configs/secrets
Also adds a note to the API version history

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: a3efeaad529b945ce5af78c4b08a6ed47399f8d5
Component: engine
2018-02-21 15:23:00 +01:00
40a7a5b6d7 Bump default API version to 1.37
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 453f2b8b40b923862ce1c08c11531ff5042770f1
Component: engine
2018-02-21 15:22:40 +01:00
a196815f55 Merge pull request #33702 from aaronlehmann/templated-secrets-and-configs
Templated secrets and configs
Upstream-commit: 0076343b29f508a5deb06861c0d85748659f8881
Component: engine
2018-02-21 13:39:10 +01:00
0308ec9c17 Merge pull request #34899 from dnephin/fix-duplicate-new-client
[client] Remove duplicate NewClient functions
Upstream-commit: 466cc981433e2e1815a64ee714b1c8c083765785
Component: engine
2018-02-21 12:59:42 +01:00
ad01430349 Merge pull request #35829 from cpuguy83/no_private_mount_for_plugins
Perform plugin mounts in the runtime
Upstream-commit: 20028325daab4fcbee9c8e28f43dbfb2b1c5d568
Component: engine
2018-02-21 12:28:13 +01:00
692373dbbd Merge pull request #35898 from javabrett/docs-contributing-test
test.md improvements and corrections
Upstream-commit: 9f68f20faecfc084343dc1a6cbd7de1db616e7e0
Component: engine
2018-02-21 09:32:15 +01:00
53fd7b9026 Merge pull request #278 from ishidawataru/sctp
Support SCTP port mapping
Upstream-commit: 64f92fd07c
Component: cli
2018-02-21 09:29:36 +01:00
894af8d548 Support SCTP port mapping
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: 995006c164
Component: cli
2018-02-21 12:19:38 +09:00
d7eb6e8c90 Merge pull request #36361 from kolyshkin/pr36326-followup
integration/TestUpdateMemory: fix false failure
Upstream-commit: e3831a62a3052472d7252049bc59835d5d7dc8bd
Component: engine
2018-02-20 16:10:59 -08:00
10bf273bff Remove explicit DOCKER_API_VERSION from integration env setup
Use the default version because it is used by the client package

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: e73d742cd7deee396eac3c97664b40264ee358cb
Component: engine
2018-02-20 17:27:28 -05:00
49adb54d71 Remove duplicate calls for getting an APIClient
Remove request.SockRequest
Remove request.SockRequestHijack
Remove request.SockRequestRaw()
Remove deprecated ParseHost
Deprecate and unexport more helpers

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 0a91ba2d8cfe16df0ba37c1e283c8e3dbbb086d4
Component: engine
2018-02-20 17:27:24 -05:00
4b504a390c Merge pull request #874 from dnephin/replace-go-bindata
Replace go-bindata with esc
Upstream-commit: 5730ef8ea0
Component: cli
2018-02-20 17:00:22 -05:00
e0869be245 Cleanup volume plugin test with bad assumptions
Test made some bad assumptions about on-disk state of volume data.
This updates the test to only test based on what the volume API is
designed to provide.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 0df654f3d61d8691ee113a8429bcc8ef65786bc7
Component: engine
2018-02-20 16:57:20 -05:00
088ad71eb5 integration/testUpdateCPUQuota: fix name
The function name should be TestUpdateCPUQuota and not TestUpdateCPUQUota.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 31825081d4c5e643a150b515547cb2a2ea223de4
Component: engine
2018-02-20 13:36:27 -08:00
133cf88cac integration/TestUpdateMemory: fix false failure
This fixes the following test failure:

> --- FAIL: TestUpdateMemory (0.53s)
>  	assertions.go:226:
>	Error Trace:	update_linux_test.go:52
>	Error:      	Not equal:
>	            	expected: int(524288000)
>	            	received: int64(524288000)

Fixes: 0f9da07b569f0d9
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: cc866470981a1e6a839004f24eb30bb708078068
Component: engine
2018-02-20 13:31:03 -08:00
180ce35066 Improve docstrings and small cleanup in client
Use client instead of helpers for TLS in integration test

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: a68ae4a2d95b1ff143025a435195af0f1ab30ace
Component: engine
2018-02-20 15:15:02 -05:00
9a83d9fd53 Use gotestyourself env patching
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 2b445a53c17ae6526c11a729cb6d1d1dc57490ff
Component: engine
2018-02-20 15:15:02 -05:00
1b01bb68a9 Merge pull request #87 from corbin-coleman/remove-zesty
Remove ubuntu-zesty from the default DOCKER_BUILD_PKGS in Makefile
Upstream-commit: 2ab6d8ab3a9da8917ef52b87943e3de83a1092a5
Component: packaging
2018-02-20 14:10:25 -06:00
18043a7a58 Remove ubuntu-zesty from the default BUILD_PKGS in Makefile
Zesty is EOL and doesn't even have a subdirectory in the `deb` directory of this repo. There's no need to have it as a default.

Signed-off-by: Corbin <corbin.coleman@docker.com>
Upstream-commit: 9b3e8f85f039dfe7391512de6143ef213574973a
Component: packaging
2018-02-20 11:29:11 -08:00
c2d1fda268 Merge pull request #886 from thaJeztah/dockerfile-outside-context
Allow Dockerfile from outside build-context
Upstream-commit: 82a8085885
Component: cli
2018-02-20 19:56:16 +01:00
4f56c06e93 Merge pull request #892 from thaJeztah/bump-moby-vendor
Bump moby vendor and dependencies
Upstream-commit: 02e8dc6bfc
Component: cli
2018-02-20 18:54:55 +01:00
81f2f8b4a0 Merge pull request #885 from thaJeztah/node-engine-version
Add Engine version to docker node ls
Upstream-commit: 1e8530bc34
Component: cli
2018-02-20 18:45:36 +01:00
8439f579a2 Bump swarmkit to f74983e7c015a38a81c8642803a78b8322cf7eac
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 3c24e5ce12
Component: cli
2018-02-20 18:07:28 +01:00
5a987db87c Merge component 'engine' from git@github.com:moby/moby master 2018-02-20 17:05:31 +00:00
d34627d1e8 Update github.com/containerd/continuity
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 58e29ec11e
Component: cli
2018-02-20 18:03:37 +01:00
7a139c4f49 bump runc to 6c55f98695e902427906eed2c799e566e3d3dfb5
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: e17a680f01
Component: cli
2018-02-20 17:58:11 +01:00
6e43a54340 Update go-connections to 7beb39f0b969b075d1325fecb092faf27fd357b6
- Support parsing SCTP port mapping

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 88874b5eff
Component: cli
2018-02-20 17:45:42 +01:00
112f17c68b Merge component 'cli' from git@github.com:docker/cli master 2018-02-20 16:42:03 +00:00
434d9d7ac3 update golang.org/x/sys for OpenBSD
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: d9f5fa8124
Component: cli
2018-02-20 17:40:06 +01:00
c6e3764db6 Merge pull request #264 from thaJeztah/carry-moby-32803
Update docker kill reference docs
Upstream-commit: bbe7f84540
Component: cli
2018-02-20 11:19:59 -05:00
a964103223 Bump docker/docker to 079ed017b61eb819b8184b90013ce89465d3aaba
- Add API support for SCTP port mapping
- Add canonical import path
- Add `REMOVE` and `ORPHANED` to TaskState
- Fix TLS from environment variables in client
- Introduce NewClientWithOpts func to build custom client easily
- Wrap response errors for container copy methodsto fix error detection using
  `IsErrNotFound` and `IsErrNotImplemented` for `ContainerStatPath`,
  `CopyFromContainer`, and `CopyToContainer` methods.
- Produce errors when empty ids are passed into inspect calls

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: aaa7a7cb95
Component: cli
2018-02-20 17:17:49 +01:00
dbebd52548 Merge pull request #36326 from kolyshkin/integration-exec
Add/use container.Exec() to integration
Upstream-commit: ee9abc212032353e19e5b0f5e6410ad67a0cc9b1
Component: engine
2018-02-20 17:16:09 +01:00
6899375641 Merge pull request #33922 from ishidawataru/sctp
Support SCTP port mapping (bump up API to v1.37)
Upstream-commit: 079ed017b61eb819b8184b90013ce89465d3aaba
Component: engine
2018-02-20 17:00:13 +01:00
c93b94f9bd Allow Dockerfile from outside build-context
Historically, the Dockerfile had to be insde the build-context, because it was
sent as part of the build-context.

3f6dc81e10
added support for passing the Dockerfile through stdin, in which case the
contents of the Dockerfile is injected into the build-context.

This patch uses the same mechanism for situations where the location of the
Dockerfile is passed, and its path is outside of the build-context.

Before this change:

    $ mkdir -p myproject/context myproject/dockerfiles && cd myproject
    $ echo "hello" > context/hello
    $ echo -e "FROM busybox\nCOPY /hello /\nRUN cat /hello" > dockerfiles/Dockerfile
    $ docker build --no-cache -f $PWD/dockerfiles/Dockerfile $PWD/context

    unable to prepare context: the Dockerfile (/Users/sebastiaan/projects/test/dockerfile-outside/myproject/dockerfiles/Dockerfile) must be within the build context

After this change:

    $ mkdir -p myproject/context myproject/dockerfiles && cd myproject
    $ echo "hello" > context/hello
    $ echo -e "FROM busybox\nCOPY /hello /\nRUN cat /hello" > dockerfiles/Dockerfile
    $ docker build --no-cache -f $PWD/dockerfiles/Dockerfile $PWD/context

    Sending build context to Docker daemon  2.607kB
    Step 1/3 : FROM busybox
     ---> 6ad733544a63
    Step 2/3 : COPY /hello /
     ---> 9a5ae1c7be9e
    Step 3/3 : RUN cat /hello
     ---> Running in 20dfef2d180f
    hello
    Removing intermediate container 20dfef2d180f
     ---> ce1748f91bb2
    Successfully built ce1748f91bb2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: a1048523d2
Component: cli
2018-02-20 16:50:49 +01:00
1cf28cd5dc Merge pull request #890 from silvin-lubecki/fix-kube-stack-marshaling
Fix stack marshaling for Kubernetes
Upstream-commit: 7d41d18b43
Component: cli
2018-02-20 16:50:45 +01:00
6362580899 Fix stack marshaling for Kubernetes
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 9b27e92903
Component: cli
2018-02-20 16:43:24 +01:00
bf0c1bd1d9 Update docker kill reference docs
- explain the either "name" or "id" can be used to reference a container
- explain that signals can be sent by name or number

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 0c085c2a77
Component: cli
2018-02-20 14:58:55 +01:00
74fad1551d Merge pull request #888 from trapier/completion-swarm-event-filter-types
Add swarm types to bash completion event type filter
Upstream-commit: e34ca9740e
Component: cli
2018-02-20 10:13:25 +01:00
ded970f96e Merge pull request #36107 from cpuguy83/cleanup_daemon_root_mount
Ensure daemon root is unmounted on shutdown
Upstream-commit: eb033c11753872c6269304d8127dbfe7315e476f
Component: engine
2018-02-20 10:04:41 +01:00
0c0ee07b87 Merge pull request #36330 from vdemeester/migrate-container-list-tests
test: clean/migrate some docker ps cli-only integration tests 
Upstream-commit: 7060a40addd71605862b668c1ec2b889e3540233
Component: engine
2018-02-20 08:44:17 +01:00
ed5d3f9cce Support SCTP port mapping (bump up API to v1.37)
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: 8e435b8279f2af3e0cebd73fa9e25ca1bb26004e
Component: engine
2018-02-20 11:15:36 +09:00
df67d5ea13 Removed root@... PS1 from in-container root prompts, retaining #.
Signed-off-by: Brett Randall <javabrett@gmail.com>
Upstream-commit: bef0cd70a62eff156d99ddd15933b658a1af8893
Component: engine
2018-02-20 11:29:02 +11:00
f4580247c7 test.md improvements and corrections:
- Mentioned integration-cli test-suite deprecation.
- Removed mentions of removed in-container hack/make.sh
  target test-unit, replaced with hack/test/unit.

Signed-off-by: Brett Randall <javabrett@gmail.com>
Upstream-commit: acaa53bc35ab8fa97d75e90da393d39204a86a15
Component: engine
2018-02-20 11:21:03 +11:00
57f5f76274 integration/TestUpdateMemory: simplify
1. Use integration/internal/exec, removing the getContainerSysFSValue().

2. Avoid repeating magic numbers, use a variable for those.

3. Fix order of arguments to assert.Equal (first "expected", then "actual").

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 0f9da07b569f0d9cbe574db3af3951b4d5c968c0
Component: engine
2018-02-19 11:25:27 -08:00
0582099de6 integration/TestUpdateCPUQUota: use exec
An implementation of exec in TestUpdateCPUQUota had a few issues,
including resource leaking and calling both ContainerExecAttach and
ContainerExecRun. The last one makes the test flaky:

	update_linux_test.go:136: expected cgroup value 20000, got: Error: Exec
	command f923baf709525f6b38f6511126addc5d9bb88fb477eeca1c22440551090fa2bb
	is already running

Fix by using the integration/internal/exec package.

While at it, use require/assert to further improve code readability.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 8a7d6143fca69623e2f5d409328c97603843ccb6
Component: engine
2018-02-19 11:25:27 -08:00
b08746e15a integration: add container.Exec()
Some test cases might need an ability to execute a command inside a
container (in order to analyse its output and/or exit code). It is a bit
complicated operation to do so using engine API. The function provided
aims to hide this complexity, making exec almost as simple as 'docker
exec'.

NOTE that the exec is synchronous, and command's stdin is closed.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 01143afe54f1be7308c5663a0cc110740626c62b
Component: engine
2018-02-19 11:25:11 -08:00
5539b125fe Add swarm types to bash completion event type filter
Signed-off-by: Trapier Marshall <trapier.marshall@docker.com>
Upstream-commit: fb80101ca7
Component: cli
2018-02-19 13:46:23 -05:00
39cad2aa10 Merge pull request #36256 from wcwxyz/fix-refcounter-memory-leak
graphdriver: Fix RefCounter memory leak
Upstream-commit: 733ed2ddd3c621dadafbb74feb7b80d20fd3fd6f
Component: engine
2018-02-19 10:32:14 -08:00
c6e83a026f Merge component 'engine' from git@github.com:moby/moby master 2018-02-19 17:05:16 +00:00
7ff06bec92 Merge component 'cli' from git@github.com:docker/cli master 2018-02-19 16:41:15 +00:00
157ffc1e2f Merge pull request #845 from vdemeester/stack-load-the-same
[compose] Share the compose loading code between swarm and k8s stack deploy
Upstream-commit: f56265ae3e
Component: cli
2018-02-19 15:28:40 +01:00
36a89bcfdd Merge pull request #36329 from tonistiigi/tar-cache-fix
builder: fix wrong cache hits building from tars
Upstream-commit: 8cf42d3ad805467be407962f902156a3834062ff
Component: engine
2018-02-19 12:01:20 +01:00
4d022ca109 Merge pull request #880 from vdemeester/container-list-unit-tests
Add unit tests to docker container ls
Upstream-commit: 8900d77a0b
Component: cli
2018-02-19 11:42:10 +01:00
07a8b9380b Add unit tests to docker container ls
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 581b8d9d72
Component: cli
2018-02-19 11:22:36 +01:00
c2407fa324 Clean some cli-only integration tests
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 641c73d211d7efe15255ae36ab2362cef3584260
Component: engine
2018-02-19 11:19:19 +01:00
e46642afe1 Merge pull request #35510 from ripcurld0/fix_35500
Display a warn message when there is binding ports and net mode is host
Upstream-commit: 35d69f10a9ac7479095f39358abb78ee6d3ab65f
Component: engine
2018-02-19 08:57:36 +01:00
da22cbc58d Display a warn message when there is binding ports and net mode is host
When a container is created if "--network" is set to "host" all the
ports in the container are bound to the host.
Thus, adding "-p" or "--publish" to the command-line is meaningless.

Unlike "docker run" and "docker create", "docker service create" sends
an error message when network mode is host and port bindings are given

This patch however suggests to send a warning message to the client when
such a case occurs.

The warning message is added to "warnings" which are returned from
"verifyPlatformContainerSettings".

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: 6e78fdb790d2e1dbf95a1733cab9395b1b936622
Component: engine
2018-02-18 13:28:44 +00:00
60fb0a3d93 Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2018-02-17 17:05:04 +00:00
c523bda1bb Merge component 'engine' from git@github.com:moby/moby master 2018-02-17 17:04:57 +00:00
7cf04c3e9b Merge component 'cli' from git@github.com:docker/cli master 2018-02-17 16:41:15 +00:00
de6daa450d Merge pull request #36339 from thaJeztah/bump-continuity
Update containerd/continuity to fix ARM 32-bit builds
Upstream-commit: c5e7537d2305c1855f95422f08ca844d05a17aa2
Component: engine
2018-02-17 15:18:08 +09:00
3657332c34 Add Engine version to docker node ls
This adds the Engine version to `docker node ls`, and `.EngineVersion` as a
template option.

With this patch applied:

    docker node ls
    ID                            HOSTNAME                STATUS              AVAILABILITY        MANAGER STATUS      ENGINE VERSION
    wp9231itoqsh4rqceojqo01vp *   linuxkit-025000000001   Ready               Active              Leader              18.01.0-ce

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: e888dd711f
Component: cli
2018-02-17 02:58:05 +01:00
75d038d03f Update containerd/continuity to fix ARM 32-bit builds
This updates the containerd/continuity package to d8fb8589b0e8e85b8c8bbaa8840226d0dfeb7371
which fixes builds failing on ARM 32-bit, after this dependency was added in
b3aab5e31faf04d8a29f17be55562e4d0c0cb364

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: f0947a541866ca05b030afe07dd659887a655e3e
Component: engine
2018-02-17 00:42:10 +01:00
dcede7a976 Merge pull request #36303 from dnephin/cleanup-in-daemon-unix
Cleanup unnecessary and duplicate functions in `daemon_unix.go`
Upstream-commit: 747c163a65365933c5d6d7f0740f2ac8e3775287
Component: engine
2018-02-16 14:55:18 -08:00
37bb2f6b53 Merge pull request #883 from anusha-ragunathan/set_default_timeout
Set a non-zero timeout for HTTP client communication with plugin backend.
Upstream-commit: a0044ba3a7
Component: cli
2018-02-16 16:46:55 -05:00
69a82cc567 Merge pull request #75 from seemethere/add_libseccomp_dependency
Add libseccomp requirement for CentOS 7
Upstream-commit: c64bed235096ded43782dfdbd72ca499b04457c0
Component: packaging
2018-02-16 12:09:35 -08:00
8bdc8e0190 Set a non-zero timeout for HTTP client communication with plugin
backend.

Currently, the timeout is set to 0, which means no timeout. Set it to a
sane default timeout of 30 seconds.

Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
Upstream-commit: f1e2030ce8
Component: cli
2018-02-16 12:00:58 -08:00
fbcb172e80 Merge pull request #36144 from emil2k/node-id-required
Produce errors when empty ids are passed into inspect calls. 
Upstream-commit: db360995df97f9d9bcb4eb6a34a5c35a2711795b
Component: engine
2018-02-16 10:18:47 -08:00
b7ea2ca28b Merge component 'engine' from git@github.com:moby/moby master 2018-02-16 17:06:31 +00:00
3e970eb963 Merge component 'cli' from git@github.com:docker/cli master 2018-02-16 16:41:21 +00:00
e537ce0b31 Error out on secret/config templates for older API
Makes sure if the user specifies an older API version that we don't pass
through templating options for versions that templating was not
supported.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: a407761e483d9c5ea425a6fd5e55fec03a90485c
Component: engine
2018-02-16 11:25:14 -05:00
f68c84b9a0 Merge configs/secrets in unix implementation
On unix, merge secrets/configs handling. This is important because
configs can contain secrets (via templating) and potentially a config
could just simply have secret information "by accident" from the user.
This just make sure that configs are as secure as secrets and de-dups a
lot of code.
Generally this makes everything simpler and configs more secure.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: c02171802b788fb2d4d48bebcee2a57c8eabeeaa
Component: engine
2018-02-16 11:25:14 -05:00
850e2bff8c Always mount configs with tmpfs
This makes configs and secrets behavior identical.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 8e8f5f4457d8e1b02031576dbc18c903be4bcfb6
Component: engine
2018-02-16 11:25:14 -05:00
40e1524cb3 daemon: Check return value of createSecretDir
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 426f4e48e3e53b2445835585d7957043a5fe6ab3
Component: engine
2018-02-16 11:25:14 -05:00
599f92e497 Store configs that contain secrets on tmpfs
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: cd3d0486a6f62afac50f2cf74e2b9d8728848c97
Component: engine
2018-02-16 11:25:14 -05:00
82ebb2a6fd integration-cli: Add secret/config templating tests
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: cdd2e6efdbf402c629844cb20955f160327917b9
Component: engine
2018-02-16 11:25:13 -05:00
fc6a93f926 api: Add Templating parameter to SecretSpec and ConfigSpec
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: c5df7235f6a4811f26b37441db401f6b04858504
Component: engine
2018-02-16 11:25:13 -05:00
a6e6cffaed executor: Use a TemplatedDependencyGetter to support template expansion
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 56da5fd7d31c9a627fc6a3c482cb0bf0ffb2d26e
Component: engine
2018-02-16 11:25:13 -05:00
dd73a093e4 Merge pull request #564 from thaJeztah/fix-yaml-examples
Fix leading characters being stripped from example sections in YAML
Upstream-commit: 847cc4bdc0
Component: cli
2018-02-16 11:22:24 -05:00
8a28d41c4f Merge pull request #36335 from thaJeztah/sync-libnetwork-commits
Sync binary commits with vndr
Upstream-commit: 302e584b78db16ea39aca7d7c1612370c50d20f5
Component: engine
2018-02-16 16:12:53 +01:00
44b01cd383 Merge pull request #840 from dekkagaijin/master
GetAll -> Get to retrieve credentials from credential helpers
Upstream-commit: 69432c48db
Component: cli
2018-02-16 15:38:53 +01:00
0a0d1f70a0 Update tomlv for MIT License
The BurntSushi/toml code is now re-licensed as MIT. While
the vendored package was already updated, the tomlv binary
used was still using the old license type.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 508d5a0bc00400fb41395223cb4c8be3d9b74ade
Component: engine
2018-02-16 13:42:27 +01:00
3806697c36 Sync version of userland-proxy with libnetwork vendor
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: dcf9e7ee1a6f1b840e05e88aeb1aaf2415af38ad
Component: engine
2018-02-16 13:41:13 +01:00
d4bbb49d5c Add notes about keeping versions in sync
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 02ca7dc6e91931d6d418cbfa006c0bcf67861ae5
Component: engine
2018-02-16 13:38:45 +01:00
b38d6149be Merge pull request #36306 from cpuguy83/fix_logopt_validator_plugins
Move log validator logic after plugins are loaded
Upstream-commit: 04d97267b6b57987030862c0d355c9a49eb0e445
Component: engine
2018-02-16 11:52:23 +01:00
4a4ea266a9 Merge pull request #828 from thaJeztah/update-authors
Update authors
Upstream-commit: cb85d55e8d
Component: cli
2018-02-16 11:38:58 +01:00
ff398aa5c7 Merge pull request #34900 from dnephin/send-codecov-report
Create and send codecov report
Upstream-commit: 01bfb6d27c6a4b12c777a11c58830a5ef83379a9
Component: engine
2018-02-16 11:36:51 +01:00
d3ed73b92e Update authors
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: f8da04a510
Component: cli
2018-02-16 11:20:05 +01:00
d2ece4f9f2 Merge pull request #536 from thaJeztah/update-gitignore
Update gitignore
Upstream-commit: 2001500c6e
Component: cli
2018-02-16 10:26:58 +01:00
92f3e5322f Merge pull request #372 from jphuynh/completion-zsh-event-filter
Update event filter zsh completion with `disable`, `enable`, `install…
Upstream-commit: c6a7046674
Component: cli
2018-02-16 10:16:40 +01:00
bc08869249 builder: fix wrong cache hits building from tars
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: f6c8266afddcf24a2eb629af3b8e924e9c78ce73
Component: engine
2018-02-15 23:42:42 -08:00
d9b7b3fed0 Document service --network long form
Signed-off-by: Alexander Ryabov <i@sepa.spb.ru>
Upstream-commit: 94ecd2ba73
Component: cli
2018-02-16 09:34:42 +03:00
694d72e031 Merge pull request #36323 from iporsut/remove-getOffsetToReader
Remove unused method from multireader package
Upstream-commit: 89ce4209bd1fed97e30843f7ce1d4b9866ad2ca6
Component: engine
2018-02-15 21:12:41 -05:00
963b00a076 Ensure daemon root is unmounted on shutdown
This is only for the case when dockerd has had to re-mount the daemon
root as shared.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 487c6c7e73dbb7871e80d75f176dd2a3539a2947
Component: engine
2018-02-15 15:58:20 -05:00
cc3e819977 Merge pull request #36304 from Microsoft/jjh/dontrestoreimageformissinglayer
Don't restore image if layer does not exist
Upstream-commit: b1a1234c60cf87048814aa37da523b03a7b0d344
Component: engine
2018-02-15 14:48:36 -05:00
a4ed28f439 Merge pull request #36274 from thaJeztah/bump-swarmkit
Bump SwarmKit to f74983e7c015a38a81c8642803a78b8322cf7eac
Upstream-commit: 1474ec1ecf56a2ec711e42f008cbea4e8287503d
Component: engine
2018-02-15 18:40:09 +01:00
c900fb9923 Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2018-02-15 17:07:08 +00:00
481715cd83 Merge component 'engine' from git@github.com:moby/moby master 2018-02-15 17:07:01 +00:00
fec234b5f1 Merge pull request #878 from adshmh/add-unit-tests-to-plugin-package
Add unit tests to plugin create/remove/enable/disable commands
Upstream-commit: 4bc27c68ac
Component: cli
2018-02-15 18:02:36 +01:00
b4446f4926 Move log validator logic after plugins are loaded
This ensures that all log plugins are registered when the log validator
is run.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: b0b9a25e7e60abbe143e149ccaaf4dfb62044016
Component: engine
2018-02-15 11:53:11 -05:00
25714179da Merge pull request #36322 from thaJeztah/fix-build
Fix import path
Upstream-commit: 7d8fa84e11154bf31644b41c50daaac79f463ad5
Component: engine
2018-02-15 11:52:38 -05:00
1ef968a6d2 Merge component 'cli' from git@github.com:docker/cli master 2018-02-15 16:41:17 +00:00
78ec305ac2 Remove unused method from multireader package
Signed-off-by: Weerasak Chongnguluam <singpor@gmail.com>
Upstream-commit: 6e5fba98a53a832dc1654d87637df14c5b9ab2f1
Component: engine
2018-02-15 23:10:56 +07:00
e8ddf74a02 Test invalid filter and move validation on top
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 05e7f2cf58bdd6c1aaf3da9a92ebcd54cdde6d09
Component: engine
2018-02-15 16:24:26 +01:00
664a0689f9 Fix import path
The utils package was moved to "internal" in commit
af306d149e76b100e08972cda364647bd7bcfe1e

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: ce35439015e4d2190bd82a3b6dfec98f7a12ac90
Component: engine
2018-02-15 15:29:45 +01:00
2b13e6eda3 Merge pull request #36318 from yongtang/02152018-docker-py
Update docker-py to 5e28dcaace5f7b70cbe44c313b7a3b288fa38916
Upstream-commit: 1690103906f3e0554a0a9f7ebaadd86363b212f7
Component: engine
2018-02-15 15:15:23 +01:00
66a715574f Merge pull request #36055 from cpuguy83/slave_mounts_for_root
Use rslave propagation for mounts from daemon root
Upstream-commit: ea34f827112b3837e5349827f6309a37217854cb
Component: engine
2018-02-15 12:57:25 +01:00
7fad1f8a1a Merge pull request #36320 from yongtang/02142018-diff-tests
Migrate container diff tests in integration-cli to api tests.
Upstream-commit: 6f8af32f224c986367bc341df8d4abc1a7b6e018
Component: engine
2018-02-15 03:53:21 -08:00
f2f9da3776 add tests to plugin create/remove/enable/disable commands. Part of work on #37
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
Upstream-commit: 0a914da708
Component: cli
2018-02-15 06:20:26 -05:00
90c87d3cd7 Migrate container diff tests in integration-cli to api tests.
This fix migreates container diff tests in integration-cli
to api tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 9537498cedc4e28ee0c8c26ba3d9e59ebb59fcad
Component: engine
2018-02-15 01:03:29 -08:00
1903b720b8 Remove docker_cli_diff_test.go from integration-cli
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: f19bea20c91e1cd5a748aa241e7083e8c6246634
Component: engine
2018-02-15 01:03:29 -08:00
bb78e86790 Merge pull request #36298 from arm64b/fix-internal-network-mode
Fix `DockerNetworkInternalMode` issue
Upstream-commit: e3102d5055995a43b090dbc29342a1846a39edae
Component: engine
2018-02-15 09:49:15 +01:00
f91bc41f1e Merge pull request #36308 from thaJeztah/bump-containerd-1.0.2
Bump containerd to 1.0.2 (cfd04396dc68220d1cecbe686a6cc3aa5ce3667c)
Upstream-commit: 41bed9e6d55c39abac701db7a8492026886a95d5
Component: engine
2018-02-15 09:12:55 +01:00
28ab1221fd Merge pull request #36315 from dnephin/move-commit-to-container-api
Move commit to container backend
Upstream-commit: d6ac79be3454a3ba34672290218ea5a53b1201a2
Component: engine
2018-02-15 09:10:52 +01:00
d80026fd7e Update docker-py to 5e28dcaace5f7b70cbe44c313b7a3b288fa38916
This fix updates docker-py:
```
-ENV DOCKER_PY_COMMIT 1d6b5b203222ba5df7dedfcd1ee061a452f99c8a
+ENV DOCKER_PY_COMMIT 5e28dcaace5f7b70cbe44c313b7a3b288fa38916
```

The updated docker-py includes https://github.com/docker/docker-py/pull/1909
which is required to have #36292 pass the tests.

Full diff is in 1d6b5b2032...5e28dcaace.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 9d9af83b0fd70ff6a7faa15cf8746669f0f3b588
Component: engine
2018-02-15 07:43:44 +00:00
98a1f0698b Merge pull request #86 from eiais/newPackages
Update readme to supported packages
Upstream-commit: a54da87b1f51743d9b750a8f1d4997e332faa903
Component: packaging
2018-02-14 17:04:13 -08:00
b741266882 Update readme to supported packages
Signed-off-by: Kyle Spiers <kyle@spiers.me>
Upstream-commit: a82d3959676cf185fb7a0511edb036983cedbf21
Component: packaging
2018-02-14 15:21:31 -08:00
0e750709d3 Move commit to container backend
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: e574c5ae73f2f54c47319e5e4a17b16bd93213be
Component: engine
2018-02-14 16:06:12 -05:00
c82207f253 Add libseccomp requirement for CentOS 7
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 86f76496ce33bd6eff1737348bc44add4723ddd2
Component: packaging
2018-02-14 19:17:32 +00:00
a592702237 Remove duplicate rootFSToAPIType
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 4ceea53b5e6a86c39122e99f6ffbc1142d28a174
Component: engine
2018-02-14 11:59:18 -05:00
9e1c0d7187 Remove unnecessary getLayerInit
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: c502bcff33e10be55f15366e123b25574016a9af
Component: engine
2018-02-14 11:59:10 -05:00
8bb8847f9c Merge pull request #36237 from cpuguy83/zfs_do_not_unmount
Do not recursive unmount on cleanup of zfs/btrfs
Upstream-commit: 68c3201626439d5be5c24d14d4fe7e27fe93954d
Component: engine
2018-02-14 09:49:17 -05:00
e156b95318 Merge pull request #35892 from javabrett/dockerfile-on-docker-build-comments
Updated docker-on-docker build-notes.
Upstream-commit: 62c433cd922a9dbd2b989d098fe331c939fe6b71
Component: engine
2018-02-14 09:26:59 -05:00
86dfabe9b6 Share the compose loading code between swarm and k8s stack deploy
To ensure we are loading the composefile the same wether we are pointing
to swarm or kubernetes, we need to share the loading code between both.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 570ee9cb54
Component: cli
2018-02-14 14:07:48 +01:00
1d51022fe8 Updated docker-on-docker build-notes.
These are now more in-line with wiki instructions. Also removes
broken/deprecated make target test-unit.

Signed-off-by: Brett Randall <javabrett@gmail.com>
Upstream-commit: ba49e8c49830b69c833edff3c393716da20f897a
Component: engine
2018-02-14 22:08:37 +11:00
9ab4ce343a Merge pull request #36305 from cpuguy83/35370_fix_logs_eof
Fix log tail with empty logs
Upstream-commit: e698b6e098ac696daa1a7a80d4bdac08b305b328
Component: engine
2018-02-14 16:41:22 +09:00
d88a6732e6 Merge pull request #35749 from thaJeztah/change-swagger-install
Update go-swagger installation steps in Dockerfile
Upstream-commit: 0f6dc962a5ad650dcb3b5a72ce4eb831deacda7b
Component: engine
2018-02-14 08:20:06 +01:00
4d4ce758aa Merge pull request #876 from vdemeester/maintainers-clean
Remove some maintainers 👼
Upstream-commit: 3e5f2f29ad
Component: cli
2018-02-14 08:10:04 +01:00
16fed85531 Merge pull request #36301 from vdemeester/clean-maintainers
Remove some maintainers 👼
Upstream-commit: 72d89c25c0c8d5e0e61f3eec92765c2078924ab2
Component: engine
2018-02-14 08:09:29 +01:00
b660bf165d Unify the frozen images to the multi-arch version
Update and unify the `busybox` images on all arches to the `glibc` multi-arch
version and remove the temp workaround on amd64 which uses the old version
busybox (v1.26) before this PR to bypass the failure of those network related
test cases. Also, this PR will fix all the network related issues with `glibc`
version `busybox` image.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Upstream-commit: 3a971009763387856bb7f162accdf6714100e39b
Component: engine
2018-02-14 03:59:04 +00:00
0fb8610c54 Fix log tail with empty logs
When tailing a container log, if the log file is empty it will cause the
log stream to abort with an unexpected `EOF`.
Note that this only applies to the "current" log file as rotated files
cannot be empty.

This fix just skips adding the "current" file the log tail if it is
empty.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: f40860c5f3d3575629d4a932207e866c1fea625d
Component: engine
2018-02-13 21:33:05 -05:00
c38f2d0ac2 Merge pull request #869 from mistyhacks/3343-swarm-network-plugins
Clarify network plugins and swarm mode
Upstream-commit: 9a264be221
Component: cli
2018-02-13 21:05:44 -05:00
281df74045 Update containerd dependencies to match 1.0.2
- ed1cbe1fc3...4f6e87ae04
- 29da22c617...c0710c92e8
- runc (already ahead)
- 76e68349ad...d452837986

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 175cfdcfb521aa83f6a1441b0a4b99cb159f058d
Component: engine
2018-02-14 02:13:07 +01:00
6d509c76c4 Bump containerd to 1.0.2 (cfd04396dc68220d1cecbe686a6cc3aa5ce3667c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: c2fb6db55be08da95b15bee730a191094f846577
Component: engine
2018-02-14 01:35:22 +01:00
25813b19fa Merge pull request #36269 from Microsoft/jjh/remove-lcow-api-platform-if-omitted
Remove interim env var LCOW_API_PLATFORM_IF_OMITTED
Upstream-commit: 04cb98e6b5e5bd9dac0b92fcc13966498053aa7e
Component: engine
2018-02-13 15:12:18 -08:00
f914512cd5 Merge pull request #36271 from dnephin/use-tag-image-in-commit
Use TagImage in Commit
Upstream-commit: 060893ab5d97d6582770224db3623ad1b3bdb6e1
Component: engine
2018-02-13 16:40:17 -05:00
0f7a16334c Merge pull request #36222 from yongtang/02062018-runc
Update runc to 6c55f98695e902427906eed2c799e566e3d3dfb5
Upstream-commit: 5eb2f98a352de1fb9a32b1795a9f16e6e73bc8db
Component: engine
2018-02-13 12:40:35 -08:00
ea40d8289f Merge pull request #36290 from cpuguy83/use_c8d_fs_pkg
Use continuity fs package for volume copy
Upstream-commit: fc1f95bdb777c59d84e31d56a7a345af92bfe0d8
Component: engine
2018-02-13 15:22:17 -05:00
39948932b1 Don't restore image if layer does not exist
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 6903ca89af71d40aeaa0277dab13d3dc6dd801a7
Component: engine
2018-02-13 11:51:01 -08:00
069181a5f7 Merge pull request #36294 from yongtang/02122018-update
Update api tests to use container.Run/Create in helper package
Upstream-commit: bbd9b7ffdf924de8444b5cbc7c41deb604acc8b7
Component: engine
2018-02-13 13:21:49 -05:00
f29b55d081 Merge component 'engine' from git@github.com:moby/moby master 2018-02-13 17:04:05 +00:00
b624ca41cd Merge component 'cli' from git@github.com:docker/cli master 2018-02-13 16:41:09 +00:00
e04d07e253 Merge pull request #36291 from yongtang/02052018-configs-test
Migrates several swarm configs tests from integration-cli to api tests
Upstream-commit: 82d1aedf5325aadcb35e6fd0bfe2008fe37ac88e
Component: engine
2018-02-13 17:24:26 +01:00
65db1dafe3 Update runc to 6c55f98695e902427906eed2c799e566e3d3dfb5
This fix is related to 36219

This fix updates runc to:
```
-RUNC_COMMIT=9f9c96235cc97674e935002fc3d78361b696a69e
+RUNC_COMMIT=6c55f98695e902427906eed2c799e566e3d3dfb5

-github.com/opencontainers/runc 9f9c96235cc97674e935002fc3d78361b696a69e
+github.com/opencontainers/runc 6c55f98695e902427906eed2c799e566e3d3dfb5
```

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: d644050db2a2e341726df49b7a43fc37c05d554a
Component: engine
2018-02-13 15:56:44 +00:00
366c7398c0 Add WithNetworkMode, WithExposedPorts, WithTty, WithWorkingDir to container helper functions
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: eaa1a0c218454c7f102a1a56c657e806e30d1b1b
Component: engine
2018-02-13 15:45:40 +00:00
7ebcfdf8bd Update api tests to use container.Run/Create in helper package
This fix is a sync up with 36266 so that relevant api tests
use the newly added container.Run/Create in helper package

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 9fcd2a05106af98e6ffd6efb9f124d64426956e4
Component: engine
2018-02-13 14:54:31 +00:00
cd33455198 Clean some maintainers 👼
albers, aluzzardi, ehazlett, icecrime, lk4d4, mavenugo 🤗

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: de664ac749ed25271e6b498aa5b7735dd2f1e026
Component: engine
2018-02-13 14:42:50 +01:00
7f25d42388 Clean some maintainers 👼
aluzzardi, anusha, crosbymichael, ehazlett, johnstep, mavenugo, mlaventure 🤗

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 2a56ebddcb
Component: cli
2018-02-13 11:32:54 +01:00
e6e5d18154 Merge pull request #36299 from liubin/fix-typo-pkg
Fix typo and incorrect return value in pkg
Upstream-commit: 95ce998c10ac407ee0a07c92f14969b573df478e
Component: engine
2018-02-13 01:23:58 -05:00
4efb1e07a3 Merge pull request #875 from kolyshkin/man
Improve man pages
Upstream-commit: 4519c83d44
Component: cli
2018-02-13 00:29:28 +01:00
5f5ee4bd87 Merge pull request #36268 from Microsoft/jjh/rs3-bump
Windows: Bump to final RS3 build number
Upstream-commit: bf1345d0b6d91f24e06d05e741897bc83cf8bab4
Component: engine
2018-02-12 14:49:33 -08:00
f825ac0204 Update integration test to account for SwarmKit change
The PKCS8 changes updated the encryption on the keys so that the
`x509.IsEncryptedPEMBlock` may no longer return true because it cannot
parse the PEM block. The `keyutils` module in SwarmKit can tell whether
it is encrypted either way.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: ed7d7b9b0577895e8305e87816cb52fc4e2a0b92
Component: engine
2018-02-12 23:25:51 +01:00
f0113d4e5a Use continuity fs package for volume copy
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: b3aab5e31faf04d8a29f17be55562e4d0c0cb364
Component: engine
2018-02-12 16:43:51 -05:00
85207ef75c man/docker-run.1.md: --restart, --ipc, --network options
Describe the possible values for `--restart`, `--ipc`, and `--network`
options. While at it, improve formatting for `--name` options arguments.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 0d9bd33bab
Component: cli
2018-02-12 12:43:24 -08:00
bd1e6937cb Bump cpuguy83/go-md2man to v1.0.8
The biggest motivation for this is proper table rendering; in the
old version it was broken so tables were not rendered at al
(i.e. anything that was put into table was lost, for example,
description of LOG_* log levels in dockerd(8) page).

This also fixes lists, including nested lists. This fixes the
description of behavior in docker-cp(1) which is rendered as a tree:

BEFORE:

```
      Assuming a path separator of /, a first argument of SRC_PATH and second
       argument of DEST_PATH, the behavior is as follows:

       · SRC_PATH specifies a file

       · DEST_PATH does not exist

       · the file is saved to a file created at DEST_PATH

       · DEST_PATH does not exist and ends with /

       · Error condition: the destination directory must exist.

...
```

AFTER:
```
      Assuming a path separator of /, a first argument of SRC_PATH and second
       argument of DEST_PATH, the behavior is as follows:

              · SRC_PATH specifies a file

                · DEST_PATH does not exist

                  · the file is saved to a file created at DEST_PATH

                · DEST_PATH does not exist and ends with /

                  · Error condition: the destination directory must exist.

...
```

Manually checking the diff between the man pages generated by the old
and the new version, there are no changes other than the indentation
(.RS/.RE) for lists, and proper formatting for tables. Formatted man
pages also look decent, nothing seems broken.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 6566f5ff2c
Component: cli
2018-02-12 12:01:20 -08:00
c28bbfe97a Migrates several swarm configs tests from integration-cli to api tests
This fix migrates several swarm configs tests from integration-cli to api tests

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 63bd2425fd5ec0dd17aad830652c1b0c5515a31c
Component: engine
2018-02-12 19:38:56 +00:00
f06f7f1849 Remove docker_api_swarm_config_test.go
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 31301769106f53a86d194ad68ff02642204a60cf
Component: engine
2018-02-12 19:33:17 +00:00
51450d870a Replace go-bindata with esc
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: b127b8d927
Component: cli
2018-02-12 14:23:19 -05:00
228b4fffc0 Merge pull request #36246 from sirreal/fix/swagger-buildargs-type
Fix string type for buildargs API definition
Upstream-commit: 9cbe066e2709cb98ff44b687c2fba1956ff95872
Component: engine
2018-02-12 11:21:42 -08:00
ac895d7e08 Merge pull request #36284 from yongtang/02112018-update-tests
Migrate some update restart tests to api tests
Upstream-commit: 919be92823f970bcf26a64bc4002723baac8cb32
Component: engine
2018-02-12 11:21:21 -08:00
86aa3ea787 Merge pull request #36261 from yongtang/02082018-oom-killed
Migrate docker_cli_oom_killed_test.go to api tests
Upstream-commit: 1bb389121d985affeb2a572bc48d3f2cd38582ed
Component: engine
2018-02-12 09:50:26 -08:00
37a1758a61 Merge pull request #36234 from yongtang/02042018-config-ls
Migrate config list tests from integration-cli to api tests
Upstream-commit: 848cf75f1f3cf45ede5817201fd6febe7225c764
Component: engine
2018-02-12 18:36:14 +01:00
134f46c1e9 Merge pull request #36270 from dperny/fix-client-tls
Fix TLS from environment variables in client
Upstream-commit: bc17d0724a2b7843ada42425453517c549472777
Component: engine
2018-02-12 18:35:55 +01:00
53e6b2eab2 Merge pull request #36283 from yongtang/02052018-secrets-tests
Migrates several swarm secrets from integration-cli to api tests
Upstream-commit: 54d56bbcf454435822d6a696fd7477e31aec9f27
Component: engine
2018-02-12 18:34:29 +01:00
be7cd20cb8 Merge component 'engine' from git@github.com:moby/moby master 2018-02-12 17:05:46 +00:00
119c362758 Merge pull request #872 from nogoegst/fix-unsupported-default-credential-store
Fix compilation of defaultCredentialStore() on unsupported platforms
Upstream-commit: dcd62981c4
Component: cli
2018-02-12 11:51:18 -05:00
e286c9f54e Merge component 'cli' from git@github.com:docker/cli master 2018-02-12 16:42:18 +00:00
8b434386b4 Merge pull request #36279 from yongtang/36266-follow-up
Update api tests to use the newly added container helper package
Upstream-commit: 5d26170cfdb16586d8cd1069a0111930499025a6
Component: engine
2018-02-12 08:24:12 -08:00
4d79f94efe Migrate some update restart tests to api tests
This fix migrates some update restart tests in
integration-cli to api tests in integration.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 5b65cee9150b343c97606adc525cf680fb330642
Component: engine
2018-02-12 16:23:08 +00:00
7f1e764c34 Merge pull request #36285 from yongtang/02112018-session-tests
Migrates session tests in integration-cli to api tests
Upstream-commit: 945b786c140b037822c3f1792c3a05a1c16c9a4b
Component: engine
2018-02-12 11:04:49 -05:00
5c9e151bc4 Merge pull request #841 from vdemeester/e2e-kill-test
Add e2e container kill test
Upstream-commit: 85f9fb56b3
Component: cli
2018-02-12 15:14:41 +01:00
4816de08ce Add example buildargs usage
Signed-off-by: Jon Surrell <jon.surrell@gmail.com>
Upstream-commit: 344c73ac672cd4d4f70a08b5a41b6835d9873926
Component: engine
2018-02-12 14:09:37 +01:00
535cb21e7e Reformat to multi-line
Signed-off-by: Jon Surrell <jon.surrell@gmail.com>
Upstream-commit: de2b2b5e4ba0cb297d47a7b05614190fa44f54a2
Component: engine
2018-02-12 14:09:31 +01:00
a6f0fffe6c Merge pull request #36249 from cpuguy83/36145_fix_container_reload
Fix container cleanup on daemon restart
Upstream-commit: 812592d911146791500efc1fb46c3429d9d645b2
Component: engine
2018-02-12 11:36:18 +01:00
afc39de469 Merge pull request #36273 from yongtang/02092018-pause_test
Migrate container pause tests to api tests
Upstream-commit: 5f9570c7ac1775debec250e8b53ff2ff42f36a74
Component: engine
2018-02-12 02:32:52 -08:00
3b4c1991cb Merge pull request #871 from vdemeester/stack-deploy-update-ref
Update reference docs for docker stack deploy
Upstream-commit: 3e344ae425
Component: cli
2018-02-12 11:08:21 +01:00
15d857c4ce Merge pull request #36275 from liubin/fix-daemon
Fix typos in daemon directory
Upstream-commit: 84bde485d754248565b86d2873728da2717e46b9
Component: engine
2018-02-12 09:18:01 +01:00
b61dd8e57f Migrate container pause tests to api tests
This fix migrates container pause tests from integration-cli
to api tests in integration/.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: ea2f076ca986038c48af37feaba6524f32761406
Component: engine
2018-02-12 01:24:43 +00:00
5d80bc453f Migrates session tests in integration-cli to api tests
This fix migrates session tests in integration-cli to
api tests in integration.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 1d40c6a8999bdddbb57c199c2cf6e5d103153e69
Component: engine
2018-02-11 23:14:39 +00:00
46e07309bd Migrates several swarm secrets from integration-cli to api tests
This fix migrates several swarm secrets from integration-cli to api tests

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: f955d2e2042cabaeac8a451b83a507b76e606d33
Component: engine
2018-02-11 21:17:44 +00:00
4571efe6b5 Remove docker_api_swarm_secret_test.go
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 3499557c9b3aa728cb52402c1bb4302f80ab4721
Component: engine
2018-02-11 21:17:25 +00:00
e2c834a1a9 Migrate docker_cli_oom_killed_test.go to api tests
This fix migrates tests in integration-cli/docker_cli_oom_killed_test.go
to api tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 3c21274b76323883e8ffb146fb989850c4de221a
Component: engine
2018-02-11 20:09:32 +00:00
bf8ec4c4d2 Migrate config list tests from integration-cli to api tests
This fix migrates config list tests from integration-cli to api tests

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 246f450ac4fcaff15f36874475f15f435ab03a15
Component: engine
2018-02-11 19:39:56 +00:00
dd36e40493 Remove integration-cli/docker_cli_config_ls_test.go
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 955a2b81940181ef51b31feacbf234dab98e56d1
Component: engine
2018-02-11 19:26:39 +00:00
401e32ece2 Merge component 'engine' from git@github.com:moby/moby master 2018-02-11 17:05:14 +00:00
e3241636cf Merge pull request #36257 from arm64b/fix-inspect-network-timeout
Fix timeout issue of `InspectNetwork` on AArch64
Upstream-commit: 178ebca0b9fdf41d473cd6dd52ff6607bed28fd7
Component: engine
2018-02-11 20:50:08 +09:00
fd34f2aedf Merge pull request #36276 from nogoegst/update-vendor-x-sys
Update golang.org/x/sys vendor
Upstream-commit: 52a65f6e34261158007d6b85fb90ebe65cfa73af
Component: engine
2018-02-11 17:08:15 +09:00
9bb3c2d897 Update api tests to use the newly added container helper package
This fix is a follow up to 36266 to update some api tests
to use the newly added container helper package.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: e9f19df6a9d8ba682f3c9dcdaffed2ac4e0c6189
Component: engine
2018-02-10 23:30:40 +00:00
1d4b488828 Remove integration-cli/docker_cli_pause_test.go
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 6453d49d05a020aef1426c1676d9cc73217c8ff2
Component: engine
2018-02-10 23:03:55 +00:00
396aa8a139 Merge pull request #36266 from vdemeester/integration-container-helper
Add an integration/internal/container helper package 
Upstream-commit: d07d3e71171ea3125d4462e8e509170f7c3e3370
Component: engine
2018-02-10 12:57:58 -08:00
e1e478d6bf Merge component 'engine' from git@github.com:moby/moby master 2018-02-10 17:03:59 +00:00
defd7909c5 Add an integration/internal/container helper package
To help creating/running/… containers using the client for test integration.
This should make test more readable and reduce duplication a bit.

Usage example

```
// Create a default container named foo
id1 := container.Create(t, ctx, client, container.WithName("foo"))
// Run a default container with a custom command
id2 := container.Run(t, ctx, client, container.WithCmd("echo", "hello world"))
```

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 0bb7d42b03bfb125cd50ab50dabe99726e66ab71
Component: engine
2018-02-10 17:29:38 +01:00
3927eb596e Update golang.org/x/sys vendor to 37707fdb30a5b38865cfb95e5aab41707daec7fd
Signed-off-by: Ivan Markin <sw@nogoegst.net>
Upstream-commit: 6f66ccaf507e58f3031a88ec85a84a77c0c3b928
Component: engine
2018-02-10 15:58:20 +00:00
6f3d7b05d2 Fix compilation of defaultCredentialStore() on unsupported platforms
Signed-off-by: Ivan Markin <sw@nogoegst.net>
Upstream-commit: 57c51c8af3
Component: cli
2018-02-10 15:30:32 +00:00
3ca395f582 Merge pull request #36265 from vdemeester/rename-integration-util-to-internal
Rename integration/util to integration/internal
Upstream-commit: 3053006679aa7b6427286f94c3922412ed99f354
Component: engine
2018-02-10 14:25:28 +01:00
6a659ff498 Fix typos in pkg
Signed-off-by: bin liu <liubin0329@gmail.com>
Upstream-commit: 7a7a8a33a4a79e7ea1e67f8a77b4060f95e936ea
Component: engine
2018-02-10 19:43:13 +08:00
4adc380b90 Fix typos in daemon
Signed-off-by: bin liu <liubin0329@gmail.com>
Upstream-commit: b00a67be6e3d3f241879110bd342abaa8e23cbac
Component: engine
2018-02-10 19:42:54 +08:00
1c3e1e8db6 Rename integration/util to integration/internal
Both names have no real sense, but one allows to make sure these packages
aren't used outside of `integration`.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: af306d149e76b100e08972cda364647bd7bcfe1e
Component: engine
2018-02-10 09:16:32 +01:00
7179b03d8b Bump SwarmKit to f74983e7c015a38a81c8642803a78b8322cf7eac
- Replace EC Private Key with PKCS#8 PEMs
- Fix IP overlap with empty EndpointSpec
- Add support for Support SCTP port mapping (depends on changes in libnetwork)
- [orchestrator/updater] Do not reschedule tasks if only placement constraints change and are satisfied by the assigned node
- Ensure task reaper stopChan is closed no more than once
- [manager/dispatcher] Synchronization fixes

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 191324b8f1e1a2b2dbe692f869bfbf525d150ade
Component: engine
2018-02-09 18:39:49 -08:00
81a9d51f50 Merge pull request #36242 from kolyshkin/rwlayer-nil-deref
c.RWLayer: check for nil before use
Upstream-commit: ab3ea81376441e93311c94910be78ac42292c496
Component: engine
2018-02-09 18:13:03 -08:00
8382b77c1c Use TagImage in Commit
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: afb3eda697efebf18d8ac3bbcfd911a5968081e3
Component: engine
2018-02-09 20:53:39 -05:00
d92fe4f6a1 Fix TLS from environment variables in client
A recent change accidently caused any TLS configuration in FromEnv to be
ignored. This change alters WithHost to create a new http client only if
one doesn't already exist, and otherwise applies the logic to the
transport on the existing client. This preserves the TLS configuration
that might already be on the client.

Signed-off-by: Drew Erny <drew.erny@docker.com>
Upstream-commit: 80904e9571e7724328160c97ede6a71864f3c06a
Component: engine
2018-02-09 15:29:32 -08:00
cd579fc565 defaultIndexserver -> defaultIndexServer
Signed-off-by: Jake Sanders <jsand@google.com>
Upstream-commit: e1b607a351
Component: cli
2018-02-09 13:48:01 -08:00
e42b22c770 Merge pull request #36259 from yongtang/02082018-kill_test
Migrate TestKillDifferentUserContainer to api test
Upstream-commit: 2d97f5e7800b43a7ea9106c3c95200c6f4404930
Component: engine
2018-02-09 13:47:35 -08:00
2f849b7e23 Merge pull request #36260 from yongtang/02082018-inspect_test
Migrate docker_api_inspect_unix_test.go to integration api test
Upstream-commit: 5589e9cad1107eb9cf030b73d9375e9a7c84cc47
Component: engine
2018-02-09 13:33:51 -08:00
663c468cfb Merge pull request #36221 from yongtang/02032018-secret_ls
Migrate secret list tests from integration-cli to api tests
Upstream-commit: 9d55eefc1b4553260785c1c09772ccd9660b075f
Component: engine
2018-02-09 13:29:19 -08:00
d3c6f2e0ef Remove interim env var LCOW_API_PLATFORM_IF_OMITTED
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: c111fec758770a37e8674cac312e528e85d89428
Component: engine
2018-02-09 12:05:07 -08:00
0a75e5196f Windows: Bump to final RS3 build number
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: c04504383a913c1af9868b23880c6401651c71b1
Component: engine
2018-02-09 11:39:57 -08:00
5d3102854b Fix container cleanup on daemon restart
When the daemon restores containers on daemon restart, it syncs up with
containerd to determine the existing state. For stopped containers it
then removes the container metadata from containerd.

In some cases this is not handled properly and causes an error when
someone attempts to start that container again.
In particular, this case is just a bad error check.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: c0d56ab71701ba47ca6066c7952e724f4f5977c0
Component: engine
2018-02-09 14:36:36 -05:00
89a07f6033 c.RWLayer: check for nil before use
Since commit e9b9e4ace294230c6b8eb has landed, there is a chance that
container.RWLayer is nil (due to some half-removed container). Let's
check the pointer before use to avoid any potential nil pointer
dereferences, resulting in a daemon crash.

Note that even without the abovementioned commit, it's better to perform
an extra check (even it's totally redundant) rather than to have a
possibility of a daemon crash. In other words, better be safe than
sorry.

[v2: add a test case for daemon.getInspectData]
[v3: add a check for container.Dead and a special error for the case]

Fixes: e9b9e4ace294230c6b8eb
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 195893d38160c0893e326b8674e05ef6714aeaa4
Component: engine
2018-02-09 11:24:09 -08:00
4db928a87d Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2018-02-09 17:07:11 +00:00
13f81c44a2 Merge component 'engine' from git@github.com:moby/moby master 2018-02-09 17:07:05 +00:00
610cac270f Merge component 'cli' from git@github.com:docker/cli master 2018-02-09 16:41:15 +00:00
20c1120c88 Migrate TestKillDifferentUserContainer to api test
This fix migrates TestKillDifferentUserContainer to api test

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 0855922cd3cd1e9d846fd85ef968653ff8649a44
Component: engine
2018-02-09 13:40:32 +00:00
ffb77fa93a Update reference docs for docker stack deploy
`docker stack deploy` now support multiple composefil. This updates the
reference doc to take that fact into account.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 4c50007496
Component: cli
2018-02-09 14:22:45 +01:00
a75949cd5f Migrate docker_api_inspect_unix_test.go to integration api test
This fix migrates docker_api_inspect_unix_test.go to integration api test

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 8197529ca2fabc95b9fc4a7e3ff643740b1f4388
Component: engine
2018-02-09 12:56:07 +00:00
fd856e7e70 Merge pull request #36226 from yongtang/36198-follow-up
Add description to TestContainerNetworkMountsNoChown
Upstream-commit: 7e7f8160fcccce94a45596b4fd41f7ddcf9d910f
Component: engine
2018-02-09 04:39:56 -08:00
b582c47758 Fix timeout issue of InspectNetwork on AArch64
Service of inspect network can't be finished within 10s on AArch64 platform,
so we need to adjust the timeout value avoid to paper cover the real issue, plus
to make the integreation test can continue while not terminate with below error:

> === RUN   TestInspectNetwork
> --- FAIL: TestInspectNetwork (27.65s)
>         daemon.go:285: [de79880f4ed4a] waiting for daemon to start
>         daemon.go:317: [de79880f4ed4a] daemon started
>         inspect_test.go:57: timeout hit after 10s: waiting for tasks to enter run state
>         daemon.go:275: [de79880f4ed4a] exiting daemon
> FAIL
> ---> Making bundle: .integration-daemon-stop (in bundles/test-integration)
> Removing test suite binaries
> Makefile:171: recipe for target 'test-integration' failed

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Upstream-commit: 8f5c1841a8bffb4a7e33f51174177b7ad0182969
Component: engine
2018-02-09 03:20:14 +00:00
9914b54ec0 Merge pull request #36213 from yongtang/02052018-rename_test
Migrate rename tests in integration-cli to api tests
Upstream-commit: afbc9c4cfc5d6f812e3c11c0b0bae8be41f380f7
Component: engine
2018-02-08 18:38:02 -08:00
f74751654b graphdriver: Fix RefCounter memory leak
Signed-off-by: WANG Chao <chao.wang@ucloud.cn>
Upstream-commit: 9015a05606a9bb80f0d8d2e3d43b0b682ca53db4
Component: engine
2018-02-09 10:26:06 +08:00
5072bc0df8 Migrate secret list tests from integration-cli to api tests
This fix migrates secret list tests from integration-cli to api tests

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 9349c035831e09057bd039b8f677fa19d3354f73
Component: engine
2018-02-09 00:45:22 +00:00
62e1fa1243 Remove docker_cli_secret_ls_test.go from integration-cli
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 42465784dcc61aa69b8fcefe4669d20422471fea
Component: engine
2018-02-09 00:45:08 +00:00
f5f60f4ad4 Migrate rename tests in integration-cli to api tests
This fix migrates rename tests in integration-cli to api tests

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: be24a6b11e36b542d37cf168f6d198d5445803a5
Component: engine
2018-02-08 23:27:14 +00:00
a0a24043be Remove broken container check from image prune
The imageRefs map was being popualted with containerID, and accessed
with an imageID which would never match.

Remove this broken code because: 1) it hasn't ever worked so isn't
necessary, and 2) because at best it would be racy

ImageDelete() should already handle preventing of removal of used
images.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 3aa4f7f0d71f04c5cc93d5e80cbdd47b0b5fdb7f
Component: engine
2018-02-08 18:10:46 -05:00
158c963b62 Merge pull request #36241 from yongtang/02072018-create-tests
Migrate TestCreateTmpfsMountsTarget test to api test
Upstream-commit: 15001f83bdb268ce3d4c0191eab39f443cc6ea5c
Component: engine
2018-02-08 14:58:06 -08:00
95ee01fa37 Merge pull request #85 from thaJeztah/bump-golang-1.9.4
Bump Golang to 1.9.4
Upstream-commit: 522d35bf0b10fa675ce18587e5ff766d021dbd82
Component: packaging
2018-02-08 14:56:16 -08:00
4415397c48 Clarify network plugins and swarm mode
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: 16d29b3cd6
Component: cli
2018-02-08 14:08:31 -08:00
8aa2823503 Merge pull request #36140 from vdemeester/integration-container-kill
Migrate some kill integration cli test to api tests
Upstream-commit: 21c9e5701bef4687847adb9c26ac42583a57c174
Component: engine
2018-02-08 09:55:28 -08:00
085b7dfcd2 Merge pull request #36235 from yongtang/02072018-info-api-test
Migrates docker info tests to integration api tests
Upstream-commit: 12ff002eedb602f6c8c36d41876dae15e1587849
Component: engine
2018-02-08 09:55:08 -08:00
7a31f33f22 Merge pull request #868 from thaJeztah/bump-golang-1.9.4
Bump golang to 1.9.4
Upstream-commit: a9ecf823ff
Component: cli
2018-02-08 08:06:52 -08:00
61559bd9ba Migrate TestCreateTmpfsMountsTarget test to api test
This fix migrates TestCreateTmpfsMountsTarget test to api test,
and removed integration-cli/docker_cli_create_unix_test.go

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: f601bc16d555238c86dad1cc0a67bcfcf36a3301
Component: engine
2018-02-08 15:59:12 +00:00
82570b7d22 Migrate some calls to new client function
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 6977f468bbcf43864a5acf6c89c331a9180169e5
Component: engine
2018-02-08 16:21:45 +01:00
c00977eb44 Merge pull request #867 from sungwonh/prune
Clarify description of volume prune command
Upstream-commit: 704d37db8f
Component: cli
2018-02-08 09:56:15 -05:00
8991a8a5bd Merge pull request #36220 from dnephin/support-proxy-in-splunk-driver
Support a proxy in splunk log driver
Upstream-commit: f653485e57a36518085868dcb48b4d924a520877
Component: engine
2018-02-08 15:32:19 +01:00
9887b96613 Move some kill integration cli to api tests
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 2227c8ad5ee2bd2f636651efd4ef70e56c082f85
Component: engine
2018-02-08 15:26:24 +01:00
0590bb4b31 Introduce NewClientWithOpts func to build custom client easily
This allows to create a client with default values and override those
using functors. As an example, `NewEnvClient()` becomes
`NewClientWithOpts(FromEnv)` ; and if you want a different api version
for this client : `NewClientWithOpts(FromEnv, WithVersion("1.35"))`

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 772edd020cc784913973387b00c4d0c526a10a26
Component: engine
2018-02-08 15:26:24 +01:00
83ccee96c3 Merge pull request #36173 from cpuguy83/fix_containerd_crash_spin
Refresh containerd remotes on containerd restarted
Upstream-commit: 384ff69f2f97c0cf0ee2b863bd4d90a82e1cc1a4
Component: engine
2018-02-08 06:19:29 -08:00
d7f3bf126b Merge pull request #36243 from thaJeztah/bump-golang-1.9.4
Bump Golang to 1.9.4
Upstream-commit: 6f33b5a2ab29f3e5db40ed5d958a54e731adca59
Component: engine
2018-02-08 06:17:35 -08:00
e09b72af21 Merge pull request #36224 from dnephin/refactor-commit
Refactor Daemon.Commit()
Upstream-commit: 9769ef333f2af24b30fed0dd7b00384b2df3b953
Component: engine
2018-02-08 21:02:30 +09:00
8ea0c8eb22 Fix string type for buildargs API definition
Signed-off-by: Jon Surrell <jon.surrell@gmail.com>
Upstream-commit: f281358ba2de6204a61cdb062fa67a8b7134739c
Component: engine
2018-02-08 13:00:24 +01:00
940ea8083a Bump golang to 1.9.4
This fixes a vulnerability in `go get` (CVE-2018-6574, http://golang.org/issue/23672),
but shouldn't really affect our code, but it's good to keep in sync.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: b32599761f
Component: cli
2018-02-08 00:56:12 -08:00
909b58836c Remove workaround for Nano server TP5
This workaround for golang/go#15286 was added for Nano server TP5 in
fa82c0aa10cfac8c6d5e2446876dc79b2b0c1bf9, and should no longer be
needed

Due to a security fix in Go 1.9.4/1.8.7, loading the .dll is no longer
allowed, and produces an error:

   .\docker_windows.go:9:3: //go:cgo_import_dynamic main.dummy CommandLineToArgvW%2 "shell32.dll" only allowed in cgo-generated code

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 250193387c98a4ad69a6591d5fe5a39c1409ffba
Component: engine
2018-02-07 23:38:14 -08:00
770eb4a40c Clarify description of volume prune command
volume prune command removes only local volumes
not used by at least one container.

Signed-off-by: Sungwon Han <sungwon.han@navercorp.com>
Upstream-commit: 34504d0a1e
Component: cli
2018-02-08 15:33:07 +09:00
a076c21e0c Remove integration-cli/docker_cli_create_unix_test.go
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 8331a1a5cf1f7f751fdb011cb9e1aa4b0642c1e5
Component: engine
2018-02-08 00:21:29 +00:00
06e15263e9 Bump Golang to 1.9.4
This fixes a vulnerability in `go get` (CVE-2018-6574, http://golang.org/issue/23672),
but shouldn't really affect our code, but it's good to keep in sync.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 6263b1254b179af81ff4ef97563fe2e1a053993a
Component: packaging
2018-02-07 15:15:37 -08:00
72d7f12462 Bump Golang to 1.9.4
This fixes a vulnerability in `go get` (CVE-2018-6574, http://golang.org/issue/23672),
but shouldn't really affect our code, but it's good to keep in sync.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: caeab268430a033fedd27c53be16758ac1a0f71e
Component: engine
2018-02-07 14:49:51 -08:00
fd90b16ff5 Merge pull request #36194 from dnephin/add-canonical-import
Add canonical import path
Upstream-commit: 3a633a712c8bbb863fe7e57ec132dd87a9c4eff7
Component: engine
2018-02-07 13:06:45 -08:00
32c5b53960 Make sure plugin mounts are cleaned up
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: e6f784e3df2095366fd99fd42ab5a2d0b451bd07
Component: engine
2018-02-07 15:54:52 -05:00
eb861a7ae9 Revert "Make plugins dir private."
This reverts commit 0c2821d6f2de692d105e50a399daa65169697cca.

Due to other changes this is no longer needed and resolves some other
issues with plugins.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 37d7b7ddc332541f516d0c41d9ad30b28f2d3e22
Component: engine
2018-02-07 15:48:27 -05:00
90450b2044 Ensure plugin returns correctly scoped paths
Before this change, volume management was relying on the fact that
everything the plugin mounts is visible on the host within the plugin's
rootfs. In practice this caused some issues with mount leaks, so we
changed the behavior such that mounts are not visible on the plugin's
rootfs, but available outside of it, which breaks volume management.

To fix the issue, allow the plugin to scope the path correctly rather
than assuming that everything is visible in `p.Rootfs`.
In practice this is just scoping the `PropagatedMount` paths to the
correct host path.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 0e5eaf8ee32662182147f5f62c1bfebef66f5c47
Component: engine
2018-02-07 15:48:27 -05:00
3928c278e5 Plugins perform propagated mount in runtime spec
Setting up the mounts on the host increases chances of mount leakage and
makes for more cleanup after the plugin has stopped.
With this change all mounts for the plugin are performed by the
container runtime and automatically cleaned up when the container exits.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: a53930a04fa81b082aa78e66b342ff19cc63cc5f
Component: engine
2018-02-07 15:48:27 -05:00
c932e5d2a5 Use runtime spec modifier for metrics plugin hook
Currently the metrics plugin uses a really hackish host mount with
propagated mounts to get the metrics socket into a plugin after the
plugin is alreay running.
This approach ends up leaking mounts which requires setting the plugin
manager root to private, which causes some other issues.

With this change, plugin subsystems can register a set of modifiers to
apply to the plugin's runtime spec before the plugin is ever started.
This will help to generalize some of the customization work that needs
to happen for various plugin subsystems (and future ones).

Specifically it lets the metrics plugin subsystem append a mount to the
runtime spec to mount the metrics socket in the plugin's mount namespace
rather than the host's and prevetns any leaking due to this mount.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 426e610e43179d58b29c496bc79a53f410a4b1e1
Component: engine
2018-02-07 15:48:26 -05:00
4ec1fd107e Refactor commit
The goal of this refactor is to make it easier to integrate buildkit
and containerd snapshotters.

Commit is used from two places (api and build), each calls it
with distinct arguments. Refactored to pull out the common commit
logic and provide different interfaces for each consumer.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: daff039049aea6e19a4bda1df2834d14b4198bc0
Component: engine
2018-02-07 15:09:06 -05:00
33ddc6d172 Do not recursive unmount on cleanup of zfs/btrfs
This was added in #36047 just as a way to make sure the tree is fully
unmounted on shutdown.

For ZFS this could be a breaking change since there was no unmount before.
Someone could have setup the zfs tree themselves. It would be better, if
we really do want the cleanup to actually the unpacked layers checking
for mounts rather than a blind recursive unmount of the root.

BTRFS does not use mounts and does not need to unmount anyway.
These was only an unmount to begin with because for some reason the
btrfs tree was being moutned with `private` propagation.

For the other graphdrivers that still have a recursive unmount here...
these were already being unmounted and performing the recursive unmount
shouldn't break anything. If anyone had anything mounted at the
graphdriver location it would have been unmounted on shutdown anyway.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 2fe4f888bee52b1f256d6fa5e20f9b061d30221c
Component: engine
2018-02-07 15:08:17 -05:00
f68b87fd47 Support a proxy in splunk log driver
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 3c4537d5b33d951237ea5e4cc123953eda7a37e7
Component: engine
2018-02-07 14:52:32 -05:00
3257e049e6 update vendor
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 7d296522f68a80d540b20753ea0648171ee12825
Component: engine
2018-02-07 14:46:24 -05:00
49c61840e2 Use rslave propagation for mounts from daemon root
By default, if a user requests a bind mount it uses private propagation.
When the source path is a path within the daemon root this, along with
some other propagation values that the user can use, causes issues when
the daemon tries to remove a mountpoint because a container will then
have a private reference to that mount which prevents removal.

Unmouting with MNT_DETATCH can help this scenario on newer kernels, but
ultimately this is just covering up the problem and doesn't actually
free up the underlying resources until all references are destroyed.

This change does essentially 2 things:

1. Change the default propagation when unspecified to `rslave` when the
source path is within the daemon root path or a parent of the daemon
root (because everything is using rbinds).
2. Creates a validation error on create when the user tries to specify
an unacceptable propagation mode for these paths...
basically the only two acceptable modes are `rslave` and `rshared`.

In cases where we have used the new default propagation but the
underlying filesystem is not setup to handle it (fs must hvae at least
rshared propagation) instead of erroring out like we normally would,
this falls back to the old default mode of `private`, which preserves
backwards compatibility.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 589a0afa8cbe39b6512662fd1705873e2d236dd0
Component: engine
2018-02-07 14:27:09 -05:00
b2efbde0e3 Migrates docker info tests to integration api tests
This fix migrates docker info tests in integration-cli
to integration tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 68d9beedbe0994af5c91022874daa271b657be8c
Component: engine
2018-02-07 18:26:01 +00:00
e1fe1c5e0c Merge component 'engine' from git@github.com:moby/moby master 2018-02-07 17:06:12 +00:00
1e3931f923 Refresh containerd remotes on containerd restarted
Before this patch, when containerd is restarted (due to a crash, or
kill, whatever), the daemon would keep trying to process the event
stream against the old socket handles. This would lead to a CPU spin due
to the error handling when the client can't connect to containerd.

This change makes sure the containerd remote client is updated for all
registered libcontainerd clients.

This is not neccessarily the ideal fix which would likely require a
major refactor, but at least gets things to a working state with a
minimal patch.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 400126f8698233099259da967378c0a76bc3ea31
Component: engine
2018-02-07 11:53:00 -05:00
c599863a52 Merge component 'cli' from git@github.com:docker/cli master 2018-02-07 16:41:16 +00:00
3122cc53fa Produce errors when empty ids are passed into inspect calls.
If a blank nodeID was previously passed in it resulted in a node list
request. The response would then fail to umarshal into a `Node`
type returning a JSON error.

This adds an extra validation to all inspect calls to check that the ID
that is required is provided and if not return an error.

Signed-off-by: Emil Davtyan <emil2k@gmail.com>
Upstream-commit: 3e6bbefd268f51755be5af0644995297a71a05d7
Component: engine
2018-02-07 14:05:14 +01:00
0919d8f13e Merge pull request #36201 from arm64b/oom-kill-disable-fixing
Daemon: passdown the `--oom-kill-disable` option to containerd
Upstream-commit: 2e8ccbb49e21b8696ad4c39185036a8b7e50402f
Component: engine
2018-02-06 21:39:43 -08:00
9e9ebf27ff Merge pull request #36223 from yongtang/02062018-clean
Combine runSimpleContainer with runContainer for rename test
Upstream-commit: 4ba4b4b283162c4917d773bf49f8d2c7f5de6b3c
Component: engine
2018-02-06 17:26:49 -08:00
d2876760b0 Add description to TestContainerNetworkMountsNoChown
This fix is a follow up to 36198 by adding description
to TestContainerNetworkMountsNoChown so that it is clear
about the purpose of the test for ownership.

This fix is related to comment in 36198.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 28a2187ea7f0484ce515e7ae1662d778dcf94720
Component: engine
2018-02-07 00:19:38 +00:00
f496025a99 Merge pull request #36198 from yongtang/02042018-mount-tests
Migrates TestContainersAPINetworkMountsNoChown to api tests
Upstream-commit: 382c9593bfc73a0bf967557c98a560413c537b42
Component: engine
2018-02-06 14:08:35 -08:00
d3b2389f2d Merge pull request #35414 from madhanrm/hotadd1
Enable HotAdd for Windows
Upstream-commit: e62d36bcad6ef1b1beafb15411f927b25f52c3d1
Component: engine
2018-02-06 10:40:39 -08:00
5007511cdb Merge pull request #863 from WTFKr0/tls-env-var
Add DOCKER_TLS environment variable for --tls option
Upstream-commit: b5df4f69db
Component: cli
2018-02-06 10:24:38 -08:00
20243d6421 Combine runSimpleContainer with runContainer for rename test
As there is already a  runSimpleContainer, I think it makes
sense to combine runSimpleContainer with runContainer for rename test
to reduce code duplication.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 203d871658104b00099d818425b25f4cd1eff55b
Component: engine
2018-02-06 17:11:39 +00:00
64efe2121e Merge component 'engine' from git@github.com:moby/moby master 2018-02-06 17:05:01 +00:00
b4ccef5824 Merge component 'cli' from git@github.com:docker/cli master 2018-02-06 16:41:14 +00:00
607349c14f Migrates TestContainersAPINetworkMountsNoChown to api tests
This fix migrates TestContainersAPINetworkMountsNoChown from
integration-cli to api tests in integration.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: c028da3557cc0e9f80aee9b08118e9947e1fa57a
Component: engine
2018-02-06 15:56:20 +00:00
4056ff9d7d Merge pull request #36188 from yongtang/02012018-TestSecretInspect
Migrate TestSecretInspect from integration-cli to api tests
Upstream-commit: 30a8c6c1094aca87f62f321ea1420865565f1d04
Component: engine
2018-02-06 15:19:08 +01:00
5421c51a06 Merge pull request #569 from vdemeester/compose-multiple-version-mergo
Add support for multiple composefile when deploying
Upstream-commit: 25e969c854
Component: cli
2018-02-06 00:41:43 -08:00
3bb4e932f7 Add DOCKER_TLS environment variable
Signed-off-by: WTFKr0 <thomas.kovatchitch@gmail.com>
Upstream-commit: 42fa3ef7d8
Component: cli
2018-02-06 09:27:05 +01:00
ac13dc6ce4 Use Get rather than GetAll to retrieve credentials from credential helpers.
Signed-off-by: Jake Sanders <jsand@google.com>
Upstream-commit: 1d0a37c460
Component: cli
2018-02-05 20:31:46 -08:00
8e79d4b5b1 Merge pull request #860 from mistyhacks/explain-netio-blockio
Explain the columns shown in docker stats
Upstream-commit: e12f71a9b8
Component: cli
2018-02-05 18:47:24 -08:00
70566138f9 Merge pull request #858 from mistyhacks/add-registry-auth-example
Add an example for --with-registry-auth
Upstream-commit: ce985d04ce
Component: cli
2018-02-05 18:45:50 -08:00
be83c11fb0 Add canonical import comment
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 4f0d95fa6ee7f865597c03b9e63702cdcb0f7067
Component: engine
2018-02-05 16:51:57 -05:00
83bc700def Merge pull request #36192 from yongtang/02012018-docker_cli_nat_test
Migrate some of the nat tests in integration-cli to api tests
Upstream-commit: 090c5bf25a53c8656cddfed275874030a6109ec0
Component: engine
2018-02-05 10:54:43 -08:00
4d238fdd93 Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2018-02-05 18:13:44 +00:00
74954408a8 Merge component 'engine' from git@github.com:moby/moby master 2018-02-05 18:13:38 +00:00
53cc069631 Merge pull request #84 from seemethere/fix_deb_dev
Re-add Git Commit time to deb dev builds
Upstream-commit: 17c691a2dfc4da67dddfb7c33537ba65b5623af3
Component: packaging
2018-02-05 09:46:25 -08:00
44aff4f98f Merge pull request #36191 from cpuguy83/fix_attachable_network_race
Fix race in attachable network attachment
Upstream-commit: 6987557e0cef9bd139128e62d86586a40cda6036
Component: engine
2018-02-05 09:41:35 -08:00
62488ecee8 Merge component 'engine' from git@github.com:moby/moby master 2018-02-05 17:04:33 +00:00
f013c316ca Merge pull request #36202 from AkihiroSuda/remove-wtf
vendor: update BurntSushi/toml for MIT license
Upstream-commit: 874539594333583ea6e3f8459bf9e93ccf19ef35
Component: engine
2018-02-05 09:21:59 +01:00
557565af45 vendor: update BurntSushi/toml for MIT license
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: 6093b917c2fa4fc642ac691489ead1f175f1d6b7
Component: engine
2018-02-05 13:57:49 +09:00
fa06c65a30 Daemon: passdown the --oom-kill-disable option to containerd
Current implementaion of docke daemon doesn't pass down the
`--oom-kill-disable` option specified by the end user to the containerd
when spawning a new docker instance with help from `runc` component, which
results in the `--oom-kill-disable` doesn't work no matter the flag is `true`
or `false`.

This PR will fix this issue reported by #36090

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
Upstream-commit: 44b074d199de84b9af8cc94005fbed4f76bd9ab8
Component: engine
2018-02-05 03:25:59 +00:00
9f86cebf80 Migrate some of the nat tests in integration-cli to api tests
This fix migrates nat tests in docker_cli_nat_test.go
to api tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 8fb933a30b7cb2f1726c1d73001266d520cf121d
Component: engine
2018-02-03 20:18:00 +00:00
1dc4d7c54e Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2018-02-03 17:04:27 +00:00
6a670e72e5 Merge component 'engine' from git@github.com:moby/moby master 2018-02-03 17:04:21 +00:00
1df01c41a2 Merge component 'cli' from git@github.com:docker/cli master 2018-02-03 16:41:09 +00:00
fd2998caea Merge pull request #36119 from cpuguy83/fix_plugin_scanner
Fix issue with plugin scanner going to deep
Upstream-commit: 6e5c2d639f67ae70f54d9f2285f3261440b074aa
Component: engine
2018-02-02 20:19:01 -08:00
51b800faf9 Merge pull request #36193 from dnephin/debug-swagger-gen-failures
Make it easier to debug swagger-gen flakes
Upstream-commit: 39fe5875407bd23a8da25951d7343c66e0cc4482
Component: engine
2018-02-02 19:54:30 -08:00
07e098a3c1 Merge pull request #36137 from fcrisciani/libnetwork-vendoring
Libnetwork revendoring
Upstream-commit: c2b27d5752e5f2b40e4925dd5f23f59313efa581
Component: engine
2018-02-02 21:27:27 -05:00
9640f78dbf Merge pull request #36190 from dnephin/fix-vendor-check
Fix vendor validation
Upstream-commit: a5f15c738a34746b0726d6d33ebab0dcd8d3df02
Component: engine
2018-02-02 16:24:57 -08:00
3443bd57ad Merge pull request #862 from dnephin/fix-vendor-validation
Fix vendor validation (and vendor)
Upstream-commit: 0c80cafe78
Component: cli
2018-02-02 15:34:09 -08:00
39892725fa Migrate usage of newSwarm in integration/service to use integration/utils/swarm.NewSwarm
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 1d40e9289913338eb15de8b8304bcdd329d8e497
Component: engine
2018-02-02 23:28:54 +00:00
b87196602b Re-add Git Commit time to deb dev builds
Dev builds for debian packages previously had system time inserted into
their packaging names while both static and rpm builds instead had the
git commit time.

This commit remedies that by pushing the generation of the debian
package version into a separate script to mirror what is being done in
static and rpm builds.

To give you an idea of what it looks like take the following examples:

```
❯ ./gen-deb-ver ~/work/docker-ce/components/engine/ $(cat ~/work/docker-ce/VERSION)
18.03.0~ce~dev~git20180202.170651.0.e232737
```

```
❯ ./gen-rpm-ver ~/work/docker-ce/components/engine $(cat ~/work/docker-ce/VERSION)
18.03.0.ce 0.0.dev.git20180202.170651.0.e232737 e232737
```

```
❯ ./gen-static-ver ~/work/docker-ce/components/engine/ $(cat ~/work/docker-ce/VERSION)
18.03.0-ce-dev-20180202.170651-e232737
```

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 23e3e42df6cb4e5cafd8648344ad37de25002971
Component: packaging
2018-02-02 23:27:19 +00:00
e73d8c24d7 Libnetwork revendoring
Diff:
5ab4ab8300...20dd462e0a

- Memberlist revendor (fix for deadlock on exit)
- Network diagnostic client
- Fix for ndots configuration

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
Upstream-commit: ec86547244fa329148a096db56f9ade77a7ce7eb
Component: engine
2018-02-02 14:36:32 -08:00
041bf84c58 Migrate TestSecretInspect from integration-cli to api tests
This fix migrates TestSecretInspect from integration-cli to api tests

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 71c794d9126dc4b4626cf6ab90267a990c8923f6
Component: engine
2018-02-02 22:23:12 +00:00
1fa91ec1e6 Merge pull request #82 from seemethere/static_dev_versions
Static Dev builds should include date and sha
Upstream-commit: 015af2c71e77fb99a9882301828bf8eafe4b95df
Component: packaging
2018-02-02 14:20:31 -08:00
6347d30b6f Fix issue with plugin scanner going to deep
The plugin spec says that plugins can live in one of:

- /var/run/docker/plugins/<name>.sock
- /var/run/docker/plugins/<name>/<name>.sock
- /etc/docker/plugins/<name>.[json,spec]
- /etc/docker/plugins/<name>/<name>.<json,spec>
- /usr/lib/docker/plugins/<name>.<json,spec>
- /usr/lib/docker/plugins/<name>/<name>.<json,spec>

However, the plugin scanner which is used by the volume list API was
doing `filepath.Walk`, which will walk the entire tree for each of the
supported paths.
This means that even v2 plugins in
`/var/run/docker/plugins/<id>/<name>.sock` were being detected as a v1
plugin.
When the v1 plugin loader tried to load such a plugin it would log an
error that it couldn't find it because it doesn't match one of the
supported patterns... e.g. when in a subdir, the subdir name must match
the plugin name for the socket.

There is no behavior change as the error is only on the `Scan()` call,
which is passing names to the plugin registry when someone calls the
volume list API.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: b27f70d45a0fbb744c17dda02f597ffa6a47d4d9
Component: engine
2018-02-02 16:49:14 -05:00
99a67602d2 Merge pull request #36146 from yongtang/36142-TaskState
Add `REMOVE` and `ORPHANED` to TaskState
Upstream-commit: 3a6f8cfd5108aa3fac145525b7cd2f4f0439702d
Component: engine
2018-02-02 11:33:25 -08:00
1ccbec4ecc Make it easier to debug swgger-gen flakes
Sometimes this check fails, but git status doesn't give us enough information
to debug the failure.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
Upstream-commit: d80f25d079b84d8aa1e3233464c415e3b5d4480a
Component: engine
2018-02-02 11:07:40 -08:00
cb4ddc2058 Fix vendor validation
vendor/ must be removed first, otherwise files added to vendor/ but not vendor.conf
will not cause the validation to fail

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
Upstream-commit: a6dedd1a12
Component: cli
2018-02-02 11:01:05 -08:00
08f32bbeb8 Remove integration-cli/docker_cli_nat_test.go
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: deae6a5c087eac564dc348fa1f46f57790ed2c84
Component: engine
2018-02-02 18:59:15 +00:00
9256f1dbc3 Fix vendor validation
Previously adding files to vendor/ without adding to vendor.conf would not fail the
validation.

Also be consistent with indentation and use tabs.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
Upstream-commit: 075fd7a9bee630f62f0fa0d7a0a26c660ed504ea
Component: engine
2018-02-02 10:49:57 -08:00
efc7d712c1 Fix race in attachable network attachment
Attachable networks are networks created on the cluster which can then
be attached to by non-swarm containers. These networks are lazily
created on the node that wants to attach to that network.

When no container is currently attached to one of these networks on a
node, and then multiple containers which want that network are started
concurrently, this can cause a race condition in the network attachment
where essentially we try to attach the same network to the node twice.

To easily reproduce this issue you must use a multi-node cluster with a
worker node that has lots of CPUs (I used a 36 CPU node).

Repro steps:

1. On manager, `docker network create -d overlay --attachable test`
2. On worker, `docker create --restart=always --network test busybox
top`, many times... 200 is a good number (but not much more due to
subnet size restrictions)
3. Restart the daemon

When the daemon restarts, it will attempt to start all those containers
simultaneously. Note that you could try to do this yourself over the API,
but it's harder to trigger due to the added latency from going over
the API.

The error produced happens when the daemon tries to start the container
upon allocating the network resources:

```
attaching to network failed, make sure your network options are correct and check manager logs: context deadline exceeded
```

What happens here is the worker makes a network attachment request to
the manager. This is an async call which in the happy case would cause a
task to be placed on the node, which the worker is waiting for to get
the network configuration.
In the case of this race, the error ocurrs on the manager like this:

```
task allocation failure" error="failed during network allocation for task n7bwwwbymj2o2h9asqkza8gom: failed to allocate network IP for task n7bwwwbymj2o2h9asqkza8gom network rj4szie2zfauqnpgh4eri1yue: could not find an available IP" module=node node.id=u3489c490fx1df8onlyfo1v6e
```

The task is not created and the worker times out waiting for the task.

---

The mitigation for this is to make sure that only one attachment reuest
is in flight for a given network at a time *when the network doesn't
already exist on the node*. If the network already exists on the node
there is no need for synchronization because the network is already
allocated and on the node so there is no need to request it from the
manager.

This basically comes down to a race with `Find(network) ||
Create(network)` without any sort of syncronization.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: c379d2681ffe8495a888fb1d0f14973fbdbdc969
Component: engine
2018-02-02 13:46:23 -05:00
b9a24cabc1 Merge pull request #36177 from yongtang/02012018-docker_api_resize_test
Migrate several resize tests from integration-cli to integration
Upstream-commit: 81e651c6d2e26df4ed210a5fd87142dcd7a94dd6
Component: engine
2018-02-02 10:27:24 -08:00
e232737f95 Merge component 'engine' from git@github.com:moby/moby master 2018-02-02 17:06:51 +00:00
a4a00c301a Merge component 'cli' from git@github.com:docker/cli master 2018-02-02 16:41:17 +00:00
08694d3da0 Migrate several resize tests from integration-cli to integration
This fix migrates several resize tests from integration-cli to api tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 8f800c941570ffcd087c920c37d3a368a5a19e6d
Component: engine
2018-02-02 15:21:47 +00:00
c41074cd60 Merge pull request #36178 from yongtang/01302018-TestAPIStatsContainerGetMemoryLimit
Migrate TestAPIStatsContainerGetMemoryLimit from integration-cli to api tests
Upstream-commit: fd87db3769f111cdaf4ed09f0f36a254bf46fbbd
Component: engine
2018-02-01 22:01:05 -08:00
fe9238ad21 Migrate TestAPIStatsContainerGetMemoryLimit from integration-cli to api tests
This fix migrates TestAPIStatsContainerGetMemoryLimit from
integration-cli to api test.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: d5cbde514f4887f5655096bce05faa7b91068038
Component: engine
2018-02-01 22:07:06 +00:00
c38d4936f4 Merge pull request #682 from albers/completion-service-options
Fix and simplify bash completion for service env, mounts and labels
Upstream-commit: 26a2a45967
Component: cli
2018-02-01 14:02:51 -08:00
be8b7a4dfb Merge pull request #851 from mistyhacks/overlay-network-limits
Doc guidance to only use 256 IPs per overlay
Upstream-commit: 19e4389a72
Component: cli
2018-02-01 11:11:27 -08:00
62c3cc507d Merge component 'engine' from git@github.com:moby/moby master 2018-02-01 17:06:44 +00:00
6fbbcc8257 Merge component 'cli' from git@github.com:docker/cli master 2018-02-01 16:41:16 +00:00
02e1927cf7 Remove integration-cli/docker_api_resize_test.go
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: e8d1f35718b3a9869778611b2cb11c2f4407350f
Component: engine
2018-02-01 16:37:01 +00:00
d25b4a3533 Merge pull request #859 from mistyhacks/quotes-around-format-strings
Add quotes around format template
Upstream-commit: 5bf0d76494
Component: cli
2018-01-31 21:40:08 -08:00
20111ede63 Explain the columns shown in docker stats
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: 0219338781
Component: cli
2018-01-31 17:05:54 -08:00
2daf468e57 Add quotes around format template
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: 0b6aeae007
Component: cli
2018-01-31 16:51:43 -08:00
4e10e192e9 Merge pull request #36160 from kolyshkin/layer-not-retained
daemon.cleanupContainer: nullify container RWLayer upon release
Upstream-commit: 53a58da551e961b3710bbbdfabbc162c3f5f30f6
Component: engine
2018-01-31 15:13:00 -08:00
096bbe0b3e Merge pull request #36166 from yongtang/01312018-TestAPIUpdateContainer
Migrate TestAPIUpdateContainer from integration-cli to api tests
Upstream-commit: 5772c4b8a25dfad869ecd83bb986e2b0d08b7a07
Component: engine
2018-01-31 15:02:00 -08:00
d30180eaf5 Merge pull request #857 from mistyhacks/5759_typo-in-builder
Fix doubled word in note
Upstream-commit: 3aac740478
Component: cli
2018-01-31 14:51:37 -08:00
dc47308ffd Add an example for --with-registry-auth
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: 821452629c
Component: cli
2018-01-31 13:38:49 -08:00
0a7bda1a7c Fix doubled word in note
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: a2bb62683d
Component: cli
2018-01-31 13:05:58 -08:00
2fdf0e5bd3 Migrate TestAPIUpdateContainer from integration-cli to api tests
This fix migrates TestAPIUpdateContainer from integration-cli to api tests

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 490edd35829a7dd1144da50105fc377d41a52fc0
Component: engine
2018-01-31 20:02:55 +00:00
e0f0ab1bd4 Merge pull request #36150 from yongtang/36139-ContainerStatus
Fix issue of ExitCode and PID not show up in Task.Status.ContainerStatus
Upstream-commit: 231a4408f2d691838e4f821eedb7439c4e1b3f56
Component: engine
2018-01-31 11:59:53 -08:00
6bed3b4c11 Merge pull request #853 from thaJeztah/bump-go-connections
bump docker/go-connections to 98e7d807e5d804e4e42a98d74d1dd695321224ef
Upstream-commit: 3988d9cfd9
Component: cli
2018-01-31 10:22:41 -08:00
275df9bb2d Merge pull request #852 from thaJeztah/bump-version-18.03
Bump VERSION to 18.03.0-dev
Upstream-commit: 4a03f2a4ae
Component: cli
2018-01-31 10:21:54 -08:00
5aed35b37a Merge pull request #36163 from thaJeztah/bump-go-connections
bump docker/go-connections to 98e7d807e5d804e4e42a98d74d1dd695321224ef
Upstream-commit: e1f98e8ab3cb5ae5c0f452cdd81ac4a954279e62
Component: engine
2018-01-31 09:20:10 -08:00
0cabc3863b Merge component 'engine' from git@github.com:moby/moby master 2018-01-31 17:04:47 +00:00
eba76967d1 Merge component 'cli' from git@github.com:docker/cli master 2018-01-31 16:41:13 +00:00
6f8c4ca576 Remove docker_api_update_unix_test.go
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 8786b09c81e4eed540924ef415ecdfb5f9affa01
Component: engine
2018-01-31 16:10:34 +00:00
877ec711a0 Fix issue of ExitCode and PID not show up in Task.Status.ContainerStatus
This fix tries to address the issue raised in 36139 where
ExitCode and PID does not show up in Task.Status.ContainerStatus

The issue was caused by `json:",omitempty"` in PID and ExitCode
which interprate 0 as null.

This is confusion as ExitCode 0 does have a meaning.

This fix removes  `json:",omitempty"` in ExitCode and PID,
but changes ContainerStatus to pointer so that ContainerStatus
does not show up at all if no content. If ContainerStatus
does have a content, then ExitCode and PID will show up (even if
they are 0).

This fix fixes 36139.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 9247e09944a4c7f3c2f3f20f180c047a19fb6bae
Component: engine
2018-01-31 15:35:19 +00:00
e5e113b93d bump docker/go-connections to 98e7d807e5d804e4e42a98d74d1dd695321224ef
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: b7a9f027f3
Component: cli
2018-01-31 01:38:06 -08:00
aef7840d1c Bump VERSION to 18.03.0-dev
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: beb0d08e48
Component: cli
2018-01-31 01:34:51 -08:00
6744cda526 bump docker/go-connections to 98e7d807e5d804e4e42a98d74d1dd695321224ef
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: a6d35a822eed940260c74e2e7eea6455953ffabe
Component: engine
2018-01-31 01:30:56 -08:00
a0d42db1d4 Merge pull request #36156 from r2d4/move-shell-parser
Move dockerfile ENV shell parser functions into subpackage
Upstream-commit: 421664aba1753b4f9475d6f42b8d18f65950d5ab
Component: engine
2018-01-31 14:48:01 +09:00
d59bd66e1b daemon.cleanupContainer: nullify container RWLayer upon release
ReleaseRWLayer can and should only be called once (unless it returns
an error), but might be called twice in case of a failure from
`system.EnsureRemoveAll(container.Root)`. This results in the
following error:

> Error response from daemon: driver "XXX" failed to remove root filesystem for YYY: layer not retained

The obvious fix is to set container.RWLayer to nil as soon as
ReleaseRWLayer() succeeds.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: e9b9e4ace294230c6b8eb010eda564a2541c4564
Component: engine
2018-01-30 18:50:59 -08:00
3ea1f0df2c Move builder shell parser into subpackage
Moves builder/shell_parser and into its own subpackage at builder/shell since it
has no dependencies other than the standard library. This will make it
much easier to vendor for downstream libraries, without pulling all the
dependencies of builder/.

Fixes #36154

Signed-off-by: Matt Rickard <mrick@google.com>
Upstream-commit: a634526d14639c6b98c509a069ef29e2b69c0ef0
Component: engine
2018-01-30 17:54:39 -08:00
198448e674 Doc guidance to only use 256 IPs per overlay
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: 6085b5d3aa
Component: cli
2018-01-30 15:41:53 -08:00
2cc4e9e5e9 Add e2e container kill test
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 42edad2fc7
Component: cli
2018-01-30 15:38:45 -08:00
090ffb4eb7 Merge pull request #36125 from thaJeztah/fix-plural-singular-node-generic-resources
Fix "--node-generic-resource" singular/plural
Upstream-commit: a80cd04eb5375f0eb7b648e820f694b45983cf2b
Component: engine
2018-01-30 14:38:50 -08:00
7de8b77c33 Merge pull request #848 from mistyhacks/fix-publish-table
Fix the network option table
Upstream-commit: bb9e5ab767
Component: cli
2018-01-30 14:32:32 -08:00
d0e1c8724c Fix the network option table
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: 773ccdec7b
Component: cli
2018-01-30 14:00:48 -08:00
30a8f2b39f Merge pull request #849 from mistyhacks/add-filter-label-example
Add examples of prune by label
Upstream-commit: 0aabbb09b6
Component: cli
2018-01-30 13:52:34 -08:00
835d51fadd Merge pull request #36148 from yongtang/01302018-TestLinksEtcHostsContentMatch
Migrate some integration-cli test to api tests
Upstream-commit: 5e7a245c3f63a29fb0eb96d8897238b9dd3cfc47
Component: engine
2018-01-30 13:38:15 -08:00
3c2369ae51 Merge pull request #36152 from yongtang/01302018-TestAuthAPI
Migrate TestAuthAPI from integration-cli to integration
Upstream-commit: 11ccbeb5c5ceeeaf6a57b766efe7e4701a740f56
Component: engine
2018-01-30 13:37:56 -08:00
b0db1afb21 Add examples of prune by label
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: bc28bf13f7
Component: cli
2018-01-30 11:29:45 -08:00
bbb554bc58 Migrate TestAuthAPI from integration-cli to integration
This fix migrates TestAuthAPI from integration-cli to integration

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: d9247557898d1d15a7349ecb0044b73d4a5a41a9
Component: engine
2018-01-30 19:15:06 +00:00
6d89c35e6e Migrate some integration-cli test to api tests
This fix migrate  TestLinksEtcHostsContentMatch
to api test.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: e6bd20edcbf3b7a6f87a356ab0943714936c70e1
Component: engine
2018-01-30 18:52:48 +00:00
6c2db26f29 Merge component 'engine' from git@github.com:moby/moby master 2018-01-30 17:05:43 +00:00
fe18510901 Add REMOVE and ORPHANED to TaskState
This fix tries to address the issue raised in 36142 where
there are discrepancies between Swarm API and swagger.yaml.

This fix adds two recently added state `REMOVE` and `ORPHANED` to TaskState.

This fix fixes 36142.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: a40687f5ac7df27bc6c6c3a6f69513a397a1a05a
Component: engine
2018-01-30 16:46:05 +00:00
c1528c1357 Merge component 'cli' from git@github.com:docker/cli master 2018-01-30 16:41:38 +00:00
f0d03ada35 Merge pull request #35946 from joelwurtz/patch-2
Fix Volumes property definition in ContainerConfig
Upstream-commit: 40a9d5d24cda0d938f3c41dceef41b97b6b4e847
Component: engine
2018-01-29 20:57:09 -08:00
8c6b3bb86c Merge pull request #36141 from yongtang/01292018-stop_test
Migrate docker_cli_stop_test.go to api test
Upstream-commit: d98cdc490cca30b4928ad82668485111f9b800df
Component: engine
2018-01-29 19:31:01 -08:00
db1ce9af6b Merge pull request #838 from vdemeester/fix-label-file-behavior
Fix `--label-file` weird behavior
Upstream-commit: 9de1b162fa
Component: cli
2018-01-29 17:32:21 -08:00
4d611b9990 Add support for multiple composefile when deploying
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 1872bd802c
Component: cli
2018-01-29 17:27:25 -08:00
12f9c4b018 Migrate docker_cli_stop_test.go to api test
This fix migrate docker_cli_stop_test.go to api test

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 4f378124ff649b844de88c93f6ca70e6b3f5d7d7
Component: engine
2018-01-30 00:55:18 +00:00
f6b5291c4c Merge pull request #844 from tophj-ibm/bump-to-go-1-9-3
Bump Go to 1.9.3 (cont.)
Upstream-commit: 7da324a2f6
Component: cli
2018-01-29 16:17:28 -05:00
98a8916ad3 Merge pull request #36124 from crosbymichael/exec
Use proc/exe for reexec
Upstream-commit: 9d61e5c8c1d85f633643a8b9071393dc417d56dd
Component: engine
2018-01-29 11:41:08 -08:00
aea7a7fc73 Fix --label-file weird behavior
`--label-file` has the exact same behavior as `--env-file`, meaning any
placeholder (i.e. a simple key, no `=` sign, no value), it will get the
value from the environment variable.

For `--label-file` it should just add an empty label.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 2b17f4c8a8
Component: cli
2018-01-29 11:08:54 -08:00
27ced4316d Merge pull request #36131 from yongtang/01282018-swarmkit
Update swarmkit to 68a376dc30d8c4001767c39456b990dbd821371b
Upstream-commit: 9c5686fbd04cced838c601a4bf9583bd4b8b9700
Component: engine
2018-01-29 11:07:13 -08:00
33c438d7c6 Bump Go to 1.9.3
Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: d89f5fa731
Component: cli
2018-01-29 13:43:59 -05:00
9bff0e7832 Merge pull request #36130 from yongtang/36042-secret-config-mode
Fix secret and config mode issue
Upstream-commit: d093aa0ec365e1ffd4db8a513c5b341b9a0d012e
Component: engine
2018-01-29 10:37:24 -08:00
6c313c03fe Merge pull request #36114 from Microsoft/jjh/fixdeadlock-lcowdriver-hotremove
LCOW: Graphdriver fix deadlock in hotRemoveVHDs
Upstream-commit: 03a1df95369ddead968e48697038904c84578d00
Component: engine
2018-01-29 09:57:43 -08:00
691eb859f4 Merge component 'engine' from git@github.com:moby/moby master 2018-01-29 17:04:44 +00:00
13e5898067 Merge pull request #34369 from cyphar/build-buildmode-pie
*: switch to -buildmode=pie
Upstream-commit: cd3c0057ac28b5601196424597d7fed226948386
Component: engine
2018-01-29 23:54:03 +09:00
a94b27c618 Merge pull request #36132 from yongtang/01282018-typo
Fix a typo in CONTRIBUTING.md
Upstream-commit: 4219df22fc138bc9d180ef81ab2838bb85d96ace
Component: engine
2018-01-28 12:21:46 -08:00
a1a0300f4c Merge component 'engine' from git@github.com:moby/moby master 2018-01-28 17:04:35 +00:00
b13e2a39e1 Add test cases for file mode with secret and config.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 65ee7fff02111bf696bc2fec442d07c2957f4151
Component: engine
2018-01-28 16:48:10 +00:00
eac1cd59fb Merge component 'cli' from git@github.com:docker/cli master 2018-01-28 16:41:09 +00:00
7b9944fc04 Merge pull request #36074 from shutefan/master
Update API docs to show that /containers/{id}/kill returns HTTP 409
Upstream-commit: 958200970f4c52fd093aa913632d2d2b79ebf969
Component: engine
2018-01-28 08:32:35 -08:00
82bc59e5d6 Fix secret and config mode issue
This fix tries to address the issue raised in 36042
where secret and config are not configured with the
specified file mode.

This fix update the file mode so that it is not impacted
with umask.

Additional tests have been added.

This fix fixes 36042.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 3305221eefd18ba7712a308c1fb05d4eeeac2cc6
Component: engine
2018-01-28 16:21:41 +00:00
9d28e686ee Update swarmkit to 68a376dc30d8c4001767c39456b990dbd821371b
This fix updates swarmkit to 68a376dc30d8c4001767c39456b990dbd821371b:
```
-github.com/docker/swarmkit 713d79dc8799b33465c58ed120b870c52eb5eb4f
+github.com/docker/swarmkit 68a376dc30d8c4001767c39456b990dbd821371b
```

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: b9923d853076c4ce884246dc3e17955dcf851f16
Component: engine
2018-01-28 16:20:17 +00:00
9a7da567a7 Fix a typo in CONTRIBUTING.md
`seperate` -> `separate`

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: cce360c7b0136f91fdce6e15ec7fb83eb14153f2
Component: engine
2018-01-28 16:19:51 +00:00
b24e274bbe Merge pull request #36099 from thaJeztah/bump-libnetwork3
bump libnetwork to 5ab4ab830062fe8a30a44b75b0bda6b1f4f166a4
Upstream-commit: 9368e9dac3e7202d2b15a83427010db7b062033a
Component: engine
2018-01-27 21:47:29 -08:00
5e3cb1566c Merge pull request #34992 from allencloud/simplify-shutdowntimeout
simplify codes on calculating shutdown timeout
Upstream-commit: c9f1807abbc60236f5552f8dd25e6d484584f037
Component: engine
2018-01-27 18:26:54 -08:00
8f3ae07b6b Merge pull request #717 from albers/completion-images-2
Improve and fix bash completion for images
Upstream-commit: 4586609f71
Component: cli
2018-01-27 17:48:49 -08:00
8d2c67f10d Merge pull request #36095 from yongtang/36083-network-inspect-created-time
Fix issue where network inspect does not show Created time for networks in swarm scope
Upstream-commit: 924fb0e843930ca444e0f3a6632d7cb67a3da479
Component: engine
2018-01-26 17:18:30 -08:00
3d79cf83bd Merge pull request #35911 from ASMfreaK/Russian-Scientsists-addition-to-names-generator
Add more russian scientists in names-generator.go
Upstream-commit: c41c80026b1469d398edee0167ef33653ff82e93
Component: engine
2018-01-26 15:48:58 -08:00
7c5df03153 Fix "--node-generic-resource" singular/plural
Daemon flags that can be specified multiple times use
singlar names for flags, but plural names for the configuration
file.

To make the daemon configuration know how to correlate
the flag with the corresponding configuration option,
`opt.NewNamedListOptsRef()` should be used instead of
`opt.NewListOptsRef()`.

Commit 6702ac590e6148cb3f606388dde93a011cb14931 attempted
to fix the daemon not corresponding the flag with the configuration
file option, but did so by changing the name of the flag
to plural.

This patch reverts that change, and uses `opt.NewNamedListOptsRef()`
instead.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 6e7715d65ba892a47d355e16bf9ad87fb537a2d0
Component: engine
2018-01-26 13:53:13 -08:00
37f71b34b7 Merge pull request #804 from thaJeztah/more-annotations
Annotate "stack" commands to be "swarm" and "kubernetes"
Upstream-commit: a46fa0759d
Component: cli
2018-01-26 15:12:09 -05:00
dce32bffba Use proc/exe for reexec
You don't need to resolve the symlink for the exec as long as the
process is to keep running during execution.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 59ec65cd8cec942cee6cbf2b8327ec57eb5078f0
Component: engine
2018-01-26 14:13:43 -05:00
db2a10168c Merge pull request #36047 from cpuguy83/graphdriver_improvements
Do not make graphdriver homes private mounts.
Upstream-commit: 2c05aefc99d33edde47b08e38978b6c2f4178648
Component: engine
2018-01-26 13:54:30 -05:00
5338e07ad9 Merge pull request #829 from thaJeztah/bump-moby
Bump moby and dependencies
Upstream-commit: 44e93ddd13
Component: cli
2018-01-26 10:42:14 -08:00
4e8a0d189e Simplify codes on calculating shutdown timeout
Signed-off-by: Allen Sun <shlallen1990@gmail.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: de68ac8393d32d2c2028dd11c5816430ad0d8d8b
Component: engine
2018-01-26 09:18:07 -08:00
62e8f8e9af Merge component 'engine' from git@github.com:moby/moby master 2018-01-26 17:03:45 +00:00
a002f8068e LCOW: Graphdriver fix deadlock
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: a44fcd3d27c06aaa60d8d1cbce169f0d982e74b1
Component: engine
2018-01-26 08:57:52 -08:00
b4eb2e9242 Merge pull request #34372 from cpuguy83/more_error_handling_for_pluginrm
Ignore exist/not-exist errors on plugin remove
Upstream-commit: 6d4d3c52ae7c3f910bfc7552a2a673a8338e5b9f
Component: engine
2018-01-25 20:45:17 -08:00
ffe64d412a Merge pull request #36108 from Microsoft/jjh/opengcsv0.3.6
Revendor Microsoft/opengcs @ v0.3.6
Upstream-commit: 3e416acf1d9e295b9d75dc222b7897ecfd22d26e
Component: engine
2018-01-25 16:42:35 -08:00
c49971b835 Merge pull request #36052 from Microsoft/jjh/no-overlay-off-only-one-disk
LCOW: Regular mount if only one layer
Upstream-commit: a8d0e36d0329063af9205b4848d1f5c09bd4c3be
Component: engine
2018-01-25 15:46:16 -08:00
b78f97f4d9 Merge pull request #36116 from yongtang/34655-follow-up
Update API version history for `Init` with `POST /containers/create`
Upstream-commit: 4b9b8d6278b594c26f396044a964a1dd1b32f0f7
Component: engine
2018-01-25 15:36:20 -08:00
96ed38b227 Merge pull request #35979 from emil2k/fix-container-copy-err
Wrap response errors for container copy methods.
Upstream-commit: 1d1845de5464d7ba8e7b735b0d221b1232851ab2
Component: engine
2018-01-25 13:48:49 -08:00
66b09830df Merge pull request #36105 from yongtang/01242018-golint
Golint fix with ro_layer.go
Upstream-commit: 7db39720b27e2028af88b8e692aa056ec0d273eb
Component: engine
2018-01-25 13:22:51 -08:00
2abfa99b63 Update API version history for Init with POST /containers/create
This is a follow up to
https://github.com/moby/moby/pull/34655#pullrequestreview-91096779

to update API version history for `Init` field.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 376658e41485c43de53391000ad52d1281f9c464
Component: engine
2018-01-25 19:05:22 +00:00
39f9f3f6e3 Merge pull request #34655 from nmeyerhans/document-init-api
Add Init API field documentation to swagger
Upstream-commit: 093a5402a041e9648d03d3e6545fa255e8fe96b2
Component: engine
2018-01-25 10:16:27 -08:00
aab82bfc9c Ignore exist/not-exist errors on plugin remove
During a plugin remove, docker performs an `os.Rename` to move the
plugin data dir to a new location before removing to acheive an atomic
removal.

`os.Rename` can return either a `NotExist` error if the source path
doesn't exist, or an `Exist` error if the target path already exists.
Both these cases can happen when there is an error on the final
`os.Remove` call, which is common on older kernels (`device or resource
busy`).

When calling rename, we can safely ignore these error types and proceed
to try and remove the plugin.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 93027b1ff2475b66b6321b5722009fad4def8187
Component: engine
2018-01-25 09:23:54 -08:00
ecf18b66ed Merge component 'engine' from git@github.com:moby/moby master 2018-01-25 17:06:29 +00:00
680f21a8d2 Merge component 'cli' from git@github.com:docker/cli master 2018-01-25 16:43:34 +00:00
32830b59ac Merge pull request #36100 from thaJeztah/update-authors
Update authors
Upstream-commit: a2445fee0cec27cb350c3b80169ec33716a1388e
Component: engine
2018-01-24 20:35:51 -08:00
4772ea5aec Revendor Microsoft/opengcs @ v0.3.6
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: ace588284dc17fc9c92c30e1697558d0b2cc1262
Component: engine
2018-01-24 16:09:58 -08:00
0a23b8e672 Merge pull request #35989 from dani-docker/orca-11380
verbose info is missing for partial overlay ID
Upstream-commit: 2b2265acbb7b1457cd6657a5e4e5503472b306d1
Component: engine
2018-01-24 16:01:31 -08:00
0532f832be Merge pull request #827 from thaJeztah/bump-go-1.9.3
Bump Go to 1.9.3
Upstream-commit: 819df0ebf6
Component: cli
2018-01-24 17:34:05 -05:00
077b817634 Bump Go to 1.9.3
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: ffc7648322
Component: cli
2018-01-24 14:25:13 -08:00
e7e06ee745 Merge pull request #34379 from cpuguy83/mount_optimizations
Optimizations for recursive unmount
Upstream-commit: 59e86068e6b2c23f083bd30b9987fea3fe90ba18
Component: engine
2018-01-24 14:00:58 -08:00
1956fc58bd Merge pull request #36096 from cpuguy83/use_rshared_prop_for_daemon_root
Set daemon root to use shared propagation
Upstream-commit: 3ca99ac2f4a7196097d8f5d037ac10ebbcbb5c3c
Component: engine
2018-01-24 12:24:33 -08:00
f813e83349 Merge pull request #36078 from mixja/multiline-max-event-processing
awslogs - don't add new lines to maximum sized events
Upstream-commit: a636ed5ff473d69e9d0cda352fef0823518f016a
Component: engine
2018-01-24 12:06:49 -08:00
61c1474fc0 Merge pull request #35938 from yongtang/35931-filter-before-since
Fix `before` and `since` filter for `docker ps`
Upstream-commit: 25e56670cf7cd69e60c0d58ed25c33dbb21d3d8e
Component: engine
2018-01-24 12:06:19 -08:00
a0a9bd7e22 Merge pull request #36077 from yongtang/35752-verifyNetworking
Verify NetworkingConfig to make sure EndpointSettings is not nil
Upstream-commit: 914ce4fde798b41144ac931619f39a2c96eab261
Component: engine
2018-01-24 12:05:58 -08:00
13bb02e502 Merge pull request #398 from seemethere/bump_ver_18_03_dev
[master] bump version to 18.03.0-ce-dev
2018-01-24 11:39:43 -08:00
8f89082c26 bump version to 18.03.0-ce-dev
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2018-01-24 19:37:16 +00:00
0093346692 Merge pull request #831 from silvin-lubecki/fix-kubernetes-flags
Fix broken Kubernetes stack flags
Upstream-commit: f9039fe291
Component: cli
2018-01-24 10:45:45 -08:00
ef4aa7ebe5 Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2018-01-24 18:36:44 +00:00
0851fa60de Merge component 'engine' from git@github.com:moby/moby master 2018-01-24 18:36:38 +00:00
4de8cf5f5e Golint fix with ro_layer.go
A small golint fix with ro_layer.go.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 19918b88b7b9fe6fc668847f31c94068c78ef2d1
Component: engine
2018-01-24 18:24:03 +00:00
a42cb7a60a Add Init API field documentation to swagger
Signed-off-by: Noah Meyerhans <nmeyerha@amazon.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 467ea71e5e2a0142c1456e3280d69a9538402fec
Component: engine
2018-01-24 09:46:12 -08:00
896e79bd00 bump libnetwork to 5ab4ab830062fe8a30a44b75b0bda6b1f4f166a4
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: e37374c0673bf56890e33afed112ad9e3a682203
Component: engine
2018-01-24 09:20:18 -08:00
4c8a9a1b98 Using Flags instead of PersistentFlags, as Kubernetes flags seem not to be defined in the "persistent space".
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Upstream-commit: 14fcadffb1
Component: cli
2018-01-24 09:17:08 -08:00
60e5b2e6f7 Merge pull request #36004 from cpuguy83/update_libnetwork
Update libnetwork commit
Upstream-commit: f909bf35906ae97c4729ced3e20645df1cc79166
Component: engine
2018-01-24 08:56:27 -08:00
4d4d834cb8 Merge pull request #83 from thaJeztah/bump-go-1.9.3
Update to go 1.9.3
Upstream-commit: 7ea33ac7993e2abfd2404e147d95a3b41a29ccbe
Component: packaging
2018-01-24 08:12:29 -08:00
62d42837f0 bump swarmkit to 713d79dc8799b33465c58ed120b870c52eb5eb4f
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: a6a51aadcb
Component: cli
2018-01-24 02:13:53 -08:00
6e37587f1a Update runc and image-spec
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 8707bde082
Component: cli
2018-01-24 02:10:17 -08:00
dda53861be Bump go-winio to 0.4.6
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 2bf989e129
Component: cli
2018-01-24 02:04:09 -08:00
b5099bad79 Bump moby/moby to e11bf870a3170a1d2b1e177a0d7ccc66200bd643
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: a3be7a6720
Component: cli
2018-01-24 02:01:24 -08:00
30c21da626 Update authors
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 5db971324794b5de65447919dfe5f456d0730199
Component: engine
2018-01-24 00:55:47 -08:00
6fc26d75dd Update to go 1.9.3
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 0e676c4bde1d429d21ea083a8bc9f40c0fc51269
Component: packaging
2018-01-24 00:20:18 -08:00
65d771b644 Merge pull request #36087 from thaJeztah/bump-go-1.9.3
Bump Go to 1.9.3
Upstream-commit: e11bf870a3170a1d2b1e177a0d7ccc66200bd643
Component: engine
2018-01-23 20:09:33 -05:00
f7ee7db603 Static Dev builds should include date and sha
Adds git date plus git commit sha to static builds if the version being
built for is a development version

Output is similar to: `docker-18.02.0-ce-dev-20180120.170357-fa4fb35.tgz`

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 8a86c3a6a54760b19cd67854bf68e408bd2a17fb
Component: packaging
2018-01-24 00:31:50 +00:00
3fe329a3ed Merge pull request #78 from kolyshkin/tasks-max
Uncomment TasksMax=unlimited for recent distros
Upstream-commit: 33325c8a2598c94bc5136a9fe7213e3ebe152dd7
Component: packaging
2018-01-23 16:05:04 -08:00
f46043cd6e Merge pull request #36056 from Microsoft/jjh/opengcsv0.3.5
Revendor Microsoft/opengcs @ v0.3.5
Upstream-commit: e60b68ad21ea47d02a125e7ab5a917331de22ea7
Component: engine
2018-01-23 18:12:02 -05:00
bb193d7289 Merge pull request #36097 from crosbymichael/runc-hang
Update runc to fix hang during start and exec
Upstream-commit: 1b9d1e80eb62e8e9b4bfc1588432314acb523bfc
Component: engine
2018-01-23 18:08:31 -05:00
91c8e6e25b Merge pull request #35966 from yongtang/33661-network-alias
Fix network alias issue with `network connect`
Upstream-commit: 70a0621f2558061b93ad24f04e9491bb5e0b8fdc
Component: engine
2018-01-23 14:56:28 -08:00
b1dfd77fa4 Set daemon root to use shared propagation
This change sets an explicit mount propagation for the daemon root.
This is useful for people who need to bind mount the docker daemon root
into a container.

Since bind mounting the daemon root should only ever happen with at
least `rlsave` propagation (to prevent the container from holding
references to mounts making it impossible for the daemon to clean up its
resources), we should make sure the user is actually able to this.

Most modern systems have shared root (`/`) propagation by default
already, however there are some cases where this may not be so
(e.g. potentially docker-in-docker scenarios, but also other cases).
So this just gives the daemon a little more control here and provides
a more uniform experience across different systems.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: a510192b86e7eb1e1112f3f625d80687fdec6578
Component: engine
2018-01-23 14:17:08 -08:00
4798645bfb Update runc to fix hang during start and exec
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: d10091c86e75fb78eaba96f433dc2cc06c0a54de
Component: engine
2018-01-23 15:02:31 -05:00
800ee6ea8f Merge pull request #36076 from yongtang/01202018-aws-vendor
Update aws-sdk-go and go-ini
Upstream-commit: 2cd52d074aba841d399bb98ee3a0880808ef4ef4
Component: engine
2018-01-23 11:37:55 -08:00
8dd7e2516b Fix issue where network inspect does not show Created time in swarm scope
This fix tries to address the issue raised in 36083 where
`network inspect` does not show Created time if the network is
created in swarm scope.

The issue was that Created was not converted from swarm api.
This fix addresses the issue.

An unit test has been added.

This fix fixes 36083.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 090c439fb8a863731cc80fcb9932ce5958d8166d
Component: engine
2018-01-23 18:26:51 +00:00
ae55d43f2e Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2018-01-23 17:04:13 +00:00
6c6e8038c9 Merge component 'engine' from git@github.com:moby/moby master 2018-01-23 17:04:07 +00:00
ad2946faa1 Merge component 'cli' from git@github.com:docker/cli master 2018-01-23 16:41:06 +00:00
1530820600 deb/common/rules: fix uncommenting TasksMax
Since systemd version 228, a new setting, `TasksMax`, has appeared,
which limits the number of tasks used by a service (via pids cgroup
controller). Unfortunately, a default for this setting, `DefaultTaskMax`,
is set to 512. In systemd version 231 it is changed to 15% which
practically is 4195, as the value from /proc/sys/kernel/pid_max is
treated like 100%).

Either 512 or 4195 is severily limited value for Docker Engine,
as it can run thousands of containers with thousands of tasks in each,
and the number of tasks limit should be set on a per-container basis
by the Docker user. So, the most reasonable setting for `TasksMax`
is `unlimited`.

Unfortunately, older versions of systemd warn about unknown `TasksMax`
parameter in `docker.service` file, and the warning is rather annoying,
therefore this setting is commented out by default, and is supposed
to be uncommented by the user.

The problem with that is, once the limit is hit, all sorts of bad things
happen and it's not really clear even to an advanced user that this
setting is the source of issues.

Now, `rules` file already contain a hack to check for the systemd
version (during build time) and in case the version is greater than 227,
uncomment the `TasksMax=unlimited` line. Alas, it does not work
during normal builds, the reason being systemd is not installed
into build environments.

An obvious fix would be to add systemd to the list of installed
packages in all Dockerfiles used to build debs. Fortunately,
there is a simpler way, as libsystemd-dev is installed, and
it's a subpackage of systemd built from the same source and
carrying the same version, so it can also be checked.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: d80738e4b4459816c64757a2a63e5d8058d0ccf4
Component: packaging
2018-01-22 21:31:09 -08:00
02b6af2e96 rpm/fedora-2x/spec: enable TasksMax in service file
Since systemd version 228, a new setting, `TasksMax`, has appeared, which
limits the number of tasks used by a service (via pids cgroup
controller). Unfortunately, a default for this setting, `DefaultTaskMax`,
is set to 512. In systemd version 231 it is changed to 15% which
practically is 4195, as the value from /proc/sys/kernel/pid_max is
treated like 100%).

Either 512 or 4195 is severily limited value for Docker Engine, as it
can run thousands of containers with thousands of tasks in each, and
the number of tasks limit should be set on a per-container basis by the
Docker user. So, the most reasonable setting for `TasksMax` is `unlimited`.

Unfortunately, older versions of systemd warn about unknown `TasksMax`
parameter in `docker.service` file, and the warning is rather annoying,
therefore this setting is commented out by default, and is supposed to
be uncommented by the user.

The problem with that is, once the limit is hit, all sorts of bad things
happen and it's not really clear even to an advanced user that this
setting is the source of issues.

As Fedora 25 ships systemd 231, it (and later Fedora releases) support
TasksMax, so it makes total sense to uncomment the setting, this is what
this commit does.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 9055832bb0725f05d518c3ebc9b7cc93a69420c7
Component: packaging
2018-01-22 21:31:09 -08:00
544ec9eef9 Merge pull request #36019 from thaJeztah/improve-config-reload
improve daemon config reload; log active configuration
Upstream-commit: 99cfb5f31ad82238573de3475bf5bb0435ac1ebc
Component: engine
2018-01-22 17:58:25 -08:00
d67508be5d Merge pull request #77 from sargun/master
Add pigz to recommended packages
Upstream-commit: a6543ceeff408dfa9cbb4e75d013bc05bda09c32
Component: packaging
2018-01-22 17:35:51 -08:00
dbb0b294c6 Merge pull request #81 from seemethere/add_dev_rpm
Add dev portion to RPM package version
Upstream-commit: 208ba254d788a0d7bfe4dde92b35b9f2f68aa1d6
Component: packaging
2018-01-22 17:35:16 -08:00
bb0dcf69f8 Add integration test for network connect with alias
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 50af4968911483b5a4e09c45a22f8e9153d81696
Component: engine
2018-01-23 01:04:39 +00:00
74da78f854 Fix network alias issue
This fix tries to address the issue raised in 33661 where
network alias does not work when connect to a network the second time.

This fix address the issue.

This fix fixes 33661.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: d63a5a1ff593f14957f3e0a9678633e8237defc9
Component: engine
2018-01-23 01:04:33 +00:00
9b8e792488 added check for empty source in bind mount
Signed-off-by: Ethan Haynes <ethanhaynes@alumni.harvard.edu>

fixed error by removing punctuation

Signed-off-by: Ethan Haynes <ethanhaynes@alumni.harvard.edu>

removed period

Signed-off-by: Ethan Haynes <ethanhaynes@alumni.harvard.edu>

backtick string to escape double quotes in error messages

Signed-off-by: Ethan Haynes <ethanhaynes@alumni.harvard.edu>

simplified test for bind no source error message

Signed-off-by: Ethan Haynes <ethanhaynes@alumni.harvard.edu>
Upstream-commit: e76d8c9eae
Component: cli
2018-01-22 18:33:58 -06:00
2b99ce1d23 Merge pull request #816 from dnephin/binary-native
Add dockerfile for building on non-amd64 platforms
Upstream-commit: b6a628c295
Component: cli
2018-01-22 16:14:23 -08:00
9e00f0f8fa fix verbose for partial overlay ID
Signed-off-by: Dani Louca <dani.louca@docker.com>
Upstream-commit: 2e0990f1655d151b741e7f7f78ac55e14398339f
Component: engine
2018-01-22 18:50:49 -05:00
fe9a519a3b Annotate "stack" commands to be "swarm" and "kubernetes"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 93c36eb228
Component: cli
2018-01-22 15:44:47 -08:00
8c17001e4f Merge pull request #826 from dnephin/fix-lint-errors
Fix lint on master
Upstream-commit: f2529443a0
Component: cli
2018-01-22 15:16:38 -08:00
5cec7a6e2f Add dev portion to RPM package version
-dev was being removed, per legacy code, but we'd like to add it back
into the naming so that deb / rpm packages will look mostly the same
when compiled with a `-dev` version.

RPMS end up looking like:

docker-ce-18.02.0.ce-0.0.dev.git20180120.170357.0.fa4fb35.el7.centos.x86_64.rpm

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 65e2c3cf9ff8c3130e628a455e3d02921876cdfc
Component: packaging
2018-01-22 23:10:48 +00:00
bc95dc9fb3 Fix merge conflict
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: ae03b006a6
Component: cli
2018-01-22 18:09:47 -05:00
50c6561a9e Merge pull request #35949 from yongtang/34248-carry
Carry #34248 Added tag log option to json-logger and use RawAttrs
Upstream-commit: ea74dbe907f534ba2f59c1173330987c3fa84208
Component: engine
2018-01-22 15:02:54 -08:00
928478219f Merge pull request #36013 from thaJeztah/improve-version-middleware-test
Improve API version-middleware test
Upstream-commit: fbed4eb8c72f56437f2a451f9cd9405814882e2a
Component: engine
2018-01-22 14:59:06 -08:00
e3d68b9fea Merge pull request #780 from thaJeztah/fix-network-add
Fix --network-add adding duplicate networks
Upstream-commit: fbb9de2cfc
Component: cli
2018-01-22 14:45:58 -08:00
e9f8cfe726 Bump Go to 1.9.3
release notes: https://golang.org/doc/devel/release.html#go1.9.minor

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 3cc13511f0c8d7f3aeb382f0444e37592a8b5e69
Component: engine
2018-01-22 13:40:19 -08:00
739f4e49fc Merge pull request #79 from seemethere/remove_f25_aarch64
Removes fedora 25 aarch64 Dockerfile
Upstream-commit: 44a1f4887d9ac3b6cbb08ab779c9e84109b906ba
Component: packaging
2018-01-22 12:15:43 -08:00
40f1f3c105 Removes fedora 25 aarch64 Dockerfile
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 9f717788b588a48d494abe42d7c392bf8fe458d9
Component: packaging
2018-01-22 19:10:56 +00:00
a53f2c40a3 Verify NetworkingConfig to make sure EndpointSettings is not nil
This fix tries to address the issue raised in 35752
where container start will trigger a crash if EndpointSettings is nil.

This fix adds the validation to make sure EndpointSettings != nil

This fix fixes 35752.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 8d2f4cb24129d87674a13319ca48ce8636ee527a
Component: engine
2018-01-22 16:31:10 +00:00
362cc9aedc Don't append new line for maximum sized events
Signed-off-by: Justin Menga <justin.menga@gmail.com>
Upstream-commit: d3e2d55a3d84d41c331151c9633211f0fb6a3096
Component: engine
2018-01-21 14:29:55 +13:00
36e0e57cbe Log active configuration when reloading
When succesfully reloading the daemon configuration, print a message
in the logs with the active configuration:

    INFO[2018-01-15T15:36:20.901688317Z] Got signal to reload configuration, reloading from: /etc/docker/daemon.json
    INFO[2018-01-14T02:23:48.782769942Z] Reloaded configuration: {"mtu":1500,"pidfile":"/var/run/docker.pid","data-root":"/var/lib/docker","exec-root":"/var/run/docker","group":"docker","deprecated-key-path":"/etc/docker/key.json","max-concurrent-downloads":3,"max-concurrent-uploads":5,"shutdown-timeout":15,"debug":true,"hosts":["unix:///var/run/docker.sock"],"log-level":"info","swarm-default-advertise-addr":"","metrics-addr":"","log-driver":"json-file","ip":"0.0.0.0","icc":true,"iptables":true,"ip-forward":true,"ip-masq":true,"userland-proxy":true,"disable-legacy-registry":true,"experimental":false,"network-control-plane-mtu":1500,"runtimes":{"runc":{"path":"docker-runc"}},"default-runtime":"runc","oom-score-adjust":-500,"default-shm-size":67108864,"default-ipc-mode":"shareable"}

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 8378dcf46d017c70df97d6f851e0196b113b422e
Component: engine
2018-01-21 00:56:02 +01:00
c2b247fce6 Move reload-related functions to reload.go
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 6121a8429b9d3a6d20e900c521c2f50fff5db406
Component: engine
2018-01-21 00:55:49 +01:00
d093175f6e Merge pull request #696 from mlaventure/attach-use-containerwait
attach: Use ContainerWait instead of Inspect
Upstream-commit: 44a1168ae5
Component: cli
2018-01-20 23:55:16 +01:00
8adbcf25d6 Update aws-sdk-go and go-ini
This fix updates aws-sdk-go and go-ini to recent versions.
The aws-sdk-go used to be `v1.4.22` which was more than a
year old, and go-ini used to be pre-1.0 release.

This fix updates aws-sdk-go to v1.12.66 and go-ini to v1.25.4:
```
github.com/aws/aws-sdk-go v1.12.66
github.com/go-ini/ini v1.25.4
```

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 79bedc4f46e7fe5870f7d53f27f05d05d0821697
Component: engine
2018-01-20 19:58:25 +00:00
c9b8ded195 Merge pull request #35919 from yongtang/35333-carry
Carry #35333: Devicemapper: ignore Nodata errors when delete thin device
Upstream-commit: db5c006bc8654ab1e4c24a1a9f460bbe4039686e
Component: engine
2018-01-20 18:47:16 +01:00
fa4fb352fe Merge component 'engine' from git@github.com:moby/moby master 2018-01-20 17:03:57 +00:00
5d42f5ba8b Update API docs to show that /containers/{id}/kill returns HTTP 409
Signed-off-by: Stephan Spindler <shutefan@gmail.com>
Upstream-commit: 3a1bb49b41901dd21ab9489937656ab935a690e0
Component: engine
2018-01-20 17:21:49 +01:00
dbd159de4c Merge pull request #36065 from Microsoft/jjh/bumprs3andlcowsupported
Bump to RS3 final build, and remove LCOW_SUPPORTED
Upstream-commit: ef3f7d18da40cda7f33858b787161773d7656714
Component: engine
2018-01-20 19:53:30 +09:00
bde2b4704d Merge pull request #35830 from cpuguy83/unbindable_shm
Make container shm parent unbindable
Upstream-commit: c162e8eb417bbc124c1f89f676aea081ebb6251f
Component: engine
2018-01-19 17:43:30 -08:00
946a37c1e4 Merge pull request #35744 from ndeloof/35702
closes #35702 introduce « exec_die » event
Upstream-commit: f97256cbf1811740cfa9a72f705c8a70195cd468
Component: engine
2018-01-19 15:03:50 -08:00
2859d16079 Merge pull request #35986 from thaJeztah/bump-containerd-1.0.1-rc1
Bump containerd to 1.0.1 (9b55aab90508bd389d7654c4baf173a981477d55)
Upstream-commit: 47a0dcbcd20aa2924c89a38a16a60907506ae4f2
Component: engine
2018-01-19 15:48:36 -05:00
30c97f4539 Merge pull request #36003 from pradipd/upgrade_fix
Fixing ingress network when upgrading from 17.09 to 17.12.
Upstream-commit: 949ee0e5297408e97c9b5444d500a2cecab06609
Component: engine
2018-01-19 15:46:50 -05:00
5e6be7b1c2 Bump RS3 final build, and remove LCOW_SUPPORTED
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 5b24976ad4046a9c071b75df31d9269ad2e84732
Component: engine
2018-01-19 12:22:56 -08:00
12ceea25e6 Merge pull request #36051 from Microsoft/jjh/remotefs-read-return-error
LCOW remotefs - return error in Read() implementation
Upstream-commit: 3c9d023af3428f49241a2e2385dae43151185466
Component: engine
2018-01-19 11:27:13 -08:00
621663ea5d Merge pull request #36061 from adampointer/36060-fix-name-clash
Alias container and network packages to stop name clashes 
Upstream-commit: 507b8be5b3c02d2b99393d5613a6a59071e13786
Component: engine
2018-01-19 09:53:06 -08:00
3cf8a0c442 Carry 34248 Added tag log option to json-logger and use RawAttrs
This fix carries PR 34248: Added tag log option to json-logger

This fix changes to use RawAttrs based on review feedback.

This fix fixes 19803, this fix closes 34248.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: e77267c5a682e2c5aaa32469f2c83c2479d57566
Component: engine
2018-01-19 17:51:20 +00:00
9dd65d097b Added tag log option to json-logger
Fixes #19803
Updated the json-logger to utilize the common log option
'tag' that can define container/image information to include
as part of logging.

When the 'tag' log option is not included, there is no change
to the log content via the json-logger. When the 'tag' log option
is included, the tag will be parsed as a template and the result
will be stored within each log entry as the attribute 'tag'.

Update: Removing test added to integration_cli as those have been deprecated.
Update: Using proper test calls (require and assert) in jsonfilelog_test.go based on review.
Update: Added new unit test configs for logs with tag. Updated unit test error checking.
Update: Cleanup check in jsonlogbytes_test.go to match pending changes in PR #34946.
Update: Merging to correct conflicts from PR #34946.

Signed-off-by: bonczj <josh.bonczkowski@gmail.com>
Upstream-commit: 5f50f4f511cd84e79bf005817af346b1764df27f
Component: engine
2018-01-19 17:41:19 +00:00
3c3132fc24 Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2018-01-19 17:04:04 +00:00
06609b9304 Merge component 'engine' from git@github.com:moby/moby master 2018-01-19 17:03:58 +00:00
c973e2ff26 Merge component 'cli' from git@github.com:docker/cli master 2018-01-19 16:41:06 +00:00
d00d4e32b9 Merge pull request #34859 from Microsoft/jjh/singleimagestore
LCOW: Coalesce daemon stores, allow dual LCOW and WCOW mode
Upstream-commit: bb6ce897378b4ebd0131fd835b01ad5f9af3ebb9
Component: engine
2018-01-19 11:38:30 -05:00
ed76e0e519 Alias container and network packages to stop name clashes
Signed-off-by: Adam Pointer <adam.pointer@gmx.com>
Upstream-commit: 7732ca94fc67a28cbd37c292dc29216255685eba
Component: engine
2018-01-19 10:26:41 +00:00
2cf544120b Revendor Microsoft/opengcs @ v0.3.5
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 042f53737cec84e2f1419e20fe37dd0eb1d5a9fa
Component: engine
2018-01-18 19:17:31 -08:00
fdf41db38c Update libnetwork commit
New Commit: fcf1c3b5e57833aaaa756ae3c4140ea54da00319

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: d23e8a7da58c119a8dda59484e9b180c6f25daed
Component: engine
2018-01-18 20:59:40 -05:00
ebd586c561 LCOW remotefs - return error in Read() implementation
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 6112ad6e7d5d7f5afc698447da80f91bdbf62720
Component: engine
2018-01-18 17:46:58 -08:00
58e2db872f Add pigz to docker-ce spec files
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: cee72837c3dd20296d436c48e48f30c3e7b17e7c
Component: packaging
2018-01-19 00:22:00 +00:00
0b18a391f5 Add pigz to recommended packages
This change is in response to https://github.com/moby/moby/pull/35697
It adds pigz to the recommended binaries that should be installed with
docker-ce.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Upstream-commit: 1ca014b9440a92b46e2e03d879c03ddc5c51d4c0
Component: packaging
2018-01-18 15:51:57 -08:00
46bc3ffbc5 Merge pull request #817 from vdemeester/make-manifest-cmd-experimental
Mark docker-manifest command as experimental (cli)
Upstream-commit: da86425e9f
Component: cli
2018-01-18 17:46:15 -05:00
ac28efa249 Mark docker-manifest command as experimental (cli)
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 2d29732f40
Component: cli
2018-01-18 13:19:33 -08:00
e94c45a5c9 Merge pull request #138 from clnperez/manifest-cmd
Add manifest command
Upstream-commit: 11dfa23a5d
Component: cli
2018-01-18 22:15:49 +01:00
3ca8db9a46 Remove OS() from layer interface
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: c94d34f783944ff6586846ccd11e86925fcee171
Component: engine
2018-01-18 12:56:28 -08:00
676b242a5f Merge pull request #71 from ZeuAlex/rpm_build_aarch64
Aarch64 rpm support 
Upstream-commit: 4cc70e4be06cd19edfbcdab4619bc3c271a4a04c
Component: packaging
2018-01-18 12:55:53 -08:00
40b95b8e94 Address feedback from Tonis
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 0cba7740d41369eee33b671f26276325580bc07b
Component: engine
2018-01-18 12:30:39 -08:00
942fd3c62c LCOW: Regular mount if only one layer
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 420dc4eeb48b155e6b83fccf62f8727ce4bf5b21
Component: engine
2018-01-18 12:01:58 -08:00
9e8b44781f Merge pull request #35965 from thaJeztah/fix-volume-create-statuscode
Return 400 status instead of 500 for empty volume create body
Upstream-commit: 39377bb96d459d2ef59bd2bad75468638a7f86a3
Component: engine
2018-01-18 20:02:33 +01:00
b4c44961cf Merge pull request #36030 from cpuguy83/quota_update
Ensure CPU quota/period updates are sent to runc
Upstream-commit: 0fa3962b8d8d78020c7e636c4bcea14d618929e1
Component: engine
2018-01-18 19:54:10 +01:00
3fa889eb3f Add dockerfile for building on non-amd64 platforms
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 02ca1c8573
Component: cli
2018-01-18 13:16:58 -05:00
86ca16658d Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2018-01-18 17:04:03 +00:00
3ee93da859 Merge component 'engine' from git@github.com:moby/moby master 2018-01-18 17:03:57 +00:00
dc08aa82a2 add manifest cmd cli doc
Signed-off-by: Christy Norman Perez <christy@linux.vnet.ibm.com>
Upstream-commit: 6c6ce22447
Component: cli
2018-01-18 10:53:09 -06:00
a654d0d2d6 Merge component 'cli' from git@github.com:docker/cli master 2018-01-18 16:41:08 +00:00
852153685d LCOW: Refactor to multiple layer-stores based on feedback
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: afd305c4b5682fbc297e1685e2b7a49628b7c7f0
Component: engine
2018-01-18 08:31:05 -08:00
33860da10b LCOW: Re-coalesce stores
Signed-off-by: John Howard <jhoward@microsoft.com>

The re-coalesces the daemon stores which were split as part of the
original LCOW implementation.

This is part of the work discussed in https://github.com/moby/moby/issues/34617,
in particular see the document linked to in that issue.
Upstream-commit: ce8e529e182bde057cdfafded62c210b7293b8ba
Component: engine
2018-01-18 08:29:19 -08:00
ce1ad508f6 Merge pull request #35960 from abhi/service
Disable service on release network
Upstream-commit: 6feae060033544985e548dcf1b9127f8f634fe2b
Component: engine
2018-01-18 11:19:47 -05:00
9b47a9d16f Do not make graphdriver homes private mounts.
The idea behind making the graphdrivers private is to prevent leaking
mounts into other namespaces.
Unfortunately this is not really what happens.

There is one case where this does work, and that is when the namespace
was created before the daemon's namespace.
However with systemd each system servie winds up with it's own mount
namespace. This causes a race betwen daemon startup and other system
services as to if the mount is actually private.

This also means there is a negative impact when other system services
are started while the daemon is running.

Basically there are too many things that the daemon does not have
control over (nor should it) to be able to protect against these kinds
of leakages. One thing is certain, setting the graphdriver roots to
private disconnects the mount ns heirarchy preventing propagation of
unmounts... new mounts are of course not propagated either, but the
behavior is racey (or just bad in the case of restarting services)... so
it's better to just be able to keep mount propagation in tact.

It also does not protect situations like `-v
/var/lib/docker:/var/lib/docker` where all mounts are recursively bound
into the container anyway.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 9803272f2db84df7955b16c0d847ad72cdc494d1
Component: engine
2018-01-18 09:34:00 -05:00
2096535fce Fixes for libcontainer changes
Libcontainer no longer provides placeholders for
unsupported platforms, which cause the Windows
builds to fail.

This patch moves features that are not supported
to platform-specific files.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: d1c34831e930c1f6b3de28cab3f4a358845a79d5
Component: engine
2018-01-18 10:08:12 +01:00
8d6e00613b Bump runc to 7f24b40cc5423969b4554ef04ba0b00e2b4ba010
matching the version that's used by containerd 1.0.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: f58aa31075bf74ab8d2369dafb591ae43ed36ee6
Component: engine
2018-01-18 10:07:50 +01:00
c6678dac69 Bump containerd to 1.0.1 (9b55aab90508bd389d7654c4baf173a981477d55)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 9047f66b1edd4dffcafc34f9c7f3390ddd65d10b
Component: engine
2018-01-18 10:06:37 +01:00
2138e8ddb5 Merge pull request #73 from seemethere/remove_zesty
Remove Ubuntu Zesty
Upstream-commit: f8f8219caef8a92c6c87b92377d476af44d76b7c
Component: packaging
2018-01-17 15:12:34 -08:00
3e6e651fda Merge pull request #814 from dnephin/fix-builder-env-docs
Improve builder ENV docs
Upstream-commit: 4f550018bb
Component: cli
2018-01-17 23:26:42 +01:00
2b31b5d6e4 libnetwork vendor
Signed-off-by: abhi <abhi@docker.com>
Upstream-commit: dad093cc34497bb7912c769e469a3e79a0c2c63c
Component: engine
2018-01-17 14:20:04 -08:00
2012c45c5a Disable service on release network
This PR contains a fix for moby/moby#30321. There was a moby/moby#31142
PR intending to fix the issue by adding a delay between disabling the
service in the cluster and the shutdown of the tasks. However
disabling the service was not deleting the service info in the cluster.
Added a fix to delete service info from cluster and verified using siege
to ensure there is zero downtime on rolling update of a service.In order
to support it and ensure consitency of enabling and disable service knob
from the daemon, we need to ensure we disable service when we release
the network from the container. This helps in making the enable and
disable service less racy. The corresponding part of libnetwork fix is
part of docker/libnetwork#1824

Signed-off-by: abhi <abhi@docker.com>
Upstream-commit: a042e5a20a7801efc936daf7a639487bb37ca966
Component: engine
2018-01-17 14:19:51 -08:00
33df5a9f66 Update buidler ENV docs
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 01b521c002
Component: cli
2018-01-17 16:55:07 -05:00
d782361adb Merge pull request #36043 from Microsoft/jjh/fixopenfilecall
LCOW: Fix OpenFile parameters
Upstream-commit: ef3988a81f5dca972b129df527f3e4f8bba200b8
Component: engine
2018-01-17 12:03:11 -08:00
28df99f4fa Merge pull request #35697 from sargun/use-pgzip
Make image (layer) downloads faster by using pigz
Upstream-commit: 871afbb304422877e683cbafc0ebd0b029b85379
Component: engine
2018-01-17 11:18:20 -08:00
0986b8a32c Fixing ingress network when upgrading from 17.09 to 17.12.
Signed-off-by: Pradip Dhara <pradipd@microsoft.com>

Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
Upstream-commit: 2d7a50e5855ad0571e76d29cd1ab9f8f3a48433b
Component: engine
2018-01-17 17:11:18 +00:00
b602be47f6 Merge component 'engine' from git@github.com:moby/moby master 2018-01-17 17:04:48 +00:00
1c449fb090 Merge component 'cli' from git@github.com:docker/cli master 2018-01-17 16:41:12 +00:00
5a20e1240c LCOW: Fix OpenFile parameters
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 141b9a74716c016029badf16aca21dc96975aaac
Component: engine
2018-01-17 07:58:18 -08:00
0e51141e24 Merge pull request #35441 from cpuguy83/plugin_timeout
Add timeouts for volume plugin ops
Upstream-commit: f0b0f2038d085066f340f24f3a9a9683bd4aa35f
Component: engine
2018-01-17 14:49:41 +01:00
19e1833a23 Merge pull request #36033 from cpuguy83/improve_zfs_debug_message
Improve zfs init log message for zfs
Upstream-commit: 1338fcf58aafed25c0da4952793fec1c4055c894
Component: engine
2018-01-16 21:03:53 -08:00
eaa41c5725 Merge pull request #36036 from kolyshkin/plugins
daemon.cleanupMetricsPlugins(): fix
Upstream-commit: 991d64eeb3ee97078a03b88185bee177c6551896
Component: engine
2018-01-17 13:54:46 +09:00
dede819b22 Merge pull request #36034 from dnephin/update-gty
update gotestyourself vendor
Upstream-commit: d84b8802b9fab72c0b66520e54a26c605ddee00b
Component: engine
2018-01-16 19:42:54 -08:00
a5a13dc0e0 Merge pull request #36035 from kolyshkin/gometalinter
gometalinter: fix --deadline option
Upstream-commit: 5488cce5d2effca1e9ae82d8d73d667cf878fd14
Component: engine
2018-01-17 12:04:01 +09:00
4a656e30d0 Improve zfs init log message for zfs
Signed-off-by: Drew Hubl <drew.hubl@gmail.com>
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 27b002f4a02e2d9f6eded9004b82cb81f121264f
Component: engine
2018-01-16 21:42:05 -05:00
7da3044682 Add timeouts for volume plugin ops
This protects the daemon from volume plugins that are slow or
deadlocked.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: b15f8d2d4f054a87052a7065c50441f7e8479fa9
Component: engine
2018-01-16 20:30:49 -05:00
d8a82d08f1 daemon.cleanupMetricsPlugins(): fix
A linter (vet) found the following bug in the code:

> daemon/metrics.go:124::error: range variable p captured by func literal (vet)

Here a variable p is used in an async fashion by goroutine, and most
probably by the time of use it is set to the last element of a range.

For example, the following code

```go
	for _, c := range []string{"here ", "we ", "go"} {
		go func() {
			fmt.Print(c)
		}()
	}
```

will print `gogogo` rather than `here we go` as one would expect.

Fixes: 0e8e8f0f31 ("Add support for metrics plugins")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 9db2c62488734a44a4f1bb9a0252c520b787acfe
Component: engine
2018-01-16 15:15:11 -08:00
374fd77d92 update gotestyourself
pickup changes which use t.Helper()

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 4ac4b690f78a645cc50030b81077fd5319b53501
Component: engine
2018-01-16 17:43:47 -05:00
cd6c81a6fb gometalinter: fix --deadline option
1. Add = between the option and the argument, otherwise the argument
   appears to be passed on to the linters directly, as in:

> DEBUG: [golint.8]: executing /home/kir/go/bin/golint
> -min_confidence 0.800000 ./10m ./api ./api/errdefs <...>

2. Fix setting the default for GOMETALINTER_OPTS -- the default
   was -deadline (rather than --deadline).

Fixes: b96093fa56a9 ("gometalinter: add per-platform configurable options")

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: c11508a5f405084da13c35ee7ab62f1670e4da39
Component: engine
2018-01-16 14:37:11 -08:00
837b878f9d Merge pull request #581 from thaJeztah/better-port-range-printing
Improve presentation of published port ranges
Upstream-commit: fab4762941
Component: cli
2018-01-16 17:16:45 -05:00
01a3b0d1ac Merge pull request #812 from thaJeztah/fix-builder-quote
Fix stray quote in builder.md
Upstream-commit: 44094b5219
Component: cli
2018-01-16 23:15:18 +01:00
42cf4bc867 Fix stray quote in builder.md
Signed-off-by: Taylor Brown <taylorb@microsoft.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 90cfa01889
Component: cli
2018-01-16 22:51:57 +01:00
c2691aeef9 Set git sha from parameter
Because we merge master into the branch before running tests, so the
actual git sha does not exist on any git remote.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: b2faf24925ea0f820db62e1f3d96ee347972f12a
Component: engine
2018-01-16 16:50:57 -05:00
f088309662 Add code coverage report and codecov config
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: e5cce50c7ea727c1c901b6e1443bd4291d62fce3
Component: engine
2018-01-16 16:50:56 -05:00
a19065e951 Make container resource mounts unbindable
It's a common scenario for admins and/or monitoring applications to
mount in the daemon root dir into a container. When doing so all mounts
get coppied into the container, often with private references.
This can prevent removal of a container due to the various mounts that
must be configured before a container is started (for example, for
shared /dev/shm, or secrets) being leaked into another namespace,
usually with private references.

This is particularly problematic on older kernels (e.g. RHEL < 7.4)
where a mount may be active in another namespace and attempting to
remove a mountpoint which is active in another namespace fails.

This change moves all container resource mounts into a common directory
so that the directory can be made unbindable.
What this does is prevents sub-mounts of this new directory from leaking
into other namespaces when mounted with `rbind`... which is how all
binds are handled for containers.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: eaa5192856c1ad09614318e88030554b96bb6e81
Component: engine
2018-01-16 15:09:05 -05:00
35c47edb0e Merge pull request #808 from ethan-haynes/698-tmpfs-mode-compose
added support for tmpfs-mode in compose file
Upstream-commit: 14c62f655a
Component: cli
2018-01-16 20:59:17 +01:00
1c29e89e9b Return 400 status instead of 500 for empty volume create body
The `POST /volumes/create` expects a request body to be provided.
If no body was provided, a 500 status was returned. A 500 status
is incorrect, because the request is invalid (it's not a server
error).

Before this change:

    $ curl --unix-socket /var/run/docker.sock -v -X POST http://localhost/volumes/create

    *   Trying /var/run/docker.sock...
    * Connected to localhost (/Users/sebastiaan/Library/Containers/com.dock) port 80 (#0)
    > POST /volumes/create HTTP/1.1
    > Host: localhost
    > User-Agent: curl/7.51.0
    > Accept: */*
    >
    < HTTP/1.1 500 Internal Server Error
    < Api-Version: 1.30
    < Content-Length: 18
    < Content-Type: application/json
    < Date: Wed, 19 Jul 2017 11:29:26 GMT
    < Docker-Experimental: true
    < Ostype: linux
    < Server: Docker/17.06.0-ce (linux)
    <
    {"message":"EOF"}
    * Curl_http_done: called premature == 0
    * Connection #0 to host localhost left intact

After this change:

    $ curl --unix-socket /var/run/docker.sock -v -X POST http://localhost/volumes/create

    *   Trying /var/run/docker.sock...
    * Connected to localhost (/var/run/docker.sock) port 80 (#0)
    > POST /volumes/create HTTP/1.1
    > Host: localhost
    > User-Agent: curl/7.52.1
    > Accept: */*
    >
    < HTTP/1.1 400 Bad Request
    < Api-Version: 1.36
    < Content-Type: application/json
    < Docker-Experimental: false
    < Ostype: linux
    < Server: Docker/dev (linux)
    < Date: Tue, 09 Jan 2018 15:00:13 GMT
    < Content-Length: 42
    <
    {"message":"no body provided in request"}
    * Curl_http_done: called premature == 0
    * Connection #0 to host localhost left intact

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 5ad1e4be6bd2fd1033bc2adb5be2fe821787b59c
Component: engine
2018-01-16 20:42:44 +01:00
fd6c5edde8 Merge pull request #755 from kolyshkin/wait
Show container wait error
Upstream-commit: 1620538c49
Component: cli
2018-01-16 14:40:36 -05:00
dec893af4f Add more russian scientists in names-generator.go
Signed-off-by: ASM <cpp.create@gmail.com>
Upstream-commit: e0c3fe7836af1b1648fd61b59bd28691f88cc70b
Component: engine
2018-01-16 21:09:17 +02:00
e9c2f9fe77 Make image (layer) downloads faster by using pigz
The Golang built-in gzip library is serialized, and fairly slow
at decompressing. It also only decompresses on demand, versus
pipelining decompression.

This change switches to using the pigz external command
for gzip decompression, as opposed to using the built-in
golang one. This code is not vendored, but will be used
if it autodetected as part of the OS.

This also switches to using context, versus a manually
managed channel to manage cancellations, and synchronization.
There is a little bit of weirdness around manually having
to cancel in the error cases.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Upstream-commit: fd35494a251a497c359f706f61f33e689e2af678
Component: engine
2018-01-16 10:49:18 -08:00
fcc2e6e315 container.waitExitOrRemoved(): add a test case
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 85ddaee5af
Component: cli
2018-01-16 10:16:28 -08:00
2c0a4f1b1f Merge component 'engine' from git@github.com:moby/moby master 2018-01-16 17:04:06 +00:00
96cd62f939 added support for tmpfs-mode in compose file
Signed-off-by: Ethan Haynes <ethanhaynes@alumni.harvard.edu>
Upstream-commit: cd69d082ea
Component: cli
2018-01-16 10:52:26 -06:00
6480a738eb adding tmpfs field to the compose 3.6v file spec and updating binary
Signed-off-by: Ethan Haynes <ethanhaynes@alumni.harvard.edu>
Upstream-commit: b15362ce32
Component: cli
2018-01-16 10:50:40 -06:00
fe856d6a3e Ensure CPU quota/period updates are sent to runc
Fixes an issue where if cpu quota/period is sent via the update API, the
values are updated in the stored container data but not actually sent to
the running container.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 86ba63db82e87c943c9dee52559118e46f23defc
Component: engine
2018-01-16 11:50:14 -05:00
596eb2d73f adding config_schema_v3.6.json and updating binary
Signed-off-by: Ethan Haynes <ethanhaynes@alumni.harvard.edu>
Upstream-commit: 2b8cc52409
Component: cli
2018-01-16 10:44:08 -06:00
2d002babe5 Merge component 'cli' from git@github.com:docker/cli master 2018-01-16 16:41:10 +00:00
9ec0657065 Merge pull request #810 from akimd/rmi-eol
Remove: add missing eol when --force is passed
Upstream-commit: 3a69e5d265
Component: cli
2018-01-16 10:29:46 +01:00
a9d5589889 Merge pull request #36021 from yongtang/30897-follow-up
Rename FindUniqueNetwork to FindNetwork
Upstream-commit: be146652108f7145e902c275807f9ef71464b031
Component: engine
2018-01-16 09:38:16 +01:00
c4ee004968 Remove: add missing eol when --force is passed
Signed-off-by: Akim Demaille <akim.demaille@docker.com>
Upstream-commit: f83aa7b705
Component: cli
2018-01-16 09:29:53 +01:00
45b9f9df5c Merge pull request #35983 from yongtang/35980-Dockerfile.simple
Add required pkg-config for Dockerfile.simple
Upstream-commit: 3c7990fb63c546e0d0443e4c74a1ee15b16d005c
Component: engine
2018-01-16 02:41:36 +01:00
04ddd90677 Merge pull request #36025 from yongtang/01152018-golint
Fix golint error
Upstream-commit: 410e95d368cc03363472691bb2b228d3bd5c155a
Component: engine
2018-01-16 02:05:42 +01:00
69f6e83862 Fix golint error
PR #36011 fixed almost all of the golint issues though
there is still one golint error:
https://goreportcard.com/report/github.com/docker/docker#golint
```
Golint is a linter for Go source code.
docker/daemon/reload.go
Line 64: warning: redundant if ...; err != nil check, just return error instead. (golint)
```

This fix fixes the last one.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: e02a3d9f5ba3bd9fa7f21596a6ee784bb58053f9
Component: engine
2018-01-15 21:35:30 +00:00
2802ca3c0e Merge pull request #36018 from thaJeztah/remove-deprecated-testenv-functions
Remove deprecated integration-cli/environment functions
Upstream-commit: 8c31aacebff68fe73f4203f86c5681a0fce648f1
Component: engine
2018-01-15 13:24:52 -08:00
d7084e8097 Merge pull request #35638 from cpuguy83/error_helpers2
Add helpers to create errdef errors
Upstream-commit: c36274da8326c59aaa12c48196671b41dcb89e5b
Component: engine
2018-01-15 10:56:46 -08:00
72b954bd11 Rename FindUniqueNetwork to FindNetwork
This fix is a follow up to 30397, with `FindUniqueNetwork`
changed to `FindNetwork` based on the review feedback.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: ccc2ed01894a1950eaf47db2ad0860ad87cd78d1
Component: engine
2018-01-15 17:34:40 +00:00
3c68801e6a Merge component 'engine' from git@github.com:moby/moby master 2018-01-15 17:03:57 +00:00
de86612508 Merge pull request #36011 from thaJeztah/golint-fixes
Golint and Ineffassign  fixes
Upstream-commit: a44274f1c033004f0aaaa225aa98c58c018623f6
Component: engine
2018-01-15 08:59:58 -08:00
d1c8c580ed Remove deprecated environment.DaemonPlatform()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 18a771a761654e241ae8d1e85aa0c0a6164c5d27
Component: engine
2018-01-15 15:32:06 +01:00
28a714b165 Remove deprecated environment.MinimalBaseImage()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: dfedc9ef6214500526c29fbf9a46aca9cecbeb57
Component: engine
2018-01-15 15:31:02 +01:00
d0afa0d404 Remove deprecated environment.ExperimentalDaemon()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: da8032d7d351a2073f54ec0121a796800b6b1a46
Component: engine
2018-01-15 15:30:05 +01:00
de027de052 Remove deprecated environment.DockerBasePath()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 142b1f8bfb3a1459660a5877b48f2bd7d17ba5d6
Component: engine
2018-01-15 15:29:26 +01:00
1240c39efc Golint: don't use basic untyped string for context key
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: dfac74a9e48d1562ec41bc6de194f6593f0e639b
Component: engine
2018-01-15 12:49:14 +01:00
e0f1df2210 Merge pull request #35929 from arm64b/busybox-ls-compatible
Upgrade the frozen images to multi-arch ones
Upstream-commit: 947eb283dc86b67ea487ed3b7c02ede7b1fbbafd
Component: engine
2018-01-15 12:28:13 +01:00
03f0380721 Merge pull request #36009 from ripcurld0/small_nitpick
Small nitpick: create ErrVolumeTargetIsRoot in the volume package
Upstream-commit: fb13aeef0fc9bf8762643a0682df278544e4c933
Component: engine
2018-01-15 12:19:23 +01:00
02da0b9277 Improve API version-middleware test
Some improvements to the test;

- Combine tests to reduce duplicated code
- Add test-cases for empty version in request using the default version
- Add test for valid versions in request actually setting the version

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 63906d8fae8164c8ef00e1edc957a90b22908bcf
Component: engine
2018-01-15 11:50:30 +01:00
621388138c Golint: remove redundant ifs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: b4a63139696aea2c73ec361a9af8b36a118f0423
Component: engine
2018-01-15 00:42:25 +01:00
3b2e22c98e Small nitpick: create ErrVolumeTargetIsRoot in the volume package
Both lcow_parser.go and linux_parser.go are duplicating the error:
"invalid specification: destination can't be '/'"

This commit creates a new error called "ErrVolumeTargetIsRoot"
that is used by both linux_parser and lcow_parser and remove
the duplication in the code.

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: 62143af5437a29d4b95f971d1905cfef763b0847
Component: engine
2018-01-14 11:41:39 +00:00
4ab8a85d30 Merge component 'engine' from git@github.com:moby/moby master 2018-01-13 17:03:55 +00:00
f9646377ed Merge component 'cli' from git@github.com:docker/cli master 2018-01-13 16:41:07 +00:00
6303353f60 Merge pull request #807 from thaJeztah/golint-fixes
golint: remove redundant ifs
Upstream-commit: 1694921047
Component: cli
2018-01-13 14:55:14 +01:00
2c5689d728 ineffassign: fix unused variables
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 63a0e88e8a61b5c0d5f698d5baf37f568ee01d50
Component: engine
2018-01-13 13:35:10 +01:00
4db79d6583 golint: remove redundant ifs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: d845b4d36a
Component: cli
2018-01-13 13:16:34 +01:00
c3d475f697 Merge pull request #36000 from emil2k/fix-container-log-err
Wrap response error for container logs method.
Upstream-commit: 6415f1dcf5c79da853c604733c56b43ae3d18ced
Component: engine
2018-01-13 03:16:38 +01:00
2c7eb8f0d8 Merge pull request #35998 from arm64b/fix-timeout-multi-services
Fix timeout issue of  multi-services creation on AArch64
Upstream-commit: 86cb53e80060f6028e7847daef5b790fa7b9995f
Component: engine
2018-01-13 03:14:31 +01:00
e19dd094e6 Merge pull request #36001 from tophj-ibm/frozen-z-ci
[ci] use alternate sh comparison
Upstream-commit: bc183a0062c1283cfc47f42ec78501868629dd2b
Component: engine
2018-01-13 01:00:21 +01:00
298483e61f Merge component 'engine' from git@github.com:moby/moby master 2018-01-12 17:04:42 +00:00
e1c32a9951 Merge component 'cli' from git@github.com:docker/cli master 2018-01-12 16:41:09 +00:00
837919cf56 [ci] use alternate bash comparison
The pattern `echo str | grep -qE pattern` likes to fail on the z CI here for
an unknown reason. Use `grep -qE pattern <<< str` instead.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: 24da8a0ed415c019179ca2c4f7496cbdffb7e4d0
Component: engine
2018-01-12 11:05:20 -05:00
4f33349d30 Wrap response error for container logs method.
Signed-off-by: Emil Davtyan <emil2k@gmail.com>
Upstream-commit: 2d6fb87ca41c52b255e874be62f2a3c2181a7639
Component: engine
2018-01-12 16:43:51 +01:00
d6831a1fa6 Fix timeout issue of multi-services cration on AArch64
Now we only adjust the timeout value for `arm` while not `arm64`,
actually the avarage duration for this test is about 25s to crate
multiple services on arm64, else the integration test will terminate
with below error:

> --- FAIL: TestCreateServiceMultipleTimes (24.11s)
>         daemon.go:285: [ddc3c7c1476c2] waiting for daemon to start
>         daemon.go:317: [ddc3c7c1476c2] daemon started
>         poll.go:121: timeout hit after 10s: task count at 4 waiting for 0
>         daemon.go:275: [ddc3c7c1476c2] exiting daemon
>         clean.go:108: Removing image sha256:e6a8d12d58602a19277ee5632b7ff9fa56a4ea52ba00eedf1d3f6f5a495fe761
>         clean.go:108: Removing image sha256:876244cc2ecb8fe1b0b2e817e3b78709a2a735edb093bc6849f99aa6c18f3a01

This PR adjusts the timeout value for both `arm64` and `arm` to mitigate
this issue on those 2 platforms.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Upstream-commit: 4542016cbe985d2af60c25f6a5b24df50bb50aba
Component: engine
2018-01-12 11:52:35 +00:00
2539b89332 Merge pull request #803 from thaJeztah/remove-orchestrator-aliases
Remove aliases for orchestrator
Upstream-commit: b7b3e9a261
Component: cli
2018-01-12 08:59:52 +01:00
d4d0b5c268 Move api/errdefs to errdefs
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: d453fe35b9b8b52d0677fe0c3cc8373f2f5d30d0
Component: engine
2018-01-11 21:21:43 -05:00
952c29f8da Add helpers to create errdef errors
Instead of having to create a bunch of custom error types that are doing
nothing but wrapping another error in sub-packages, use a common helper
to create errors of the requested type.

e.g. instead of re-implementing this over and over:

```go
type notFoundError struct {
  cause error
}

func(e notFoundError) Error() string {
  return e.cause.Error()
}

func(e notFoundError) NotFound() {}

func(e notFoundError) Cause() error {
  return e.cause
}
```

Packages can instead just do:

```
  errdefs.NotFound(err)
```

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 87a12421a94faac294079bebc97c8abb4180dde5
Component: engine
2018-01-11 21:21:43 -05:00
a3765ce30c Optimizations for recurrsive unmount
When a recursive unmount fails, don't bother parsing the mount table to check
if what we expected to be a mountpoint is still mounted. `EINVAL` is
returned when you try to unmount something that is not a mountpoint, the
other cases of `EINVAL` would not apply here unless everything is just
wrong. Parsing the mount table over and over is relatively expensive,
especially in the code path that it's in.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: dd2108766017c13a19bdbfd1a56cd1358580e0bb
Component: engine
2018-01-11 16:13:16 -05:00
5127f79a88 Remove aliases for orchestrator
Prefer "strict" values for orchestrator, as it's
easier to add aliases (if we think it's needed) than
to remove them later.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: a812995f98
Component: cli
2018-01-11 21:16:37 +01:00
15165b99b6 Add required pkg-config for Dockerfile.simple
This fix tries to address the issue raised in 35980 where
pkg-config was missing and was causing Dockerfile.simple build
to fail.

```
$ docker build -t docker:simple -f Dockerfile.simple .
..........
CGO_ENABLED=1 go build  -tags "seccomp apparmor selinux netgo cgo static_build" -installsuffix netgo -ldflags "-w -extldflags -static -X main.gitCommit="b2567b37d7b75eb4cf325b77297b140ea686ce8f" -X main.version=1.0.0-rc4+dev " -o runc .
pkg-config: exec: "pkg-config": executable file not found in $PATH
make: *** [static] Error 2
Makefile:42: recipe for target 'static' failed
The command '/bin/sh -c /tmp/install-binaries.sh runc containerd tini proxy dockercli' returned a non-zero code: 2
```

This fix fixes 35980.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: a018046ad0462c78601863784d3b882e77a7281b
Component: engine
2018-01-11 20:12:16 +00:00
4bf05acc16 Merge pull request #35982 from cpuguy83/fix_concurrent_daemon_test_issues
Fix race with concurrent daemon startup in tests
Upstream-commit: 92309e34e42aec3a0e041403bdd3c4fc0dc20269
Component: engine
2018-01-11 14:26:35 -05:00
cfd3975d5f Merge pull request #802 from thaJeztah/fix-yaml-generation
Fix docs YAML generation setting "kubernetes" for "swarm"
Upstream-commit: 41368a84bb
Component: cli
2018-01-11 19:56:36 +01:00
3e7d4bee2e Fix docs YAML generation setting "kubernetes" for "swarm"
Due to a copy/paste error, commands annotated with "swarm"
were incorrectly setting the "kubernetes" property.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 6be06a3db2
Component: cli
2018-01-11 18:30:50 +01:00
59912e9e1d Merge component 'engine' from git@github.com:moby/moby master 2018-01-11 17:06:24 +00:00
8bf6743e94 Fix race with concurrent daemon startup in tests
Using parallel tests is nice, however it can cause an issue with
multiple daemons trying to make changes to iptables at the same time
which causes flakey tests.

This just disables iptables for the set of tests since it is not
required.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 9e3193810da91d81f6b2dba3171443557f756794
Component: engine
2018-01-11 11:47:21 -05:00
10c2915921 Wrap response errors for container copy methods.
This allows IsErrNotFound and IsErrNotImplemented to work as intended.

Signed-off-by: Emil Davtyan <emil2k@gmail.com>
Upstream-commit: 44369bdd6507006108f39b85b5950f933bf1380a
Component: engine
2018-01-11 13:40:49 +01:00
a64e387daf Merge pull request #35976 from thaJeztah/bump-libnetwork2
Bump libnetwork to a1dfea384b39779552a3b4837ea9303194950976
Upstream-commit: cc79c6c7dab994c72133c782a24c69b5ad0f8993
Component: engine
2018-01-10 22:56:00 -08:00
54836718fd busybox: use '-v' option for 'cat'
Use `cat -v` command instead of `catv` for the latest version of
busybox(V1.28.0) with multi-arch

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Upstream-commit: ec6659a1216fbfe3fead759b0220501847d12e28
Component: engine
2018-01-11 06:35:17 +00:00
9251d7a17a busybox: Fix ls compatible issue
BusyBox v1.26.2 (2017-03-09 00:04:38 UTC) supports `-le` option
to get the full date and time information, while BusyBox v1.27.2
(2017-11-01 23:22:25 UTC, which is used by the official multi-arch
image, uses `--full-time` instead of `-e` to get the same data. As
a result, we will get below error for the `DockerSuite.TestBuildLastModified`
test case in case of multi-arch image used:

> docker_cli_build_test.go:446:
>     out2 = cli.DockerCmd(c, "run", name, "ls", "-le", "/file").Combined()
>   o/src/github.com/docker/docker/vendor/github.com/gotestyourself/gotestyourself/icmd/command.go:61:
>     t.Fatalf("at %s:%d - %s\n", filepath.Base(file), line, err.Error())
> ... Error: at cli.go:33 -
> Command:  /usr/local/bin/docker run testbuildlastmodified ls -le /file
> ExitCode: 1
> Error:    exit status 1
> Stdout:
> Stderr:   ls: invalid option -- e
> BusyBox v1.27.2 (2017-11-01 23:22:25 UTC) multi-call binary.

This PR tries to fix the above compatible issue for busybox image.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Upstream-commit: f88c2c04ef4dbae20eaddeaf69e605878f498041
Component: engine
2018-01-11 06:34:54 +00:00
5c2e02eb8f Removal of TEST_IMAGE_NAMESPACE
We don't need the test image namespace anymore since we've already
upgrade those images to the latest multi-arch ones.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Upstream-commit: 662bdb4a5638e56d78e66bb2cb5d7a4a751135c9
Component: engine
2018-01-11 05:16:09 +00:00
c6bfcea4c8 Upgrade the frozen images to multi-arch
Upgrade the frozen images to the multi-arch ones.

Since issue #35963 is not fixed yet on linux/amd64, so we keep the busybox
image on amd64 untouched.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Upstream-commit: eaae7750efbc80314c5e028c4d43d3cd9e104edd
Component: engine
2018-01-11 05:14:09 +00:00
932ef79d5b Add test case for before and since filter for docker ps
This fix adds an integration test for `before` and `since` filter for `docker ps`

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 52b44b98161872f704f7e3eea16e0f3177ca4e42
Component: engine
2018-01-10 17:42:43 +00:00
f408947b41 Bump libnetwork to a1dfea384b39779552a3b4837ea9303194950976
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 4c3afb53e633a832871cada30890e3497fceff02
Component: engine
2018-01-10 18:09:05 +01:00
eae3cf0a12 Merge component 'engine' from git@github.com:moby/moby master 2018-01-10 17:07:15 +00:00
a9d3d30077 Merge component 'cli' from git@github.com:docker/cli master 2018-01-10 16:41:31 +00:00
1682b7c735 Merge pull request #35902 from dnephin/cleanup-graphdriver-quota-tests
Skip graphdriver/quota TestBlockDev if dependencies are not available
Upstream-commit: 88b94d7849c2ec3ab61b179c8bfdeb28507cf451
Component: engine
2018-01-10 05:32:16 -08:00
dc5184e050 Merge pull request #30897 from yongtang/30242-network-duplicate-names
Update `FindNetwork` to address network name duplications
Upstream-commit: 484612f388cabf4b6f4df915f2bf268a8ffdd9fc
Component: engine
2018-01-10 05:30:58 -08:00
b1b02a3b31 Merge pull request #35968 from Microsoft/jjh/go-winio-0.4.6
Revendor Microsoft/go-winio @ v0.4.6
Upstream-commit: 062b4c8013a50afd4c96f4964f0d759c00f000ea
Component: engine
2018-01-10 05:23:50 -08:00
bf3f938c50 Merge pull request #35940 from yongtang/35920-filter-health-starting
Fix issue of filter in `docker ps` where `health=starting` returns nothing
Upstream-commit: 7c7a7c7944a28e16aed4d2a0f2d590541f1c5687
Component: engine
2018-01-10 14:12:47 +01:00
77c9b11634 Merge pull request #35970 from RenaudWasTaken/cli-fix
Fix node-generic-resources CLI typo
Upstream-commit: 178d0278296c9a0778755f0804ced34756ee4fc7
Component: engine
2018-01-10 12:49:00 +01:00
6252dbd48d Merge pull request #35969 from Microsoft/jjh/typo-would
Fix typo 'woudld' to 'would'
Upstream-commit: 7f81894df299fbedee2fe891276ba60ccca897a4
Component: engine
2018-01-09 22:40:30 -05:00
c31e485134 Fix node-generic-resources CLI typo
Signed-off-by: Renaud Gaubert <rgaubert@nvidia.com>
Upstream-commit: 6702ac590e6148cb3f606388dde93a011cb14931
Component: engine
2018-01-10 00:51:47 +01:00
6b1b00bfce Fix typo 'woudld' to 'would'
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: d92acd59108565ac2e552e9f04e873decd192e6d
Component: engine
2018-01-09 14:25:33 -08:00
6611bbb002 Revendor Microsoft/go-winio @ v0.4.6
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 2956ef1db218f228e6bba5ca8c875aa692092b3d
Component: engine
2018-01-09 13:41:16 -08:00
2f79038e74 Merge pull request #35748 from dnephin/try-new-containerd-cio
Update vendor of containerd, use new containerd/cio
Upstream-commit: 274538c70bfb537430b8543646bc9de36c4d879c
Component: engine
2018-01-09 15:56:05 -05:00
6094444b27 Merge pull request #793 from thaJeztah/bump-version-to-v18.02-dev
Bump version to v18.02.0-dev
Upstream-commit: 4c7749e523
Component: cli
2018-01-09 20:44:53 +01:00
6979911095 Fix --network-add adding duplicate networks
When adding a network using `docker service update --network-add`,
the new network was added by _name_.

Existing entries in a service spec are listed by network ID, which
resulted in the CLI not detecting duplicate entries for the same
network.

This patch changes the behavior to always use the network-ID,
so that duplicate entries are correctly caught.

Before this change;

    $ docker network create -d overlay foo
    $ docker service create --name=test --network=foo nginx:alpine
    $ docker service update --network-add foo test
    $ docker service inspect --format '{{ json .Spec.TaskTemplate.Networks}}' test
    [
      {
        "Target": "9ot0ieagg5xv1gxd85m7y33eq"
      },
      {
        "Target": "9ot0ieagg5xv1gxd85m7y33eq"
      }
    ]

After this change:

    $ docker network create -d overlay foo
    $ docker service create --name=test --network=foo nginx:alpine
    $ docker service update --network-add foo test
    service is already attached to network foo

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: e6ebaf55dd
Component: cli
2018-01-09 20:42:09 +01:00
940cce76d9 Merge component 'engine' from git@github.com:moby/moby master 2018-01-09 17:07:27 +00:00
6f88b66c36 Fix libcontainerd/client.Restore() handling of io cleanup
Make the behvious of cleaning up DirectIO more obvious

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 9d20d5eb3fd744088e700292b15d56de29a3361d
Component: engine
2018-01-09 12:03:02 -05:00
cf94b87820 Use cio.FIFOSet.Close() to cleanup fifos
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: d72dfbfa8db9a99be34c2d7963717a08ab7358c5
Component: engine
2018-01-09 12:00:28 -05:00
097704d16a Remove libcontainerd.IOPipe
replaced with cio.DirectIO

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 3fec7c0858a0a3dee5423e6bffc3a3a1b238c30f
Component: engine
2018-01-09 12:00:28 -05:00
9cffb84b7c Update vendor
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 4f5c47aae4105840a16047b7bca424319a7db709
Component: engine
2018-01-09 12:00:27 -05:00
2e2fe70626 Bump version to v18.02.0-dev
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 1350a08b4f
Component: cli
2018-01-09 10:30:59 +01:00
bcd054dac5 Merge pull request #35957 from crosbymichael/ramdisk
Honor DOCKER_RAMDISK with containerd 1.0
Upstream-commit: 94b8a116fbf1cd90e68d8f5361b520d326a66f9b
Component: engine
2018-01-08 17:38:17 -08:00
207f11f4b6 Merge pull request #35959 from dnephin/remove-str-error-checking
Use errdefs instead of string contains for checking not found
Upstream-commit: 7f6fdce901d51e2692f7d5229d7ba8b4bad6c6a9
Component: engine
2018-01-08 20:33:51 -05:00
ec52ac3e88 Merge pull request #35958 from yongtang/35956-doc-CopyFromContainer
Update doc for CopyFromContainer
Upstream-commit: b4c7017f8d95ab42b1f9aa40260966df2c121cd5
Component: engine
2018-01-08 15:22:40 -08:00
790deda568 Merge pull request #386 from seemethere/bump_ver_18_02_dev
[master] bump VERSION to 18.02.0-ce-dev
2018-01-08 14:15:00 -08:00
adaa8a0f77 bump VERSION to 18.02.0-ce-dev
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2018-01-08 21:32:48 +00:00
88fc146546 Use errdefs instead of string contains for checking not found
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 9b62d4ffa39f7c042f94f9a3670cae2a816535da
Component: engine
2018-01-08 14:32:39 -05:00
58f87a5e9a Cleanup graphdriver/quota test
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: e3a6323419c8b2a81a21134ed49a1624eb483c81
Component: engine
2018-01-08 13:41:45 -05:00
844b65b181 Update doc for CopyFromContainer
This fix updates doc for CopyFromContainer to explicitly
mention that the content received from the reader is
a TAR archive.

This fix closes 35965.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: e330e7a5ce77736c76c36ba77983accfae01c405
Component: engine
2018-01-08 18:29:59 +00:00
7a08117e1e manifest tests
create, annotate, & push

Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: db6d87216d
Component: cli
2018-01-08 11:12:57 -06:00
785a293997 Merge component 'engine' from git@github.com:moby/moby master 2018-01-08 17:06:08 +00:00
1f027b4d1b Honor DOCKER_RAMDISK with containerd 1.0
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 54051e9e64185e442e034c7e49a5707459a9eed2
Component: engine
2018-01-08 12:01:03 -05:00
d25231dbba add manifest command
Enable inspection (aka "shallow pull") of images' manifest info, and
also the creation of manifest lists (aka "fat manifests").

The workflow for creating a manifest list will be:

`docker manifest create new-list-ref-name image-ref [image-ref...]`
`docker manifest annotate new-list-ref-name image-ref --os linux --arch
arm`
`docker manifest push new-list-ref-name`

The annotate step is optional. Most architectures are fine by default.

There is also a `manifest inspect` command to allow for a "shallow pull"
of an image's manifest: `docker manifest inspect
manifest-or-manifest_list`.

To be more in line with the existing external manifest tool, there is
also a `-v` option for inspect that will show information depending on
what the reference maps to (list or single manifest).

Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 02719bdbb5
Component: cli
2018-01-08 10:43:56 -06:00
4cf72cbba1 Merge component 'cli' from git@github.com:docker/cli master 2018-01-08 16:41:25 +00:00
f81efe6736 vendor updates for manifest cmd
Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
Upstream-commit: 17886d7547
Component: cli
2018-01-08 10:40:55 -06:00
476b1d747b Merge pull request #792 from thaJeztah/fix-builder-typo
Fix repeated "for" in docs/reference/builder.md
Upstream-commit: 16cccc30f9
Component: cli
2018-01-08 14:34:14 +01:00
143be37b02 Fix repeated "for" in docs/reference/builder.md
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 7e465d1b09
Component: cli
2018-01-08 12:33:06 +01:00
5017f2840c Merge pull request #35593 from ndeloof/master
Improve swagger schema for code generation
Upstream-commit: 16a1736b9b93e44c898f95d670bbaf20a558103d
Component: engine
2018-01-08 12:17:56 +01:00
27f91f80b9 introduce « exec_die » event
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Upstream-commit: aa6bb5cb698ebcf6662e6667bc58055b5b5bde23
Component: engine
2018-01-08 11:42:25 +01:00
5857ab9402 Merge pull request #35798 from ndeloof/ProgressDetail
Progress detail
Upstream-commit: 847df43d1df0ef7343d4f623138dcbb4307d6083
Component: engine
2018-01-08 11:28:49 +01:00
f75b092795 Add test case for docker ps -f health=starting
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: f509a54bdd29b8f65c17097fde3664c6fad36c21
Component: engine
2018-01-07 05:10:36 +00:00
7ee813acf5 Update and use FindNetwork on Windows.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: b249ccb1151a3c2c7e442b6c1a769821afb28fe4
Component: engine
2018-01-07 03:32:37 +00:00
414f8b2aa4 Merge component 'engine' from git@github.com:moby/moby master 2018-01-06 17:06:58 +00:00
ecf8d36483 Merge component 'cli' from git@github.com:docker/cli master 2018-01-06 16:41:31 +00:00
65164d88f6 Fix Volumes property definition in ContainerConfig
Actually the specification was expecting a 'additionalProperties' for the Volumes data, where in fact it's expecting
a map of string pointing to empty object.

Signed-off-by: Joel Wurtz <joel.wurtz@gmail.com>
Upstream-commit: dc883c0486b398eb5ad99f35aef3ff02a5a7dd29
Component: engine
2018-01-06 16:12:05 +01:00
5fe06b3e89 Merge pull request #35033 from chchliang/viservice
Add `namespace method` conver in `TestV1IDService` 
Upstream-commit: c6378920e14638cc281c5513a989fdff82562426
Component: engine
2018-01-06 14:37:48 +01:00
6169dab4e0 Merge pull request #789 from mistyhacks/load-supports-gzip
docker load supports tar and tar.gz files
Upstream-commit: 6764ce922a
Component: cli
2018-01-06 13:23:34 +01:00
d0f281be92 docker load supports tar and tar.gz files
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: ac7a5650f0
Component: cli
2018-01-05 20:33:31 -08:00
df9a679f90 Update FindUniqueNetwork to address network name duplications
This fix is part of the effort to address 30242 where
issue arise because of the fact that multiple networks
may share the same name (within or across local/swarm scopes).

The focus of this fix is to allow creation of service
when a network in local scope has the same name as the
service network.

An integration test has been added.

This fix fixes 30242.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: cafed80cd019a8b40025eaa5e5b37459362607fb
Component: engine
2018-01-06 01:55:28 +00:00
836e5c6bd0 Fix before and since filter for docker ps
This fix tries to address the issue raised in 35931 where
`before` and `since` filter for `docker ps` does not work
and returns an error
```
Error response from daemon: no such container <container_name>
```

The issue was that `before` and `since` filter are matched
with `view.Get()` which does not take into considerations
of name match.

This fix fixes the issue by adding additional logic for name
match.

This fix fixes 35931.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 9833332dba5cba3709c5d78c28d3dbc52e49bfa9
Component: engine
2018-01-06 00:51:08 +00:00
e6a8744081 Merge pull request #785 from friism/make-config-wording-more-consistent
use 'config' over 'configuration file'
Upstream-commit: a60bdf3bc8
Component: cli
2018-01-05 22:26:48 +01:00
1bed718e52 use 'config' over 'configuration file'
Signed-off-by: Michael Friis <friism@gmail.com>
Upstream-commit: 99e3b4cd93
Component: cli
2018-01-05 13:19:53 -08:00
0e6233fd86 Merge pull request #681 from mistyhacks/expose-no-protocol
Document EXPOSE UDP syntax
Upstream-commit: 6f09f48bf1
Component: cli
2018-01-05 21:39:21 +01:00
9c4ef1072a Merge pull request #35509 from cpuguy83/splunk_dont_readall
Splunk: limit the reader size on error responses
Upstream-commit: 39faf2a3a83c4abad8ed8030a9b942bbb2978359
Component: engine
2018-01-05 12:34:35 -08:00
233f49e086 Merge pull request #35570 from zemanlx/feature/journald-with-SYSLOG_IDENTIFIER
Add journald tag as SYSLOG_IDENTIFIER
Upstream-commit: d80c13a54114de602c8b75030e3ec9c2cde9575b
Component: engine
2018-01-05 20:56:55 +01:00
656c1163c8 add namespace method conver
Signed-off-by: chchliang <chen.chuanliang@zte.com.cn>
Upstream-commit: 0446b6a04edaae1bddeb1dfdb82fd0d931fe1198
Component: engine
2018-01-05 16:24:18 +08:00
3887b15050 Merge pull request #35925 from Microsoft/jjh/builder-default-rw-size-bump
Windows: Bump RW layer size
Upstream-commit: fff423289965260c0ca83024059aa30999792c4a
Component: engine
2018-01-04 22:54:38 -08:00
62d7ad0948 Fix issue of filter in docker ps where health=starting returns nothing
This fix tries to address the issue raised in 35920 where the filter
of `docker ps` with  `health=starting` always returns nothing.

The issue was that in container view, the human readable string (`HealthString()` => `Health.String()`)
of health status was used. In case of starting it is `"health: starting"`.
However, the filter still uses `starting` so no match returned.

This fix fixes the issue by using `container.Health.Status()` instead so that it matches
the string (`starting`) passed by filter.

This fix fixes 35920.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 97b16aecf9275f4103c2737b79d0c5e81583aa58
Component: engine
2018-01-05 05:16:09 +00:00
e76ddf0d7b Merge pull request #35737 from tonistiigi/fix-git-submodules
gitutils: fix checking out submodules
Upstream-commit: 50ce54645094a5d337e5d841c037663e9f4e3170
Component: engine
2018-01-05 10:41:04 +08:00
ad4db68af2 Merge pull request #35753 from kolyshkin/netgo
install-containerd-static: use netgo buildtag
Upstream-commit: 51ccedda52413eef2cd4ba8e3948c84501210f3d
Component: engine
2018-01-05 09:05:46 +08:00
40052b6ec6 Document EXPOSE UDP syntax
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: db572ec4ab
Component: cli
2018-01-04 16:16:06 -08:00
d9cc44462d Remove Ubuntu Zesty
Ubuntu Zesty is end of life on January 2018

https://wiki.ubuntu.com/Releases

Signed-off-by: Eli Uriegas <seemethere101@gmail.com>
Upstream-commit: 41086726310e3f78043a4bcf0bcecd5a16d8a144
Component: packaging
2018-01-05 00:02:41 +00:00
0c06f43df3 Merge component 'engine' from git@github.com:moby/moby master 2018-01-04 17:06:40 +00:00
1fbbb4c59b Merge pull request #35924 from Microsoft/32838-partial-fix
Vendor Microsoft/hcsshim @ v0.6.8
Upstream-commit: 4459775eeaa0a3239866fe091014eb1e707bdc2c
Component: engine
2018-01-04 17:49:17 +01:00
c30ceea721 Merge component 'cli' from git@github.com:docker/cli master 2018-01-04 16:41:22 +00:00
8322194c96 Merge pull request #781 from thaJeztah/fix-autogenerated-formatting
Fix gofmt for auto-generated k8s code
Upstream-commit: 220c50abc1
Component: cli
2018-01-04 11:23:32 -05:00
c08c5639be Merge pull request #784 from kizzie/fix/html-for-table
Correct table html with close tag for </thead>
Upstream-commit: 2a4c1ef0c1
Component: cli
2018-01-04 17:12:47 +01:00
Kat
e4754a59e3 Correct table html with close tag for </thead>
Signed-off-by: Kat Samperi <kat.samperi@gmail.com>
Upstream-commit: 57372d18ca
Component: cli
2018-01-04 15:01:28 +00:00
fb52c2003b Windows: Bump RW layer size
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: deb335d04fd47e96fdb7b342dece513174b574bd
Component: engine
2018-01-03 15:59:06 -08:00
39c64668e4 Fix gofmt for auto-generated k8s code
This code kept being modified by my IDE, so fixing
the formatting.

This is auto-generated code, but the code to generate
is not in this repository, so this is a temporary fix
until the code-generation upstream is fixed :)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: bb01064691
Component: cli
2018-01-03 23:57:23 +01:00
fa87c342b2 Vendor Microsoft/hcsshim @ v0.6.8
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 172a442c27ed35778662980809824fdf15a722a6
Component: engine
2018-01-03 10:19:05 -08:00
6f3ae5f1f6 Merge pull request #35772 from arm64b/multi-arch-manifest-support
Download support of images with multi-arch manifest
Upstream-commit: fda904911d87a2b36e6fdcc048726bb6b593d944
Component: engine
2018-01-03 19:03:33 +01:00
da47568e0d Merge component 'engine' from git@github.com:moby/moby master 2018-01-03 17:04:20 +00:00
e2368ae63b Merge component 'cli' from git@github.com:docker/cli master 2018-01-03 16:41:08 +00:00
707c5a8bd6 Merge pull request #35694 from boucher/checkpoint-dir-fix
Don't append the container id to custom directory checkpoints.
Upstream-commit: f72b180ae1f638b878edfbae1b7030f454bb5624
Component: engine
2018-01-03 11:22:21 -05:00
9f589817fd Merge pull request #721 from silvin-lubecki/kube
Add kubernetes support to docker/cli
Upstream-commit: e708c900f8
Component: cli
2018-01-03 17:20:43 +01:00
169f9cc018 Add test case for 35333: Devicemapper: ignore Nodata errors when delete thin device
This fix adds a test case for 35333: Devicemapper: ignore Nodata errors when delete thin device

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 7c6ef28042c20fdad23cd461ab49b9cfa0c757df
Component: engine
2018-01-03 15:06:52 +00:00
17341a3ddc Check and return error while creating kubernetes secret and config maps.
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Upstream-commit: 18c44e0829
Component: cli
2018-01-03 15:46:19 +01:00
01e7ddaec8 Merge pull request #35822 from keyolk/35709-fix-docker-build-overlayfs-whiteout
skip container ID remapping, if the file is overlayfs whiteout.
Upstream-commit: 99c22b0034605d283d9ddcfc72b1f450d130c976
Component: engine
2018-01-03 22:21:00 +08:00
3e3e540e8d Fix PR comments
- More strict on orchestrator flag
- Make orchestrator flag more explicit as experimental
- Add experimentalCLI annotation on kubernetes flags
- Better kubeconfig error message
- Prefix service name with stackname in ps and services stack subcommands
- Fix yaml documentation
- Fix code coverage ignoring generated code

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Upstream-commit: f1b116179f
Component: cli
2018-01-03 10:23:32 +01:00
2bb414da6f skip container ID remapping, if the file is overlayfs whiteout.
Signed-off-by: Chanhun Jeong <chanhun.jeong@navercorp.com>
Upstream-commit: b013c1541d3b58f736bc79269aa88d3bfacda6ea
Component: engine
2018-01-03 17:06:59 +09:00
9c63a8a5b6 Merge pull request #774 from apkd/master
Fix description of filter flag in prune commands
Upstream-commit: 1a64b1b799
Component: cli
2018-01-02 20:02:20 +01:00
257633843b Fix description of filter flag in prune commands
The "-f" flag is an alias for --force, not --filter (as correctly stated at the top of each documents). The system_prune.md didn't have this error.

Signed-off-by: Mateusz Major <apkd@users.noreply.github.com>
Upstream-commit: 8b07518458
Component: cli
2018-01-02 19:40:23 +01:00
c2b1f7ca70 Devicemapper: ignore Nodata errors when delete thin device
if thin device is deteled and the metadata exists, you can not
delete related containers. This patch ignore Nodata errors for
thin device deletion

Signed-off-by: Liu Hua <sdu.liu@huawei.com>
Upstream-commit: 8451d03d8ef7457f82112179cd3e300c05a08d3d
Component: engine
2018-01-02 18:04:25 +00:00
bcb9583e82 Merge pull request #773 from thaJeztah/add-authors
Add AUTHORS file and script
Upstream-commit: ae4af7ec32
Component: cli
2018-01-02 18:07:06 +01:00
ce67d6e9b7 Merge component 'engine' from git@github.com:moby/moby master 2018-01-02 17:03:59 +00:00
4360eb4024 Merge component 'cli' from git@github.com:docker/cli master 2018-01-02 16:41:04 +00:00
f8a7c9aa17 Add AUTHORS file and script
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 02e7b18fde
Component: cli
2018-01-02 17:00:22 +01:00
7cbef79c0e Merge pull request #772 from muicoder/patch-1
Fix bash completion for "docker swarm"
Upstream-commit: b0efaaeb8b
Component: cli
2018-01-02 15:14:58 +01:00
49ff2398e6 Merge pull request #35840 from kolyshkin/misc-test
Misc test improvements
Upstream-commit: c345c53859a7197deb4722ad4ca5c4a45fab7074
Component: engine
2018-01-02 09:14:20 -05:00
5965f4a425 Merge pull request #768 from thaJeztah/warn-unsupported-pid
Add "pid" to unsupported options list
Upstream-commit: 4a66821309
Component: cli
2018-01-02 15:14:08 +01:00
3b99478053 Merge pull request #35895 from javabrett/docs-contributing-moby-docker-paths
Fixed in-container paths in dev doc: moby/moby -> docker/docker.
Upstream-commit: 30c9cb1ead17e861ad666a25116da64e89dc8594
Component: engine
2018-01-02 13:30:19 +01:00
42bcb27498 Merge pull request #35893 from thaJeztah/cleanup-mailmap
Cleanup mailmap, and update authors
Upstream-commit: ff61d127fe8f39ed1bd888e4dbd3d8c14efc1a03
Component: engine
2018-01-02 12:50:43 +01:00
8e9edf70c7 Cleanup and sort .mailmap
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 63c86ad2eade7d0d5128100a6eb1d5cac245adbc
Component: engine
2018-01-02 12:48:14 +01:00
5b7cd70f03 Update mailmap and authors
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 2df19b7c11349b961455b1c75b655a5f017dd7a4
Component: engine
2018-01-02 12:47:47 +01:00
6635d18f37 Merge pull request #35896 from thaJeztah/fix-namespace-filtering
Fix event filter filtering on "or"
Upstream-commit: 431d3d6756f69a84d23ef45186082be1ed93c151
Component: engine
2018-01-02 12:04:32 +08:00
fa250e5c10 Merge pull request #35833 from thaJeztah/fix-mount-creation-on-start
Re-validate Mounts on container start
Upstream-commit: 9d9992b314933b9d93d3ac117b3f8146b9295277
Component: engine
2018-01-02 12:01:58 +08:00
ae19592ca8 Fix bash completion for "docker swarm"
Signed-off-by: muicoder <muicoder@gmail.com>
Upstream-commit: e2f73bb4b7
Component: cli
2018-01-01 12:58:16 +08:00
6aa9598694 Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2017-12-29 17:17:28 +00:00
25c9e80a84 Merge component 'engine' from git@github.com:moby/moby master 2017-12-29 17:17:22 +00:00
414d05d8c4 Merge pull request #35899 from javabrett/fix-deprecated-typo
Fixed typo DEREPCATED -> DEPRECATED.
Upstream-commit: bb9c273648584993ab5fb326634fd6c5f35e739b
Component: engine
2017-12-29 15:34:11 +01:00
cfc9623c01 Fixed typo DEREPCATED -> DEPRECATED.
Signed-off-by: Brett Randall <javabrett@gmail.com>
Upstream-commit: 3b80d5789959b790e8f45c984414cc4d2552417b
Component: engine
2017-12-29 06:39:09 -05:00
4b57d7f1d3 Fix event filter filtering on "or"
The event filter used two separate filter-conditions for
"namespace" and "topic". As a result, both events matching
"topic" and events matching "namespace" were subscribed to,
causing events to be handled both by the "plugin" client, and
"container" client.

This patch rewrites the filter to match only if both namespace
and topic match.

Thanks to Stephen Day for providing the correct filter :)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 295bb09184fe473933498bb0efb59b8acb124f55
Component: engine
2017-12-29 02:47:56 +01:00
31e8b1c077 Fixed in-container paths in dev doc: moby/moby -> docker/docker.
Further to 355cf9483c1b8ede5ae3ed50add4de2a69d62645 which caught some
of these.  This should fix the remainder in the contributing docs.

Signed-off-by: Brett Randall <javabrett@gmail.com>
Upstream-commit: e96b33665e58f73a16923b89a9bcc6fe6fcdb6c6
Component: engine
2017-12-28 20:22:02 -05:00
f1638ade2e Merge pull request #35674 from kolyshkin/zfs-rmdir
zfs: fix ebusy on umount etc
Upstream-commit: daded8da9178ec097e59a6b0b2bf12754b5472d8
Component: engine
2017-12-28 15:35:19 -08:00
8befd2d809 TestImportExtremelyLargeImageWorks: optimize DevZero
According to https://github.com/golang/go/issues/5373, go recognizes
(and optimizes for) the following syntax:

```go
for i := range b {
	b[i] = 0
}
```

so let's use it. Limited testing shows ~7.5x speed increase,
compared to the previously used syntax.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: f0cab0e28512de5eecc0412212425cc74d62af71
Component: engine
2017-12-28 13:08:41 -08:00
2a34102708 TestBuildNotVerboseFailureRemote: fix false positive
I got the following test failure on power:

10:00:56
10:00:56
----------------------------------------------------------------------
10:00:56 FAIL: docker_cli_build_test.go:3521:
DockerSuite.TestBuildNotVerboseFailureRemote
10:00:56
10:00:56 docker_cli_build_test.go:3536:
10:00:56     c.Fatal(fmt.Errorf("Test[%s] expected that quiet stderr and
verbose stdout are equal; quiet [%v], verbose [%v]", name,
quietResult.Stderr(), result.Combined()))
10:00:56 ... Error: Test[quiet_build_wrong_remote] expected that quiet
stderr and verbose stdout are equal; quiet [
10:00:56 unable to prepare context: unable to download remote context
http://something.invalid: Get http://something.invalid: dial tcp: lookup
something.invalid on 172.29.128.11:53: no such host
10:00:56 ], verbose [unable to prepare context: unable to download
remote context http://something.invalid: Get http://something.invalid:
dial tcp: lookup something.invalid on 8.8.8.8:53: no such host
10:00:56 ]
10:00:56
10:00:56
10:00:56
----------------------------------------------------------------------

The reason is, either more than one name server is configured, or
nameserver was reconfigured in the middle of the test run. In any case,
different nameserver IP in an error messages should not be treated
as a failure, so let's strip those out.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 3676bd8569f4df28a4f850cd4814e3558d8c03f6
Component: engine
2017-12-28 13:08:41 -08:00
dd0cbe7272 integration-cli/TestCleanupMounts: fix/improve
`TestCleanupMountsAfterDaemonAndContainerKill` was supposedly written
when the container mounts were visible from the host. Currently they
all live in their own mount namespace and the only visible mount is
the tmpfs one for shareable /dev/shm inside the container (i.e.
/var/lib/docker/containers/<ID>/shm), which will no longer be there
in case of `--default-ipc-mode private` is used, and so the test will
fail. Add a check if any container mounts are visible from the host,
and skip the test if there are none, as there's nothing to check.

`TestCleanupMountsAfterDaemonCrash`: fix in a similar way, keeping
all the other checks it does, and skipping the "mounts gone" check
if there were no mounts visible from the host.

While at it, also fix the tests to use `d.Kill()` in order to not
leave behind a stale `docker.pid` files.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: f5e01452d2c2a07bab48b4e05306ef9446770c4a
Component: engine
2017-12-28 13:08:41 -08:00
e25f9d0953 integration-cli/TestRunModeIpcContainer: remove
1. The functionality of this test is superceded by
   `TestAPIIpcModeShareableAndContainer` (see
   integration-cli/docker_api_ipcmode_test.go).

2. This test won't work with --default-ipc-mode private.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 519c06607ca7e8a544afddbd61ad57afe63a98b4
Component: engine
2017-12-28 13:08:41 -08:00
9bf811bf85 Merge pull request #74 from seemethere/move_phony
Move .PHONY targets above actual targets
Upstream-commit: 41ae603d88e02e950ba4f3e227f9f6e972a3c74b
Component: packaging
2017-12-28 13:58:47 -06:00
f63a46268d Move .PHONY targets above actual targets
Was getting annoying to have to write it into one spot so moved them to
above the targets that they specify.

Signed-off-by: Eli Uriegas <seemethere101@gmail.com>
Upstream-commit: a8e527df5d6579cc53372c26ef86fdcf449aa9ae
Component: packaging
2017-12-28 17:53:59 +00:00
f46e42c6ec Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2017-12-28 17:05:24 +00:00
0ba6b0ad15 Merge pull request #72 from seemethere/remove_f25
Remove Fedora 25
Upstream-commit: 95eb77209344abe5f29e82ad09ae5ecf7aebe710
Component: packaging
2017-12-28 11:02:42 -06:00
cb8fda044c Activate kubernetes only when experimental cli is enabled
* Refactor tests on version and kubernetes switch
* Fix rebase errors
* Refactor for gocyclo linter

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Upstream-commit: ad409767bf
Component: cli
2017-12-28 14:40:10 +01:00
effda473ed Set a global orchestrator flag
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 5d375b348a
Component: cli
2017-12-28 14:40:10 +01:00
d7b5fca8a7 Update golang.org/x/net to not panic
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 12c0825a4c
Component: cli
2017-12-28 14:40:09 +01:00
d05eafef63 Remove Fedora 25
Fedora 25 was end of life on December 12, 2017

https://fedoramagazine.org/fedora-25-end-life/

Signed-off-by: Eli Uriegas <seemethere101@gmail.com>
Upstream-commit: 920ab84c8c34594be0ebabdac05ebd7710dc6cd0
Component: packaging
2017-12-27 18:12:51 -06:00
486a48d270 Merge component 'engine' from git@github.com:moby/moby master 2017-12-27 17:03:35 +00:00
c52c03e94f Merge component 'cli' from git@github.com:docker/cli master 2017-12-27 16:41:02 +00:00
d1cf6ac921 Add "pid" to unsupported options list
Services do not support custom "pid"-modes (e.g. `--pid=host`), but this
option was ignored silently when deploying a stack.

This patch adds `pid` to the list of unsupported options so that a warning
is printed;

With this patch applied:

    $ docker stack deploy -c docker-compose.yml foobar
    Ignoring unsupported options: pid

    Creating network foobar_default
    Creating service foobar_test

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 70a29b492d
Component: cli
2017-12-27 12:45:42 +01:00
84f5ef8c85 Merge pull request #765 from thaJeztah/remove-incorrect-link
Remove reference to non-existing "stack config" command
Upstream-commit: a5fe375289
Component: cli
2017-12-26 18:16:37 +01:00
40a74c51c6 Remove reference to non-existing "stack config" command
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 424fe2bb2e
Component: cli
2017-12-26 16:47:45 +01:00
dcfd719f61 Error out on orchestrator command that don't support k8s yet
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 1a2244e384
Component: cli
2017-12-26 11:46:59 +01:00
f4626b5de8 Move e2e test on version command to unit tests
* Refactor a little version command

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Upstream-commit: ba5d0d8ff5
Component: cli
2017-12-26 11:46:59 +01:00
1d466a29ee Update vendoring
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 61713c42a4
Component: cli
2017-12-26 11:45:56 +01:00
65271c3145 Fix e2e test (and add a comment that it's not the best fix)
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 3a01d6a40a
Component: cli
2017-12-26 11:45:56 +01:00
b5273bceed Update warning
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: f5073f81d2
Component: cli
2017-12-26 11:45:56 +01:00
507de4363e add kubernetes/ README
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 0b5883f953
Component: cli
2017-12-26 11:45:56 +01:00
1e23b82bb7 Take @nass review into account
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: b5170bde03
Component: cli
2017-12-26 11:45:56 +01:00
baa35d70b2 Refactor stack command
- Define command and subcommands only once
- Use annotations for k8s or swarm specific flags or subcommands

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: dedd0db51a
Component: cli
2017-12-26 11:45:56 +01:00
cbbf94a252 Move cli/command/orchestrator to cli/command
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 0508c09494
Component: cli
2017-12-26 11:25:22 +01:00
1ebc428804 Move /cli/command/stack/kubernetes/api to /kubernetes
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: f960d2d5f3
Component: cli
2017-12-26 11:22:32 +01:00
4dba81f210 Fix some build failures
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 1ff277ad8f
Component: cli
2017-12-26 11:22:32 +01:00
4b3a19ed1e Add support for kubernetes in docker cli
- Add support for kubernetes for docker stack command
- Update to go 1.9
- Add kubernetes to vendors
- Print orchestrator in docker version command

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Upstream-commit: 8417e49792
Component: cli
2017-12-26 11:22:32 +01:00
c88231e80c Merge pull request #35791 from corbin-coleman/libnetwork_vendoring
[AUTOMATED] libnetwork Vendoring
Upstream-commit: 4a804016ab8b9fd55a45cff9687a1de12dee5eb7
Component: engine
2017-12-26 00:17:26 -06:00
0a947da27f Merge pull request #35827 from kolyshkin/vfs-quota
Fix VFS vs quota regression
Upstream-commit: 3e1df952b7d693ac3961f492310852bdf3106240
Component: engine
2017-12-22 12:32:03 -06:00
4cbf52bf35 Merge component 'engine' from git@github.com:moby/moby master 2017-12-22 17:06:13 +00:00
ed8df8d90f Merge component 'cli' from git@github.com:docker/cli master 2017-12-22 16:41:11 +00:00
2ac4f6cd3a Merge pull request #758 from vdemeester/experimental-cli
Add support for experimental Cli configuration
Upstream-commit: 70db7cc0fc
Component: cli
2017-12-22 14:56:40 +01:00
2a46f74679 Add support for experimental Cli configuration
Allow to mark some commands and flags experimental on cli (i.e. not
depending to the state of the daemon). This will allow more flexibility
on experimentation with the cli.

Marking `docker trust` as cli experimental as it is documented so.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 84fe1a1b5b
Component: cli
2017-12-22 14:48:47 +01:00
7c289486a2 Merge pull request #35844 from thaJeztah/remove-test-events-limit
Remove TestEventsLimit(), and minor cleanups
Upstream-commit: c753095bf331b5b8904cd58a2072c93a9b815141
Component: engine
2017-12-22 09:23:19 +01:00
751e6f56a0 Merge pull request #35672 from tonistiigi/onbuild-test
Add testcase for onbuild command in multi stage build
Upstream-commit: b0cffdb10a2fbcec744588caddf3d0ddfc143967
Component: engine
2017-12-22 09:22:51 +01:00
ee811e7a56 Merge pull request #35851 from tonistiigi/test-names
integration-cli: clarify multi-stage tests names
Upstream-commit: 89140ac28cc413d0e961016b78addccdca4d3607
Component: engine
2017-12-22 00:25:17 +01:00
b1a25d1e15 Merge component 'engine' from git@github.com:moby/moby master 2017-12-21 17:03:54 +00:00
3e15d0b417 Merge component 'cli' from git@github.com:docker/cli master 2017-12-21 16:41:00 +00:00
618f1e2388 Merge pull request #761 from sourabhtk37/patch-1
Corrected descriptions for MAC_ADMIN and MAC_OVERRIDE
Upstream-commit: ebb8927a2a
Component: cli
2017-12-21 11:43:21 +01:00
7fa76a7822 Corrected descriptions for MAC_ADMIN and MAC_OVERRIDE
The description for capabilities are mismatched for MAC_ADMIN and MAC_OVERRIDE.

Signed-off-by: T K Sourabh <sourabhtk37@gmail.com>
Upstream-commit: afcc78aae3
Component: cli
2017-12-21 16:06:32 +05:30
87487ae8dd Merge pull request #759 from mistyhacks/link-to-attack-surface
Fix typo in link
Upstream-commit: 2f3b13742f
Component: cli
2017-12-21 08:33:16 +01:00
b8be0fb3b8 Merge pull request #35582 from asottile/use_base_containers_config
Fix environ substitutions in `docker commit --change ...`
Upstream-commit: a5de79b435735f8027ffc98072a33a83fc8dea28
Component: engine
2017-12-20 21:01:53 -08:00
aa8a79c526 Merge pull request #35845 from ndeloof/FIX35843
fix #35843 regression on health check workingdir
Upstream-commit: c36d6f5ab10d0dd4e5216fa3b8e2613de38c3ba2
Component: engine
2017-12-21 10:55:15 +09:00
1f700eda21 Fix typo in link
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: 946cb0d4fd
Component: cli
2017-12-20 15:35:22 -08:00
02056dd212 Merge pull request #35838 from marcusmartins/marcus_swarmkit
Vendor docker/swarmkit to 713d79d
Upstream-commit: 9646d07d753b9d92678c625b6f43ed76a71fe83e
Component: engine
2017-12-20 23:47:10 +01:00
c61589a0f0 Add testcase for onbuild command in multi stage build
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: fe4ed9d78f496df5cac1eb914877f213f3f1c12c
Component: engine
2017-12-20 11:56:41 -08:00
d109b596b8 integration-cli: clarify multi-stage tests names
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: e90b7c06b4b08ca2935359667cfac4f05e33819b
Component: engine
2017-12-20 11:55:27 -08:00
2af5d43021 Fix environ substitutions in docker commit --change ...
The building machinery was being handed an uninitialized container
Config.  This changes it to use the target container's Config.

Resolves #30538

Signed-off-by: Anthony Sottile <asottile@umich.edu>
Upstream-commit: 0785836c4b440a8d4a5dfdb8df82e50f9f4d23a1
Component: engine
2017-12-20 11:03:38 -08:00
e0ed436e6c Add integration test for healthcheck workdir
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 5be2f2be243a52eb1b051c981bac5442b6e85606
Component: engine
2017-12-20 18:48:36 +01:00
e190404195 Merge component 'engine' from git@github.com:moby/moby master 2017-12-20 17:04:25 +00:00
e1e6adb17e Build rpms for aarch64
Upstream-commit: e204caefd93865ae41a863391b394432130e33fa
Component: packaging
2017-12-20 15:24:30 +01:00
2a820c0f5f fix #35843 regression on health check workingdir
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Upstream-commit: 852a943c773382df09cdda4f29f9e93807523178
Component: engine
2017-12-20 14:04:51 +01:00
88269f42ba Update TestLogEvents to not use deprecated Status field
The `Status` field was deprecated in favor of `Action`.

This patch updates the test to use the `Action` field,
but adds a check that both are set to the same value.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: b7d204ef6b1b2d6a3bafb42f844cdc146976e68f
Component: engine
2017-12-20 12:49:51 +01:00
e5199a0f6e Fix GoDoc to match actual events-limit
Commit 59d45c384a2de7bca73296ce1471646db14cb0c8 changed
the `eventsLimit` from 64 to 256, but did not update
the GoDoc accordingly.

This patch updates the GoDoc for `Subscribe` and `SubscribeTopic`
to match the actual limit.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: fb3935022dbc160fc1531fa43f0ca2db69184800
Component: engine
2017-12-20 12:41:51 +01:00
3b758ede4d Remove TestEventsLimit()
This test was added a long time ago, and over the years has proven to be flaky,
and slow. To address those issues, it was modified to;

- cleanup containers afterwards
- take clock-skew into account
- improve performance by parallelizing the container runs
- _reduce_ parallelization to address platform issues on Windows (twice..)
- adjust the test to take new limits into account
- adjust the test to account for more events being generated by containers

The last change to this test (made in ddae20c032058a0fd42c34c2e9750ee8f62) actually
broke the test, as it's now testing that all events sent by containers
(`numContainers*eventPerContainer`) are received, but the number of events that
is generated (17 containers * 7 events = 119) is less than the limit (256 events).

The limit is already covered by the `TestLogEvents` unit-test, that was added in
8d056423f8c433927089bd7eb6bc97abbc1ed502, and tests that the number of events
is limited to `eventsLimit`.

This patch removes the test, because it's not needed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: b7ad3e7ea10e285226a0a5b1665e8205b3264128
Component: engine
2017-12-20 12:40:05 +01:00
847487f5da Merge pull request #35778 from estesp/moby-governance
Add Moby TSC references/governance details
Upstream-commit: 267847712e720d624f78ef5364f474ff6635b725
Component: engine
2017-12-20 10:50:47 +01:00
6b042c3e6d install-containerd-static: use netgo buildtag
When compiling containerd binaries statically, linker rightfully
complains:

 + make BUILDTAGS=static_build 'EXTRA_FLAGS=-buildmode pie' 'EXTRA_LDFLAGS=-extldflags "-fno-PIC -static"'
 🇩 bin/ctr
 # github.com/containerd/containerd/cmd/ctr
 /tmp/go-link-343047789/000000.o: In function `_cgo_b0c710f30cfd_C2func_getaddrinfo':
 /tmp/go-build/net/_obj/cgo-gcc-prolog:46: warning: Using 'getaddrinfo'
 in statically linked applications requires at runtime the shared
 libraries from the glibc version used for linking

The same error appears for ctr, containerd, and containerd-stress
binaries.

The fix is to use Go's own DNS resolver functions, rather than
glibc's getaddrinfo() -- this option is turned on by `netgo` build tag.

See https://golang.org/pkg/net/ (look for "Name Resolution") for more
details.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 7368ef96c89fd4f6879addf5214c4a09889a05be
Component: engine
2017-12-19 18:25:02 -08:00
50de5d926a Merge pull request #35812 from stevvooe/follow-conventions
daemon, plugin: follow containerd namespace conventions
Upstream-commit: 745278d24280614145819838b763c3a2d5349b7e
Component: engine
2017-12-19 15:55:39 -08:00
f0d368cb33 vfs gd: ignore quota setup errors
This is a fix to regression in vfs graph driver introduced by
commit 7a1618ced359a3ac92 ("add quota support to VFS graphdriver").

On some filesystems, vfs fails to init with the following error:

> Error starting daemon: error initializing graphdriver: Failed to mknod
> /go/src/github.com/docker/docker/bundles/test-integration/d6bcf6de610e9/root/vfs/backingFsBlockDev:
> function not implemented

As quota is not essential for vfs, let's ignore (but log as a warning) any error
from quota init.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 1e8a087850aa9f96c5000a3ad90757d2e9c0499f
Component: engine
2017-12-19 13:55:04 -08:00
3f7322c602 Vendor docker/swarmkit to 713d79d
Revendor swarmkit to 713d79dc8799b33465c58ed120b870c52eb5eb4f to include
https://github.com/docker/swarmkit/pull/2473.

Signed-off-by: Marcus Martins <marcus@docker.com>
Upstream-commit: af73d31e60fd5c26d58bb8275785e628c3febdc0
Component: engine
2017-12-19 13:23:21 -08:00
760baaebbb Merge pull request #35805 from cpuguy83/fix_kill_containers_on_restart
Ensure containers are stopped on daemon startup
Upstream-commit: c3a9f5d00f48a1487ab005693e23bbaba04a0523
Component: engine
2017-12-19 12:19:47 -08:00
b225d1b061 Merge pull request #35726 from jahkeup/awslogs-batching
Fix awslogs batch size calculation
Upstream-commit: c8f7f4489ebac5b5dbf2d4e2b4fc1dd3f2d744dc
Component: engine
2017-12-19 20:44:33 +01:00
0acf31e126 Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2017-12-19 17:04:12 +00:00
92961327ba Merge component 'engine' from git@github.com:moby/moby master 2017-12-19 17:04:06 +00:00
f1ba211fd1 Merge component 'cli' from git@github.com:docker/cli master 2017-12-19 16:41:15 +00:00
822fd111b3 Merge pull request #35808 from thaJeztah/prevent-panic-in-test
Prevent potential panic in TestLogsAPIUntil
Upstream-commit: 602bce175b40d77abf671b35afa9bf81c96b2b72
Component: engine
2017-12-19 11:16:00 -05:00
50a3444995 Re-validate Mounts on container start
Validation of Mounts was only performed on container _creation_, not on
container _start_. As a result, if the host-path no longer existed
when the container was started, a directory was created in the given
location.

This is the wrong behavior, because when using the `Mounts` API, host paths
should never be created, and an error should be produced instead.

This patch adds a validation step on container start, and produces an
error if the host path is not found.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 7cb96ba308dc53824d2203fd343a4a297d17976e
Component: engine
2017-12-19 11:44:29 +01:00
04606e240e Merge pull request #757 from pszczekutowicz/master
Return errors from client in stack deploy configs
Upstream-commit: 2b8eb23b8c
Component: cli
2017-12-19 11:05:49 +01:00
7a36094339 Merge pull request #35823 from thaJeztah/remove-dead-code
Remove dead code and redundant build tags
Upstream-commit: c492e76d13a61b13815475d1a6393ab1da1db5c8
Component: engine
2017-12-18 18:05:05 -06:00
3e7449957b Return errors from client in stack deploy configs
Signed-off-by: Paweł Szczekutowicz <pszczekutowicz@gmail.com>
Upstream-commit: a30dd1b6f3
Component: cli
2017-12-18 21:34:04 +01:00
048a0b941a 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>
Upstream-commit: e69127bd5ba4dcf8ae1f248db93a95795eb75b93
Component: engine
2017-12-18 14:33:45 -05:00
c5f1cdf92c projectquota: treat ENOSYS as quota unsupported
If mknod() returns ENOSYS, it most probably means quota is not supported
here, so return the appropriate error.

This is a conservative* fix to regression in vfs graph driver introduced
by commit 7a1618ced359a3ac92 ("add quota support to VFS graphdriver").
On some filesystems, vfs fails to init with the following error:

> Error starting daemon: error initializing graphdriver: Failed to mknod
> /go/src/github.com/docker/docker/bundles/test-integration/d6bcf6de610e9/root/vfs/backingFsBlockDev:
> function not implemented

Reported-by: Brian Goff <cpuguy83@gmail.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 2dd39b7841bdb9968884bbedc5db97ff77d4fe3e
Component: engine
2017-12-18 10:32:36 -08:00
df88bdc9c9 Merge pull request #69 from BSWANG/master
replace all '-' in version when generate rpm version
Upstream-commit: abc7613e1b7399b3a8012c00a8a3aaa01e1251fa
Component: packaging
2017-12-18 10:08:29 -08:00
fd08bae89c Remove redundant build-tags
Files that are suffixed with `_linux.go` or `_windows.go` are
already only built on Linux / Windows, so these build-tags
were redundant.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 6ed1163c98703f8dd0693cecbadc84d2cda811c3
Component: engine
2017-12-18 17:41:53 +01:00
ef4dfd2f67 Remove Solaris files
Solaris is no longer being worked on, so these files
are now just dead code.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 1589cc0a85396e2768bfe9e558c7c2100dc3bc87
Component: engine
2017-12-18 17:22:25 +01:00
7e2ee76b7e Remove unused experimental code
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 16fe5a12891984ae5d0b28e737958566a13958ae
Component: engine
2017-12-18 17:07:48 +01:00
15c0c88784 Merge component 'engine' from git@github.com:moby/moby master 2017-12-16 17:04:05 +00:00
f3becf1d35 Merge component 'cli' from git@github.com:docker/cli master 2017-12-16 16:41:09 +00:00
343f73cf3d Merge pull request #35811 from abhi/vendor
Vendoring swarmkit a6519e28ff2a558f5d32b2dab9fcb0882879b398
Upstream-commit: 26bc976ac9e379b4432f71394f069dfb1e4d7baf
Component: engine
2017-12-16 10:40:29 -06:00
435d4943db Merge pull request #35809 from cpuguy83/fix_container_zombies
Fix race conditions in libcontainerd process handling
Upstream-commit: 52656da9500eefedd69361849954e7d44b9a1513
Component: engine
2017-12-16 01:16:50 -08:00
756e315027 fix attribute names on ProgressDetail
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Upstream-commit: 5e63edfa935e4f87e588d358d7060227745de288
Component: engine
2017-12-16 09:38:34 +01:00
264a31ea91 CreateImage uses ‘id’ to track layers
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Upstream-commit: cfa07bffb5e27763fa4bb189133dadd179e4bd23
Component: engine
2017-12-16 09:38:34 +01:00
7b36860dee BuildInfo uses ‘aux’ to document image ID after build
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Upstream-commit: 9e29d2ea49aaee9cd92fa3fe026ff5f8ab1f8a25
Component: engine
2017-12-16 09:38:33 +01:00
ef43ef8bc9 Merge pull request #35794 from estesp/fix-overlay2-untarinuserns
Fix overlay2 storage driver inside a user namespace
Upstream-commit: 0862014431d40174a7b4e614ddcc0ee6e13ad570
Component: engine
2017-12-15 23:25:15 -08:00
ebbba75d0a 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>
Upstream-commit: 521e7eba86df25857647b93f13e5366c554e9d63
Component: engine
2017-12-15 17:20:42 -08:00
f77854ac3c Show container wait error
If container wait has failed, show an error from the engine
and return an appropriate exit code.

This requires engine changes from https://github.com/moby/moby/pull/34999

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 8471742a8a
Component: cli
2017-12-15 14:15:30 -08:00
a67c7bc0ee Merge pull request #713 from albers/completion-512
Fix #512 Bash autocompletion works incorrect with inspect
Upstream-commit: 718a245b6e
Component: cli
2017-12-15 16:33:41 -05:00
e1fb11f9ea Vendoring swarmkit a6519e28ff2a558f5d32b2dab9fcb0882879b398
Signed-off-by: abhi <abhi@docker.com>
Upstream-commit: efae8db785189dc1fe9ce880d190beb2e26cb0fd
Component: engine
2017-12-15 11:37:17 -08:00
fbc087df98 Fix some missing synchronization in libcontainerd
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 647cec4324186faa3183bd6a7bc72a032a86c8c9
Component: engine
2017-12-15 12:54:38 -05:00
b16d6e9f15 Merge component 'engine' from git@github.com:moby/moby master 2017-12-15 17:04:20 +00:00
c687cf1b38 Merge component 'cli' from git@github.com:docker/cli master 2017-12-15 16:41:16 +00:00
72249a1f2e 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>
Upstream-commit: e55bead518e4c72cdecf7de2e49db6c477cb58eb
Component: engine
2017-12-15 10:09:55 -05:00
53eeb39422 Simplify bash completion for service options
Previously, the completions for `--xxx` and the corresponding
`-xxx-add` and `-xxx-rm` options were defined in separate blocks.
This caused a lot of duplicated code.

This PR removes duplication for xxx=config|group|host|placement-pref|secret.

Now the blocks for `create` and `update` only contain completions for
options that either only exist for the particular command or are specific
to it (completions for `--env-rm` and `--env|env-add` differ).

Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: f2b42bb6a8
Component: cli
2017-12-15 13:49:42 +01:00
a7c2ea2fc4 Fix bash completion for service env, mounts and labels
`service create` and `service update` both used to have `--env`, `--label`
and `--mount` options.
These options now are only valid for `service create`.
`service update` got corresponding `--xxx-add|rm` options instead.

Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: d149c93c0c
Component: cli
2017-12-15 13:49:42 +01:00
5e5a802f6b Merge pull request #753 from thaJeztah/image-shortid
Updated deprecation status for "repository:shortid"
Upstream-commit: 69b11daa77
Component: cli
2017-12-15 01:35:11 -08:00
7ad7bb59be Merge pull request #35790 from thaJeztah/image-shortid
Remove support for referencing images by 'repository:shortid'
Upstream-commit: 6796e740fdcb8f446747a6b7890e71d4057b1082
Component: engine
2017-12-15 01:33:49 -08:00
ba6f88e84d Merge pull request #749 from albers/completion--generic-resource
Add support for generic resources to bash completion
Upstream-commit: 8684b99923
Component: cli
2017-12-15 01:08:42 -08:00
edf70bdb82 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>
Upstream-commit: 8ec80eec67
Component: cli
2017-12-15 08:56:14 +01:00
58f0e7706b Merge pull request #35793 from Microsoft/33107
Windows: Case-insensitive filename matching against builder cache
Upstream-commit: a59061da5f6d02f16563efc5ec7c561373d1c4e2
Component: engine
2017-12-14 23:48:47 -08:00
b845d8f122 Prevent potential panic in TestLogsAPIUntil
Seen failing on Windows:

    22:27:52 ----------------------------------------------------------------------
    22:27:52 PANIC: docker_api_logs_test.go:152: DockerSuite.TestLogsAPIUntil
    22:27:52
    22:27:52 ... Panic: runtime error: index out of range (PC=0x45AC01)
    22:27:52
    22:27:52 d:/CI/CI-7caa30e89/go/src/runtime/asm_amd64.s:509
    22:27:52   in call32
    22:27:52 d:/CI/CI-7caa30e89/go/src/runtime/panic.go:491
    22:27:52   in gopanic
    22:27:52 d:/CI/CI-7caa30e89/go/src/runtime/panic.go:28
    22:27:52   in panicindex
    22:27:52 docker_api_logs_test.go:175
    22:27:52   in DockerSuite.TestLogsAPIUntil
    22:27:52 d:/CI/CI-7caa30e89/go/src/runtime/asm_amd64.s:509
    22:27:52   in call32
    22:27:52 d:/CI/CI-7caa30e89/go/src/reflect/value.go:434
    22:27:52   in Value.call
    22:27:52 d:/CI/CI-7caa30e89/go/src/reflect/value.go:302
    22:27:52   in Value.Call
    22:27:52 c:/gopath/src/github.com/docker/docker/vendor/github.com/go-check/check/check.go:816
    22:27:52   in suiteRunner.forkTest.func1
    22:27:52 c:/gopath/src/github.com/docker/docker/vendor/github.com/go-check/check/check.go:672
    22:27:52   in suiteRunner.forkCall.func1
    22:27:52 d:/CI/CI-7caa30e89/go/src/runtime/asm_amd64.s:2337
    22:27:52   in goexit
    22:27:54
    22:27:54 ----------------------------------------------------------------------

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: e77de7856bf212c764555ab8c2f346f2c529467c
Component: engine
2017-12-14 23:20:44 -08:00
600655d01d 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>
Upstream-commit: a942c92dd77aff229680c7ae2a6de27687527b8a
Component: engine
2017-12-14 21:10:29 -08:00
eeeede3c5f Vendoring libnetwork_vendoring
Signed-off-by: Corbin <corbin.coleman@docker.com>
Upstream-commit: 1f70d6dd5870c779a4f036db30f5da04ba792b32
Component: engine
2017-12-14 16:57:17 -08:00
e653cda753 Merge pull request #751 from ktrysmt/fix/zsh-completions
Fix error in zsh completion script for docker exec
Upstream-commit: ee3ffd6540
Component: cli
2017-12-14 14:33:04 -08:00
14b537bf91 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>
Upstream-commit: 1a21ca12a6
Component: cli
2017-12-14 14:23:17 -08:00
5b55002724 Merge pull request #754 from thaJeztah/fix-on-failure
Fix "on-failure" restart policy being documented as "failure"
Upstream-commit: 1d54f30cbb
Component: cli
2017-12-14 14:20:43 -08:00
3ac0d82798 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>
Upstream-commit: 43217d7332
Component: cli
2017-12-14 13:50:56 -08:00
57c4619d75 Windows: Case-insensitive filename matching against builder cache
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 7caa30e8937b65ad9fd61a8b811bba470d22809f
Component: engine
2017-12-14 13:49:40 -08:00
a49939a820 Merge component 'engine' from git@github.com:moby/moby master 2017-12-14 17:04:42 +00:00
5dfe871bd5 Merge component 'cli' from git@github.com:docker/cli master 2017-12-14 16:41:16 +00:00
6f60e78f91 Download support of images with multi-arch manifest
Currently we only support 'application/vnd.docker.distribution.manifest.v2+json'
manifest images download, with more multi-arch images used, we need to support
download images with 'application/vnd.docker.distribution.manifest.list.v2+json'
format(aka "fat manifest"), else we will fail to download those multi-arch ones.

This PR adds 'application/vnd.docker.distribution.manifest.list.v2+json' manifest
support, thus we can download both multi-arch and legacy images.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Upstream-commit: 0af5db511ed1ed5beab0feb09a2a96347a263410
Component: engine
2017-12-14 05:37:22 +00:00
feccd72a49 Fix overlay2 storage driver inside a user namespace
The overlay2 driver was not setting up the archive.TarOptions field
properly like other storage backend routes to "applyTarLayer"
functionality. The InUserNS field is populated now for overlay2 using
the same query function used by the other storage drivers.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
Upstream-commit: 05b8d59015f8a5ce26c8bbaa8053b5bc7cb1a77b
Component: engine
2017-12-13 23:38:22 -05:00
63a4263b5f awslogs: Use batching type for ergonomics and correct counting
The previous bytes counter was moved out of scope was not counting the
total number of bytes in the batch. This type encapsulates the counter
and the batch for consideration and code ergonomics.

Signed-off-by: Jacob Vallejo <jakeev@amazon.com>
Upstream-commit: ad14dbf1346742f0607d7c28a8ef3d4064f5f9fd
Component: engine
2017-12-13 15:27:16 -08:00
0ef0e17180 Merge pull request #354 from seemethere/bump_dev_version_18_01
[master] bump version to 18.01.0-ce-dev
2017-12-13 13:58:23 -08:00
5b033215e5 bump version to 18.01.0-ce-dev
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2017-12-13 21:55:16 +00:00
9626c25157 Add Moby TSC references/governance details
Also added back some of the maintainer processes that were in
MAINTAINERS but moved to docker/opensource repo. I believe this
project's governance should be disconnected from docker/opensource as
project's remaining under docker/opensource will not use the Moby TSC.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
Upstream-commit: 449c870afbd21563a6df04445fbb136d3230629b
Component: engine
2017-12-13 16:51:46 -05:00
f76cba5158 Merge pull request #35788 from yongtang/35609-carry
Carry #35609 (remove import of opencontainers/runc in windows)
Upstream-commit: 1cea9d3bdb427bbdd7f14c6b11a3f6cef332bd34
Component: engine
2017-12-13 15:56:31 -05:00
0834563329 use swagger support for « title » as generated types names for inline schema
align naming convention with x-go-name

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Upstream-commit: 8e7f9afa471c2be079f2c8897cf3b87e7f60544e
Component: engine
2017-12-13 18:54:37 +01:00
05b6e11768 Merge pull request #748 from thaJeztah/fix-storage-driver-anchors
Fix anchors to "Storage driver options"
Upstream-commit: 6a2b9d0267
Component: cli
2017-12-13 09:53:05 -08:00
4a3429a762 Remove getBlkioWeightDevices in daemon_windows.go as it is not needed
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 0866dee5fdb039adf73cd99e23bc5382a3dc8610
Component: engine
2017-12-13 17:31:28 +00:00
e5dd0c19d9 remove import of opencontainers/runc in windows
We are planning to remove supports for non-Linux platform in
runc (https://github.com/opencontainers/runc/pull/1654).  The current
import here is the only thing that i found in docker that is windows-related
so fixing this would remove the rest of windows code in runc.

This changes some functions in daemon_windows to be the same as
daemon_unix to use runtime-spec public API instead of runc.

Signed-off-by: Daniel Dao <dqminh89@gmail.com>
Upstream-commit: 4d1d486202a7c3977e51275c2efdba922375b0cd
Component: engine
2017-12-13 17:18:56 +00:00
78fc682ae3 Merge component 'engine' from git@github.com:moby/moby master 2017-12-13 17:04:12 +00:00
1fd0a9d87b Merge component 'cli' from git@github.com:docker/cli master 2017-12-13 16:41:10 +00:00
f1310bd820 Fixed #750
Signed-off-by: Kotaro Yoshimatsu <kotaro.yoshimatsu@gmail.com>
Upstream-commit: db05d8ad79
Component: cli
2017-12-13 17:45:14 +09:00
faf7b2e58e Merge pull request #747 from thaJeztah/17.12-update-deprecated
Update docs and completion-scripts for deprecated features
Upstream-commit: 619c40fac5
Component: cli
2017-12-13 00:02:26 -08:00
4ee5590aac Merge pull request #35773 from arm64b/aarch64-multi-arch-imgs-replacement
Legacy images replacement with multi-arch ones on AArch64
Upstream-commit: 5dc791c2debd561f61f04ec5a947f261fe79b275
Component: engine
2017-12-13 14:56:14 +08:00
dc415e6d5e Merge pull request #35681 from javabrett/docs-contributing-2
Updated developer doc to explain external CLI
Upstream-commit: b59585897709189ccdec5aaa612bc133f2030e24
Component: engine
2017-12-13 12:35:59 +09:00
75b526540d Updated developer doc to explain included static cli and move of cli moby->docker-ce.
Signed-off-by: Brett Randall <javabrett@gmail.com>
Upstream-commit: b7109162ea5b1ce493144e5ba3116a20fc2fe068
Component: engine
2017-12-13 14:31:34 +11:00
0810853589 Merge pull request #746 from lachlancooper/master
Correct references to --publish long syntax in docs
Upstream-commit: 29ae8cf0e0
Component: cli
2017-12-12 17:31:09 -08:00
ea904b1a94 Fix anchors to "Storage driver options"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 630f8b1254
Component: cli
2017-12-12 17:27:05 -08:00
ee5a10619c 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>
Upstream-commit: a119e39f0c
Component: cli
2017-12-12 17:09:38 -08:00
a85f0c817f Merge pull request #35770 from thaJeztah/use-commit-instead-of-version
Use commit-sha instead of tag for containerd
Upstream-commit: a03e7779679043d3aa8acfef47a3554a6703fd38
Component: engine
2017-12-12 18:07:43 -06:00
467a8bb243 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>
Upstream-commit: 90f44e564b
Component: cli
2017-12-13 10:25:43 +11:00
6959a6fac2 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>
Upstream-commit: 2c8018f4bd7f48bf8f35770dea68f81b9591bb58
Component: engine
2017-12-12 10:43:56 -08:00
aa0cf4fa09 Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2017-12-12 17:05:27 +00:00
a4823e1268 Merge component 'engine' from git@github.com:moby/moby master 2017-12-12 17:05:22 +00:00
74ffa93aa3 Merge component 'cli' from git@github.com:docker/cli master 2017-12-12 16:41:10 +00:00
5e0f8059c9 Merge pull request #35771 from thaJeztah/fix-flaky-testloTestLogsAPIUntil
Make TestLogsAPIUntil less flaky
Upstream-commit: 1082aa759ebd73971a92a48c6c7b253cf1605ae7
Component: engine
2017-12-12 10:12:35 -06:00
d81d63c977 Legacy images replacement with multi-arch ones on AArch64
Replace those legacy docker images prefixed by 'aarch64/' and 'arm64v8/'
with official multi-arch ones.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Upstream-commit: 7fc697eb0b62557b4abaa3b9fc0cd44b5c1652ac
Component: engine
2017-12-12 05:47:17 +00:00
ec88074283 Merge pull request #35765 from ghislainbourgeois/35613-update-go-gelf-v2-for-bugfix
Update Graylog2/go-gelf vendoring. Fixes #35613
Upstream-commit: e48e938fc2e7e6c17d96c27e13e4d984ec68a9cb
Component: engine
2017-12-11 21:06:21 -08:00
1aec0724c8 Merge pull request #743 from dnephin/compose-add-name-to-network
Fix external networks in stacks
Upstream-commit: eb5e32e78c
Component: cli
2017-12-11 19:26:55 -08:00
c8a642f128 Make TestLogsAPIUntil less flaky
Commit ee594dcb7d42f95048c9047d86c61447243db3cd removed the
`sleep 0.5` from this test, because sleep has a full-second
precision. However, in some cases, all three log-entries
are output at the same time, causing the `--until` filter
to fail.

This patch adds back a `sleep`, but uses 1 second instead.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 1360f0dc9a5460bccf7974f7718d031435b883f3
Component: engine
2017-12-11 18:28:29 -08:00
35175d99d5 Merge pull request #70 from seemethere/pass_version_static
Pass VERSION to engine static builds
Upstream-commit: 453d9a201fc841ab30ae27246e48f97871b37d95
Component: packaging
2017-12-11 16:15:56 -08:00
5b1b2d3dcf 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>
Upstream-commit: c411321b8870101c227b03e64930260984c862fd
Component: packaging
2017-12-12 00:07:40 +00:00
209f0e3356 Merge pull request #35768 from thaJeztah/fix-healthcheck-typo
Fix typo in log-message
Upstream-commit: b687d6379db06bf0305d75c15f8f0e7f0dbeb921
Component: engine
2017-12-11 17:52:53 -06:00
90cb59fabc Merge pull request #35732 from rhvgoyal/error-info
devmapper: Log fstype and mount options during mount error
Upstream-commit: f5416e76702e8becb34d1e9843d0e2cd0f9f95bf
Component: engine
2017-12-11 14:37:30 -08:00
d586c2cf19 Update Graylog2/go-gelf vendoring. Fixes #35613
Signed-off-by: Ghislain Bourgeois <ghislain.bourgeois@gmail.com>
Upstream-commit: f9f3c49302fc80e586e3cb10af43114929556b47
Component: engine
2017-12-11 15:55:50 -05:00
6c564b6785 Fix vendoring of go-gelf to point to specific commit ID
Signed-off-by: Ghislain Bourgeois <ghislain.bourgeois@gmail.com>
Upstream-commit: 5bc11021250e39e71ca9edf62ce5c33f15c3756f
Component: engine
2017-12-11 15:53:11 -05:00
eae25b27ea Fix typo in log-message
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 5c3418e38b9603e8ff582d53c2face57f0f01cce
Component: engine
2017-12-11 10:59:51 -08:00
ef0d4a2bec devmapper: Log fstype and mount options during mount error
Right now we only log source and destination (and demsg) if mount operation
fails. fstype and mount options are available easily. It probably is a good
idea to log these as well. Especially sometimes failures can happen due to
mount options.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: f728d74ac5d185adaa5f1a88eadc71217806859f
Component: engine
2017-12-11 13:27:14 -05:00
1e22870b24 Merge pull request #35751 from thaJeztah/disallow-v1-registries
Disallow using legacy (V1) registries
Upstream-commit: 549a2b9bbe757c8cd6d295f51fd67074847b7a94
Component: engine
2017-12-11 10:25:42 -08:00
29bb8562cc Fix external networks
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 9da2602f38
Component: cli
2017-12-11 11:29:49 -05:00
ee263ca445 Merge component 'engine' from git@github.com:moby/moby master 2017-12-09 17:04:56 +00:00
099ae9b4b0 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>
Upstream-commit: 8d6df8a0addc9a37b48c5a1827dd3f65f2ed57cf
Component: engine
2017-12-09 02:24:43 -08:00
1305053a0b Merge pull request #35738 from thaJeztah/bump-api-version
Bump API version to 1.36
Upstream-commit: 3b14e5980ef681c47faf128b5c23cb972fd8851d
Component: engine
2017-12-08 22:18:24 -08:00
fd3779deb1 Update go-swagger installation steps in Dockerfile
The installation steps for go-swagger was a bit noisy, and not consistent with
other installation steps.

This patch makes it similar to other steps, which makes it less noisy, and
makes the image slightly smaller.

Before:

    b53d7aac3200        14 minutes ago      |1 APT_MIRROR=deb.debian.org /bin/sh -c git …   107MB
    fa74acf32f99        2 hours ago         /bin/sh -c #(nop)  ENV GO_SWAGGER_COMMIT=c28…   0B

After:

    6b2454f1a9a5        10 minutes ago      |1 APT_MIRROR=deb.debian.org /bin/sh -c set …   35.2MB
    fa74acf32f99        2 hours ago         /bin/sh -c #(nop)  ENV GO_SWAGGER_COMMIT=c28…   0B

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 29d77acaf8bfb234ee4f0b3db9e28d7410b99d4e
Component: engine
2017-12-08 14:02:32 -08:00
443795270f Merge pull request #35745 from cpuguy83/fix_test_sleep
Remove uneeded sleep in test bash loop
Upstream-commit: 967224c254884d6659ad7ec66bdd9da1b4c7d49f
Component: engine
2017-12-08 14:24:05 -06:00
5b48c4106b gitutils: remove checkout directory on error
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 4ea320cb8ef71c2fc9ee391e2e8be915ba99b17e
Component: engine
2017-12-08 11:58:13 -08:00
6f58b7f1de Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2017-12-08 17:04:13 +00:00
16d5b20e33 Merge component 'engine' from git@github.com:moby/moby master 2017-12-08 17:04:08 +00:00
6fdef05177 Merge component 'cli' from git@github.com:docker/cli master 2017-12-08 16:41:35 +00:00
27e78af99a Merge pull request #35567 from huangyanhong/hyhdocker
modify log in order to be same below
Upstream-commit: c7256dc38ed8fe5a428c85002a674c19754d8dd3
Component: engine
2017-12-08 16:30:51 +01:00
141bc0558d Remove uneeded sleep in test bash loop
This sleep probably doesn't work because sleep typically takes only
whole numbers, to do < 1s you need to use usleep. It also is not really
needed as the loop has a very low bound that will not eat up too much
CPU.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: ee594dcb7d42f95048c9047d86c61447243db3cd
Component: engine
2017-12-08 09:25:55 -05:00
cd7f41a503 replace all '-' in version when generate rpm version
Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
Upstream-commit: 39c434fb36f66803b107ad410dec6b06875bfe97
Component: packaging
2017-12-08 17:47:43 +08:00
04040622fb Merge pull request #741 from thaJeztah/bump-version
Bump version to 18.01-dev
Upstream-commit: 29d3510d50
Component: cli
2017-12-08 09:04:04 +01:00
7b0f6565c5 Merge pull request #35720 from ripcurld0/weboscket_debug
Add a debug message when client closes websocket attach connection
Upstream-commit: 9f5540f672e618667a8a3f185193232cc4d52617
Component: engine
2017-12-07 16:53:56 -08:00
376d2e9872 Do not terminate on missing build-ids (#68)
Do not terminate on missing build-ids
Upstream-commit: 8457a25900698f1bdef844c22fb19900de1a5bc7
Component: packaging
2017-12-07 16:11:20 -08:00
6edf75f3d5 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>
Upstream-commit: dcd681da54f2c2b2286cc09d053dd6cb865d3f98
Component: packaging
2017-12-07 23:56:30 +00:00
782ef5e9db Merge pull request #35680 from javabrett/docs-contributing
Changed go vendor from moby/moby to docker/docker in dev docs.
Upstream-commit: 8fe0a759f72442d7582c4453e6306822c53224bf
Component: engine
2017-12-07 15:04:28 -08:00
fd25684fc8 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>
Upstream-commit: ffcd040b5c3bd4f81e1d1f11c32f9bb81e235ed1
Component: packaging
2017-12-07 14:25:41 -08:00
94fbfde561 gitutils: fix checking out submodules
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: a6025255246aab21426a51986b7d138a14d9ac90
Component: engine
2017-12-07 14:25:19 -08:00
c3b54b0b2b Bump version to 18.01-dev
The 17.12.0-rc1 release was cut-off from commit
ace5417954

This patch bumps the version to 18.01-dev to
indicate that any change is now for the upcoming
18.01 release.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: c4875264a3
Component: cli
2017-12-07 13:58:06 -08:00
17ee87b9ed Bump API version to 1.36
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: c1e982f2ee85580687e2d355af3ca444ada14d01
Component: engine
2017-12-07 13:52:49 -08:00
4ef94db1ce Merge pull request #35724 from thaJeztah/update-api-changelog
Update API version-history for 1.35
Upstream-commit: 1056d554c5da5d959b551f32ba34a3e2cffd61b2
Component: engine
2017-12-07 09:35:01 -08:00
90f62259ac Merge pull request #35733 from mlaventure/update-mlaventure-details
Update mlaventure email
Upstream-commit: 268226e5461991ed12a5a02d8c5fdd25b120eab0
Component: engine
2017-12-07 09:33:46 -08:00
4343c7deaa Merge component 'engine' from git@github.com:moby/moby master 2017-12-07 17:04:36 +00:00
43ace3ab68 Update mlaventure email
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 2ba8ce708727578752d9838d9c4db945cd008792
Component: engine
2017-12-07 08:41:20 -08:00
b8eda642a7 Splunk: limit the reader size on error responses
Before this patch, if a splunk endpoint returned a non-OK status, the
splunk driver would read the entire response body. This could lead to
excessive memory allocations. Instead put a cap on the amount the driver
will read from the response body.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 7f14542ddd1401de734be3ac0331c0ada941c959
Component: engine
2017-12-07 11:22:58 -05:00
6a7f05996f Merge pull request #35728 from tonistiigi/vendor-archive
vendor: update archive/tar
Upstream-commit: 72a37709ade3de1091d208d24ddab0e1168aa5d3
Component: engine
2017-12-06 20:50:27 -08:00
090ce73a5d Changed go vendor from moby/moby to docker/docker in dev docs.
If there is a package-rename forthcoming, it isn't currently evident on master, but seems to show in doc.
Changed doc to show actual docker/docker paths as they occur now instead of moby/moby.

Signed-off-by: Brett Randall <javabrett@gmail.com>
Upstream-commit: 355cf9483c1b8ede5ae3ed50add4de2a69d62645
Component: engine
2017-12-07 14:06:24 +11:00
74dc65818c vendor: update archive/tar
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 13954b0a6282d919c91626a23967377c19ee7aa2
Component: engine
2017-12-06 18:02:45 -08:00
9b7822f4af Update API version-history for 1.35
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 8a9d926b553345be530ddc51374c9817fcbea784
Component: engine
2017-12-06 15:02:10 -08:00
1be15401b4 Add a debug message when client closes websocket attach connection
When the client closes websocket connections that sends container
output through websocket, an error message is displayed:
"Error attaching websocket: %!s(<nil>)"

This message is misleading. Thus, this change suggests to check
if error is nil and print the correct message accordingly.

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: 8f65bb6d90e3a95420bb634e415c3cce36d86201
Component: engine
2017-12-06 16:57:41 +02:00
a017ada68b Don't append the container id to custom directory checkpoints. Fixes #34601.
Signed-off-by: Ross Boucher <rboucher@gmail.com>
Upstream-commit: e51aec992624fec305176866f3937e0a120cecb8
Component: engine
2017-12-04 14:24:35 -05:00
c05aa2cc73 Minor bash completion improvements/fixes
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 53376b60c6
Component: cli
2017-12-04 09:33:14 +01:00
8583ba4a32 Improve bash completion for images
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 5ee3b9b461
Component: cli
2017-12-04 09:33:14 +01:00
f1cfd038e2 zfs: fix ebusy on umount
This commit is a set of fixes and improvement for zfs graph driver,
in particular:

1. Remove mount point after umount in `Get()` error path, as well
   as in `Put()` (with `MNT_DETACH` flag). This should solve "failed
   to remove root filesystem for <ID> .... dataset is busy" error
   reported in Moby issue 35642.

To reproduce the issue:

   - start dockerd with zfs
   - docker run -d --name c1 --rm busybox top
   - docker run -d --name c2 --rm busybox top
   - docker stop c1
   - docker rm c1

Output when the bug is present:
```
Error response from daemon: driver "zfs" failed to remove root
filesystem for XXX : exit status 1: "/sbin/zfs zfs destroy -r
scratch/docker/YYY" => cannot destroy 'scratch/docker/YYY':
dataset is busy
```

Output when the bug is fixed:
```
Error: No such container: c1
```
(as the container has been successfully autoremoved on stop)

2. Fix/improve error handling in `Get()` -- do not try to umount
   if `refcount` > 0

3. Simplifies unmount in `Get()`. Specifically, remove call to
   `graphdriver.Mounted()` (which checks if fs is mounted using
   `statfs()` and check for fs type) and `mount.Unmount()` (which
   parses `/proc/self/mountinfo`). Calling `unix.Unmount()` is
   simple and sufficient.

4. Add unmounting of driver's home to `Cleanup()`.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: a450a575a672b90f02a4b1d3d9300ce1d70a6311
Component: engine
2017-12-01 13:46:47 -08:00
25c006f1cc Fix #512 Bash autocompletion works incorrect with inspect
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: a2d0b6e122
Component: cli
2017-11-30 17:28:33 +01:00
d07549fe22 modify log in order to be same below
Signed-off-by: 黄艳红00139573 <huang.yanhong@zte.com.cn>
Signed-off-by: huangyanhong <huang.yanhong@zte.com.cn>
Upstream-commit: fe8bcb1a8e5ab0426822d512df97eebed268dfc4
Component: engine
2017-11-27 08:43:05 +08:00
01d480da3c duplicate definitions for API response with just an ID
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Upstream-commit: d6935a8f1a4003c0b6f1b89a0e28e721d0756ac9
Component: engine
2017-11-24 11:41:04 +01:00
749a92c1a6 schema is missing CanRemove & DetachKeys
example demonstrates they are expected

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Upstream-commit: 74cb739766e517115c5af9cee2202613661238a0
Component: engine
2017-11-24 11:40:12 +01:00
e56d0513c6 Add journald tag as SYSLOG_IDENTIFIER
Signed-off-by: Vlastimil Zeman <vlastimil.zeman@diffblue.com>
Upstream-commit: ae557f9d85f41e009229d1a33844f06f7ad1fb99
Component: engine
2017-11-22 08:51:23 +00:00
3acd4904bf Fix TestAttachExitCode
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: bace33d7a8
Component: cli
2017-11-17 18:12:48 -08:00
1a65d7d84f attach: Use ContainerWait instead of Inspect
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 66661761d5
Component: cli
2017-11-17 18:12:46 -08:00
8fc8b79463 *: switch to -buildmode=pie
Go has supported PIC builds for a while now, and given the security
benefits of using PIC binaries we should really enable them. There also
appears to be some indication that non-PIC builds have been interacting
oddly on ppc64le (the linker cannot load some shared libraries), and
using PIC builds appears to solve this problem.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
Upstream-commit: 1f4e37cf4bd2f73dc5257d791cc4dba294ddd156
Component: engine
2017-11-11 21:59:49 +11:00
6d69a9855a Enable HotAdd for Windows
Signed-off-by: Madhan Raj Mookkandy <madhanm@microsoft.com>
Upstream-commit: 5c1cfb1d27a1a7f7c0cb9092e69c3f70717fbbef
Component: engine
2017-11-03 14:24:10 -07:00
0ccfca8508 Improve presentation of published port ranges
Port mappings in `docker service ls` are quite verbose, and occupy a lot of
space when ranges of ports are published.

This patch improves the output by reconstructing ranges of ports.

Given the following service;

    $ docker service create \
      -p 60-61:60-61 \
      -p 62:61 \
      -p 80:80 \
      -p 81:80 \
      -p 90-95:90-95 \
      -p 90-92:90-92/udp \
      -p 93-96:93-96/udp \
      --name foo \
      nginx:alpine

Before this patch is applied:

    $ docker service ls
    ID                  NAME                MODE                REPLICAS            IMAGE               PORTS
    u1kwguv841qg        foo                 replicated          1/1                 nginx:alpine        *:60->60/tcp,*:61->61/tcp,*:62->61/tcp,*:80->80/tcp,*:81->80/tcp,*:90->90/tcp,*:91->91/tcp,*:92->92/tcp,*:93->93/tcp,*:94->94/tcp,*:95->95/tcp,*:90->90/udp,*:91->91/udp,*:92->92/udp,*:93->93/udp,*:94->94/udp,*:95->95/udp,*:96->96/udp

After this patch is applied:

    $ docker service ls
    ID                  NAME                MODE                REPLICAS            IMAGE               PORTS
    u1kwguv841qg        foo                 replicated          1/1                 nginx:alpine        *:60-62->60-61/tcp,*:80-81->80/tcp,*:90-95->90-95/tcp,*:90-96->90-96/udp

Additional enhancements can still be made, and marked as TODO in this change;

- combine non-consecutive ports mapped to a single port (`80->80`, `81->80`,
  `84->80`, `86->80`, `87->80`); to be printed as `*:80-81,84,86-87->80`.
- combine `tcp` and `udp` mappings if their port-mapping is the same;
  print `*:80-81->80-81/tcp+udp` instead of `*:80-81->80-81/tcp, *:80-81->80-81/udp`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: e98e95e7bc
Component: cli
2017-10-02 12:54:20 +02:00
d873e90bed Update gitignore
Adding some lines from the Moby gitignore

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: cdaf6f44ba
Component: cli
2017-09-27 16:45:35 +02:00
6d1342e805 Fix leading characters being stripped from example sections in YAML
`strings.Trim()` strips any character listed in the `cutset` argument,
so any example section having `E`, `x`, `a`, `m`, `p`, `l`, `e`, or `s`
in the first word, had these characters missing in the generated
YAML.

Also trim superfluent whitespace characters to consistently use `|-` ("strip")
as block chomping indicator (see http://www.yaml.org/spec/1.2/spec.html#id2794534)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 1f605d43ca
Component: cli
2017-09-27 10:59:09 +02:00
3398b05230 Update event filter zsh completion with disable, enable, install, and remove
Signed-off-by: Jean-Pierre Huynh <jean-pierre.huynh@ounet.fr>
Upstream-commit: d31df921ad
Component: cli
2017-07-21 11:53:05 +01:00
3940 changed files with 376874 additions and 40744 deletions

View File

@ -1,151 +1,155 @@
# Changelog
# Changelog
For more information on the list of deprecated flags and APIs please have a look at
https://docs.docker.com/engine/deprecated/ where you can find the target removal dates
Items starting with `DEPRECATE` are important deprecation notices. For more
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.
**IMPORTANT**: You must 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.1-ce (2018-02-27)
### Client
- Fix `node-generic-resource` typo [moby/moby#35970](https://github.com/moby/moby/pull/35970) and [moby/moby#36125](https://github.com/moby/moby/pull/36125)
* Return errors from daemon on stack deploy configs create/update [docker/cli#757](https://github.com/docker/cli/pull/757)
### Logging
- awslogs: fix batch size calculation for large logs [moby/moby#35726](https://github.com/moby/moby/pull/35726)
* Support a proxy in splunk log driver [moby/moby#36220](https://github.com/moby/moby/pull/36220)
### Networking
- Fix ingress network when upgrading from 17.09 to 17.12 [moby/moby#36003](https://github.com/moby/moby/pull/36003)
* Add verbose info to partial overlay ID [moby/moby#35989](https://github.com/moby/moby/pull/35989)
- Fix IPv6 networking being deconfigured if live-restore is being enabled [docker/libnetwork#2043](https://github.com/docker/libnetwork/pull/2043)
- Fix watchMiss thread context [docker/libnetwork#2051](https://github.com/docker/libnetwork/pull/2051)
### Packaging
- Set TasksMax in docker.service [docker/docker-ce-packaging#78](https://github.com/docker/docker-ce-packaging/pull/78)
### Runtime
* Bump Golang to 1.9.4
* Bump containerd to 1.0.1
- Fix dockerd not being able to reconnect to containerd when it is restarted [moby/moby#36173](https://github.com/moby/moby/pull/36173)
- Fix containerd events from being processed twice [moby/moby#35891](https://github.com/moby/moby/issues/35891)
- Fix vfs graph driver failure to initialize because of failure to setup fs quota [moby/moby#35827](https://github.com/moby/moby/pull/35827)
- Fix regression of health check not using container's working directory [moby/moby#35845](https://github.com/moby/moby/pull/35845)
- Honor `DOCKER_RAMDISK` with containerd 1.0 [moby/moby#35957](https://github.com/moby/moby/pull/35957)
- Update runc to fix hang during start and exec [moby/moby#36097](https://github.com/moby/moby/pull/36097)
- Windows: Vendor of Microsoft/hcsshim @v.0.6.8 partial fix for import layer failing [moby/moby#35924](https://github.com/moby/moby/pull/35924)
* Do not make graphdriver homes private mounts [moby/moby#36047](https://github.com/moby/moby/pull/36047)
* Use rslave propogation for mounts from daemon root [moby/moby#36055](https://github.com/moby/moby/pull/36055)
* Set daemon root to use shared mount propagation [moby/moby#36096](https://github.com/moby/moby/pull/36096)
* Validate that mounted paths exist when container is started, not just during creation [moby/moby#35833](https://github.com/moby/moby/pull/35833)
* Add `REMOVE` and `ORPHANED` to TaskState [moby/moby#36146](https://github.com/moby/moby/pull/36146)
- Fix issue where network inspect does not show Created time for networks in swarm scope [moby/moby#36095](https://github.com/moby/moby/pull/36095)
* Nullify container read write layer upon release [moby/moby#36130](https://github.com/moby/moby/pull/36160) and [moby/moby#36343](https://github.com/moby/moby/pull/36242)
### Swarm
* Remove watchMiss from swarm mode [docker/libnetwork#2047](https://github.com/docker/libnetwork/pull/2047)
## 17.12.0-ce (2017-12-27)
## Known Issues
* AWS logs batch size calculation [moby/moby#35726](https://github.com/moby/moby/pull/35726)
* Health check no longer uses the container's working directory [moby/moby#35843](https://github.com/moby/moby/issues/35843)
* Errors not returned from client in stack deploy configs [moby/moby#757](https://github.com/docker/cli/pull/757)
* Daemon aborts when project quota fails [moby/moby#35827](https://github.com/moby/moby/pull/35827)
* Docker cannot use memory limit when using systemd options [moby/moby#35123](https://github.com/moby/moby/issues/35123)
### 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)
## 18.03.1-ce (2018-04-26)
### 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)
### 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)
- Fix error with merge compose file with networks [docker/cli#983](https://github.com/docker/cli/pull/983)
* Fix docker stack deploy re-deploying services after the service was updated with `--force` [docker/cli#963](https://github.com/docker/cli/pull/963)
* Fix docker version output alignment [docker/cli#965](https://github.com/docker/cli/pull/965)
### 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)
- Fix AppArmor profiles not being applied to `docker exec` processes [moby/moby#36466](https://github.com/moby/moby/pull/36466)
- Don't sort plugin mount slice [moby/moby#36711](https://github.com/moby/moby/pull/36711)
- Daemon/cluster: handle partial attachment entries during configure [moby/moby#36769](https://github.com/moby/moby/pull/36769)
* Bump Golang to 1.9.5 [moby/moby#36779](https://github.com/moby/moby/pull/36779) [docker/cli#986](https://github.com/docker/cli/pull/986)
- Daemon/stats: more resilient cpu sampling [moby/moby#36519](https://github.com/moby/moby/pull/36519)
* Containerd: update to 1.0.3 release [moby/moby#36749](https://github.com/moby/moby/pull/36749)
- Fix Windows layer leak when write fails [moby/moby#36728](https://github.com/moby/moby/pull/36728)
* Don't make container mount unbindable [moby/moby#36768](https://github.com/moby/moby/pull/36768)
- Fix Daemon panics on container export after a daemon restart [moby/moby/36586](https://github.com/moby/moby/pull/36586)
- Fix digest cache being removed on autherrors [moby/moby#36509](https://github.com/moby/moby/pull/36509)
- Make sure plugin container is removed on failure [moby/moby#36715](https://github.com/moby/moby/pull/36715)
- Copy: avoid using all system memory with authz plugins [moby/moby#36595](https://github.com/moby/moby/pull/36595)
- Relax some libcontainerd client locking [moby/moby#36848](https://github.com/moby/moby/pull/36848)
### 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)
* Increase raft Election tick to 10 times Heartbeat tick [moby/moby#36672](https://github.com/moby/moby/pull/36672)
### Packaging
### Networking
+ 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)
+ Added support for aarch64 on Debian (stretch/jessie) and Ubuntu Zesty or newer [docker/docker-ce-packaging#35](https://github.com/docker/docker-ce-packaging/pull/35)
* Gracefully remove LB endpoints from services [docker/libnetwork#2112](https://github.com/docker/libnetwork/pull/2112)
* Retry other external DNS servers on ServFail [docker/libnetwork#2121](https://github.com/docker/libnetwork/pull/2121)
* Improve scalabiltiy of bridge network isolation rules [docker/libnetwork#2117](https://github.com/docker/libnetwork/pull/2117)
* Allow for larger preset property values, do not override [docker/libnetwork#2124](https://github.com/docker/libnetwork/pull/2124)
* Prevent panics on concurrent reads/writes when calling `changeNodeState` [docker/libnetwork#2136](https://github.com/docker/libnetwork/pull/2136)
## 18.03.0-ce (2018-03-21)
### Builder
* Switch to -buildmode=pie [moby/moby#34369](https://github.com/moby/moby/pull/34369)
* Allow Dockerfile to be outside of build-context [docker/cli#886](https://github.com/docker/cli/pull/886)
* Builder: fix wrong cache hits building from tars [moby/moby#36329](https://github.com/moby/moby/pull/36329)
- Fixes files leaking to other images in a multi-stage build [moby/moby#36338](https://github.com/moby/moby/pull/36338)
### Client
* Simplify the marshaling of compose types.Config [docker/cli#895](https://github.com/docker/cli/pull/895)
+ Add support for multiple composefile when deploying [docker/cli#569](https://github.com/docker/cli/pull/569)
- Fix broken Kubernetes stack flags [docker/cli#831](https://github.com/docker/cli/pull/831)
- Fix stack marshaling for Kubernetes [docker/cli#890](https://github.com/docker/cli/pull/890)
- Fix and simplify bash completion for service env, mounts and labels [docker/cli#682](https://github.com/docker/cli/pull/682)
- Fix `before` and `since` filter for `docker ps` [moby/moby#35938](https://github.com/moby/moby/pull/35938)
- Fix `--label-file` weird behavior [docker/cli#838](https://github.com/docker/cli/pull/838)
- Fix compilation of defaultCredentialStore() on unsupported platforms [docker/cli#872](https://github.com/docker/cli/pull/872)
* Improve and fix bash completion for images [docker/cli#717](https://github.com/docker/cli/pull/717)
+ Added check for empty source in bind mount [docker/cli#824](https://github.com/docker/cli/pull/824)
- Fix TLS from environment variables in client [moby/moby#36270](https://github.com/moby/moby/pull/36270)
* docker build now runs faster when registry-specific credential helper(s) are configured [docker/cli#840](https://github.com/docker/cli/pull/840)
* Update event filter zsh completion with `disable`, `enable`, `install` and `remove` [docker/cli#372](https://github.com/docker/cli/pull/372)
* Produce errors when empty ids are passed into inspect calls [moby/moby#36144](https://github.com/moby/moby/pull/36144)
* Marshall version for the k8s controller [docker/cli#891](https://github.com/docker/cli/pull/891)
* Set a non-zero timeout for HTTP client communication with plugin backend [docker/cli#883](https://github.com/docker/cli/pull/883)
+ Add DOCKER_TLS environment variable for --tls option [docker/cli#863](https://github.com/docker/cli/pull/863)
+ Add --template-driver option for secrets/configs [docker/cli#896](https://github.com/docker/cli/pull/896)
+ Move `docker trust` commands out of experimental [docker/cli#934](https://github.com/docker/cli/pull/934) [docker/cli#935](https://github.com/docker/cli/pull/935) [docker/cli#944](https://github.com/docker/cli/pull/944)
### Logging
* AWS logs - don't add new lines to maximum sized events [moby/moby#36078](https://github.com/moby/moby/pull/36078)
* Move log validator logic after plugins are loaded [moby/moby#36306](https://github.com/moby/moby/pull/36306)
* Support a proxy in Splunk log driver [moby/moby#36220](https://github.com/moby/moby/pull/36220)
- Fix log tail with empty logs [moby/moby#36305](https://github.com/moby/moby/pull/36305)
### Networking
* Libnetwork revendoring [moby/moby#36137](https://github.com/moby/moby/pull/36137)
- Fix for deadlock on exit with Memberlist revendor [docker/libnetwork#2040](https://github.com/docker/libnetwork/pull/2040)
* Fix user specified ndots option [docker/libnetwork#2065](https://github.com/docker/libnetwork/pull/2065)
- Fix to use ContainerID for Windows instead of SandboxID [docker/libnetwork#2010](https://github.com/docker/libnetwork/pull/2010)
* Verify NetworkingConfig to make sure EndpointSettings is not nil [moby/moby#36077](https://github.com/moby/moby/pull/36077)
- Fix `DockerNetworkInternalMode` issue [moby/moby#36298](https://github.com/moby/moby/pull/36298)
- Fix race in attachable network attachment [moby/moby#36191](https://github.com/moby/moby/pull/36191)
- Fix timeout issue of `InspectNetwork` on AArch64 [moby/moby#36257](https://github.com/moby/moby/pull/36257)
* Verbose info is missing for partial overlay ID [moby/moby#35989](https://github.com/moby/moby/pull/35989)
* Update `FindNetwork` to address network name duplications [moby/moby#30897](https://github.com/moby/moby/pull/30897)
* Disallow attaching ingress network [docker/swarmkit#2523](https://github.com/docker/swarmkit/pull/2523)
- Prevent implicit removal of the ingress network [moby/moby#36538](https://github.com/moby/moby/pull/36538)
- Fix stale HNS endpoints on Windows [moby/moby#36603](https://github.com/moby/moby/pull/36603)
- IPAM fixes for duplicate IP addresses [docker/libnetwork#2104](https://github.com/docker/libnetwork/pull/2104) [docker/libnetwork#2105](https://github.com/docker/libnetwork/pull/2105)
### Runtime
* Enable HotAdd for Windows [moby/moby#35414](https://github.com/moby/moby/pull/35414)
* LCOW: Graphdriver fix deadlock in hotRemoveVHDs [moby/moby#36114](https://github.com/moby/moby/pull/36114)
* LCOW: Regular mount if only one layer [moby/moby#36052](https://github.com/moby/moby/pull/36052)
* Remove interim env var LCOW_API_PLATFORM_IF_OMITTED [moby/moby#36269](https://github.com/moby/moby/pull/36269)
* Revendor Microsoft/opengcs @ v0.3.6 [moby/moby#36108](https://github.com/moby/moby/pull/36108)
- Fix issue of ExitCode and PID not show up in Task.Status.ContainerStatus [moby/moby#36150](https://github.com/moby/moby/pull/36150)
- Fix issue with plugin scanner going too deep [moby/moby#36119](https://github.com/moby/moby/pull/36119)
* Do not make graphdriver homes private mounts [moby/moby#36047](https://github.com/moby/moby/pull/36047)
* Do not recursive unmount on cleanup of zfs/btrfs [moby/moby#36237](https://github.com/moby/moby/pull/36237)
* Don't restore image if layer does not exist [moby/moby#36304](https://github.com/moby/moby/pull/36304)
* Adjust minimum API version for templated configs/secrets [moby/moby#36366](https://github.com/moby/moby/pull/36366)
* Bump containerd to 1.0.2 (cfd04396dc68220d1cecbe686a6cc3aa5ce3667c) [moby/moby#36308](https://github.com/moby/moby/pull/36308)
* Bump Golang to 1.9.4 [moby/moby#36243](https://github.com/moby/moby/pull/36243)
* Ensure daemon root is unmounted on shutdown [moby/moby#36107](https://github.com/moby/moby/pull/36107)
- Fix container cleanup on daemon restart [moby/moby#36249](https://github.com/moby/moby/pull/36249)
* Support SCTP port mapping (bump up API to v1.37) [moby/moby#33922](https://github.com/moby/moby/pull/33922)
* Support SCTP port mapping [docker/cli#278](https://github.com/docker/cli/pull/278)
- Fix Volumes property definition in ContainerConfig [moby/moby#35946](https://github.com/moby/moby/pull/35946)
* Bump moby and dependencies [docker/cli#829](https://github.com/docker/cli/pull/829)
* C.RWLayer: check for nil before use [moby/moby#36242](https://github.com/moby/moby/pull/36242)
+ Add `REMOVE` and `ORPHANED` to TaskState [moby/moby#36146](https://github.com/moby/moby/pull/36146)
- Fixed error detection using `IsErrNotFound` and `IsErrNotImplemented` for `ContainerStatPath`, `CopyFromContainer`, and `CopyToContainer` methods [moby/moby#35979](https://github.com/moby/moby/pull/35979)
+ Add an integration/internal/container helper package [moby/moby#36266](https://github.com/moby/moby/pull/36266)
+ Add canonical import path [moby/moby#36194](https://github.com/moby/moby/pull/36194)
+ Add/use container.Exec() to integration [moby/moby#36326](https://github.com/moby/moby/pull/36326)
- Fix "--node-generic-resource" singular/plural [moby/moby#36125](https://github.com/moby/moby/pull/36125)
* Daemon.cleanupContainer: nullify container RWLayer upon release [moby/moby#36160](https://github.com/moby/moby/pull/36160)
* Daemon: passdown the `--oom-kill-disable` option to containerd [moby/moby#36201](https://github.com/moby/moby/pull/36201)
* Display a warn message when there is binding ports and net mode is host [moby/moby#35510](https://github.com/moby/moby/pull/35510)
* Refresh containerd remotes on containerd restarted [moby/moby#36173](https://github.com/moby/moby/pull/36173)
* Set daemon root to use shared propagation [moby/moby#36096](https://github.com/moby/moby/pull/36096)
* Optimizations for recursive unmount [moby/moby#34379](https://github.com/moby/moby/pull/34379)
* Perform plugin mounts in the runtime [moby/moby#35829](https://github.com/moby/moby/pull/35829)
* Graphdriver: Fix RefCounter memory leak [moby/moby#36256](https://github.com/moby/moby/pull/36256)
* Use continuity fs package for volume copy [moby/moby#36290](https://github.com/moby/moby/pull/36290)
* Use proc/exe for reexec [moby/moby#36124](https://github.com/moby/moby/pull/36124)
+ Add API support for templated secrets and configs [moby/moby#33702](https://github.com/moby/moby/pull/33702) and [moby/moby#36366](https://github.com/moby/moby/pull/36366)
* Use rslave propagation for mounts from daemon root [moby/moby#36055](https://github.com/moby/moby/pull/36055)
+ Add /proc/keys to masked paths [moby/moby#36368](https://github.com/moby/moby/pull/36368)
* Bump Runc to 1.0.0-rc5 [moby/moby#36449](https://github.com/moby/moby/pull/36449)
- Fixes `runc exec` on big-endian architectures [moby/moby#36449](https://github.com/moby/moby/pull/36449)
* Use chroot when mount namespaces aren't provided [moby/moby#36449](https://github.com/moby/moby/pull/36449)
- Fix systemd slice expansion so that it could be consumed by cAdvisor [moby/moby#36449](https://github.com/moby/moby/pull/36449)
- Fix devices mounted with wrong uid/gid [moby/moby#36449](https://github.com/moby/moby/pull/36449)
- Fix read-only containers with IPC private mounts `/dev/shm` read-only [moby/moby#36526](https://github.com/moby/moby/pull/36526)
### Swarm Mode
* Replace EC Private Key with PKCS#8 PEMs [docker/swarmkit#2246](https://github.com/docker/swarmkit/pull/2246)
* Fix IP overlap with empty EndpointSpec [docker/swarmkit #2505](https://github.com/docker/swarmkit/pull/2505)
* Add support for Support SCTP port mapping [docker/swarmkit#2298](https://github.com/docker/swarmkit/pull/2298)
* Do not reschedule tasks if only placement constraints change and are satisfied by the assigned node [docker/swarmkit#2496](https://github.com/docker/swarmkit/pull/2496)
* Ensure task reaper stopChan is closed no more than once [docker/swarmkit #2491](https://github.com/docker/swarmkit/pull/2491)
* Synchronization fixes [docker/swarmkit#2495](https://github.com/docker/swarmkit/pull/2495)
* Add log message to indicate message send retry if streaming unimplemented [docker/swarmkit#2483](https://github.com/docker/swarmkit/pull/2483)
* Debug logs for session, node events on dispatcher, heartbeats [docker/swarmkit#2486](https://github.com/docker/swarmkit/pull/2486)
+ Add swarm types to bash completion event type filter [docker/cli#888](https://github.com/docker/cli/pull/888)
- Fix issue where network inspect does not show Created time for networks in swarm scope [moby/moby#36095](https://github.com/moby/moby/pull/36095)

View File

@ -1 +1 @@
17.12.1-ce
18.03.1-ce

View File

@ -1,4 +1,12 @@
# if you want to ignore files created by your editor/tools,
# please consider a global .gitignore https://help.github.com/articles/ignoring-files
*.exe
*.exe~
*.orig
.*.swp
.DS_Store
Thumbs.db
.editorconfig
/build/
cli/winresources/rsrc_386.syso
cli/winresources/rsrc_amd64.syso

475
components/cli/.mailmap Normal file
View File

@ -0,0 +1,475 @@
# Generate AUTHORS: scripts/docs/generate-authors.sh
# Tip for finding duplicates (besides scanning the output of AUTHORS for name
# duplicates that aren't also email duplicates): scan the output of:
# git log --format='%aE - %aN' | sort -uf
#
# For explanation on this file format: man git-shortlog
Aaron L. Xu <liker.xu@foxmail.com>
Abhinandan Prativadi <abhi@docker.com>
Adrien Gallouët <adrien@gallouet.fr> <angt@users.noreply.github.com>
Ahmed Kamal <email.ahmedkamal@googlemail.com>
Ahmet Alp Balkan <ahmetb@microsoft.com> <ahmetalpbalkan@gmail.com>
AJ Bowen <aj@gandi.net>
AJ Bowen <aj@gandi.net> <amy@gandi.net>
Akihiro Matsushima <amatsusbit@gmail.com> <amatsus@users.noreply.github.com>
Akihiro Suda <suda.akihiro@lab.ntt.co.jp> <suda.kyoto@gmail.com>
Aleksa Sarai <asarai@suse.de>
Aleksa Sarai <asarai@suse.de> <asarai@suse.com>
Aleksa Sarai <asarai@suse.de> <cyphar@cyphar.com>
Aleksandrs Fadins <aleks@s-ko.net>
Alessandro Boch <aboch@tetrationanalytics.com> <aboch@docker.com>
Alex Chen <alexchenunix@gmail.com> <root@localhost.localdomain>
Alex Ellis <alexellis2@gmail.com>
Alexander Larsson <alexl@redhat.com> <alexander.larsson@gmail.com>
Alexander Morozov <lk4d4@docker.com>
Alexander Morozov <lk4d4@docker.com> <lk4d4math@gmail.com>
Alexandre Beslic <alexandre.beslic@gmail.com> <abronan@docker.com>
Alicia Lauerman <alicia@eta.im> <allydevour@me.com>
Allen Sun <allensun.shl@alibaba-inc.com> <allen.sun@daocloud.io>
Allen Sun <allensun.shl@alibaba-inc.com> <shlallen1990@gmail.com>
Andrew Weiss <andrew.weiss@docker.com> <andrew.weiss@microsoft.com>
Andrew Weiss <andrew.weiss@docker.com> <andrew.weiss@outlook.com>
André Martins <aanm90@gmail.com> <martins@noironetworks.com>
Andy Rothfusz <github@developersupport.net> <github@metaliveblog.com>
Andy Smith <github@anarkystic.com>
Ankush Agarwal <ankushagarwal11@gmail.com> <ankushagarwal@users.noreply.github.com>
Antonio Murdaca <antonio.murdaca@gmail.com> <amurdaca@redhat.com>
Antonio Murdaca <antonio.murdaca@gmail.com> <me@runcom.ninja>
Antonio Murdaca <antonio.murdaca@gmail.com> <runcom@linux.com>
Antonio Murdaca <antonio.murdaca@gmail.com> <runcom@redhat.com>
Antonio Murdaca <antonio.murdaca@gmail.com> <runcom@users.noreply.github.com>
Anuj Bahuguna <anujbahuguna.dev@gmail.com>
Anuj Bahuguna <anujbahuguna.dev@gmail.com> <abahuguna@fiberlink.com>
Anusha Ragunathan <anusha.ragunathan@docker.com> <anusha@docker.com>
Arnaud Porterie <arnaud.porterie@docker.com>
Arnaud Porterie <arnaud.porterie@docker.com> <icecrime@gmail.com>
Arthur Gautier <baloo@gandi.net> <superbaloo+registrations.github@superbaloo.net>
Avi Miller <avi.miller@oracle.com> <avi.miller@gmail.com>
Ben Bonnefoy <frenchben@docker.com>
Ben Golub <ben.golub@dotcloud.com>
Ben Toews <mastahyeti@gmail.com> <mastahyeti@users.noreply.github.com>
Benoit Chesneau <bchesneau@gmail.com>
Bhiraj Butala <abhiraj.butala@gmail.com>
Bhumika Bayani <bhumikabayani@gmail.com>
Bilal Amarni <bilal.amarni@gmail.com> <bamarni@users.noreply.github.com>
Bill Wang <ozbillwang@gmail.com> <SydOps@users.noreply.github.com>
Bin Liu <liubin0329@gmail.com>
Bin Liu <liubin0329@gmail.com> <liubin0329@users.noreply.github.com>
Bingshen Wang <bingshen.wbs@alibaba-inc.com>
Boaz Shuster <ripcurld.github@gmail.com>
Brandon Philips <brandon.philips@coreos.com> <brandon@ifup.co>
Brandon Philips <brandon.philips@coreos.com> <brandon@ifup.org>
Brent Salisbury <brent.salisbury@docker.com> <brent@docker.com>
Brian Goff <cpuguy83@gmail.com>
Brian Goff <cpuguy83@gmail.com> <bgoff@cpuguy83-mbp.home>
Brian Goff <cpuguy83@gmail.com> <bgoff@cpuguy83-mbp.local>
Chander Govindarajan <chandergovind@gmail.com>
Chao Wang <wangchao.fnst@cn.fujitsu.com> <chaowang@localhost.localdomain>
Charles Hooper <charles.hooper@dotcloud.com> <chooper@plumata.com>
Chen Chao <cc272309126@gmail.com>
Chen Chuanliang <chen.chuanliang@zte.com.cn>
Chen Mingjie <chenmingjie0828@163.com>
Chen Qiu <cheney-90@hotmail.com>
Chen Qiu <cheney-90@hotmail.com> <21321229@zju.edu.cn>
Chris Dias <cdias@microsoft.com>
Chris McKinnel <chris.mckinnel@tangentlabs.co.uk>
Christopher Biscardi <biscarch@sketcht.com>
Christopher Latham <sudosurootdev@gmail.com>
Chun Chen <ramichen@tencent.com> <chenchun.feed@gmail.com>
Corbin Coleman <corbin.coleman@docker.com>
Cristian Staretu <cristian.staretu@gmail.com>
Cristian Staretu <cristian.staretu@gmail.com> <unclejack@users.noreply.github.com>
Cristian Staretu <cristian.staretu@gmail.com> <unclejacksons@gmail.com>
CUI Wei <ghostplant@qq.com> cuiwei13 <cuiwei13@pku.edu.cn>
Daehyeok Mun <daehyeok@gmail.com>
Daehyeok Mun <daehyeok@gmail.com> <daehyeok@daehyeok-ui-MacBook-Air.local>
Daehyeok Mun <daehyeok@gmail.com> <daehyeok@daehyeokui-MacBook-Air.local>
Dan Feldman <danf@jfrog.com>
Daniel Dao <dqminh@cloudflare.com>
Daniel Dao <dqminh@cloudflare.com> <dqminh89@gmail.com>
Daniel Garcia <daniel@danielgarcia.info>
Daniel Gasienica <daniel@gasienica.ch> <dgasienica@zynga.com>
Daniel Goosen <daniel.goosen@surveysampling.com> <djgoosen@users.noreply.github.com>
Daniel Grunwell <mwgrunny@gmail.com>
Daniel J Walsh <dwalsh@redhat.com>
Daniel Mizyrycki <daniel.mizyrycki@dotcloud.com> <daniel@dotcloud.com>
Daniel Mizyrycki <daniel.mizyrycki@dotcloud.com> <mzdaniel@glidelink.net>
Daniel Mizyrycki <daniel.mizyrycki@dotcloud.com> <root@vagrant-ubuntu-12.10.vagrantup.com>
Daniel Nephin <dnephin@docker.com> <dnephin@gmail.com>
Daniel Norberg <dano@spotify.com> <daniel.norberg@gmail.com>
Daniel Watkins <daniel@daniel-watkins.co.uk>
Danny Yates <danny@codeaholics.org> <Danny.Yates@mailonline.co.uk>
Darren Shepherd <darren.s.shepherd@gmail.com> <darren@rancher.com>
Dattatraya Kumbhar <dattatraya.kumbhar@gslab.com>
Dave Goodchild <buddhamagnet@gmail.com>
Dave Henderson <dhenderson@gmail.com> <Dave.Henderson@ca.ibm.com>
Dave Tucker <dt@docker.com> <dave@dtucker.co.uk>
David M. Karr <davidmichaelkarr@gmail.com>
David Sheets <dsheets@docker.com> <sheets@alum.mit.edu>
David Sissitka <me@dsissitka.com>
David Williamson <david.williamson@docker.com> <davidwilliamson@users.noreply.github.com>
Deshi Xiao <dxiao@redhat.com> <dsxiao@dataman-inc.com>
Deshi Xiao <dxiao@redhat.com> <xiaods@gmail.com>
Diego Siqueira <dieg0@live.com>
Diogo Monica <diogo@docker.com> <diogo.monica@gmail.com>
Dominik Honnef <dominik@honnef.co> <dominikh@fork-bomb.org>
Doug Davis <dug@us.ibm.com> <duglin@users.noreply.github.com>
Doug Tangren <d.tangren@gmail.com>
Elan Ruusamäe <glen@pld-linux.org>
Elan Ruusamäe <glen@pld-linux.org> <glen@delfi.ee>
Eric G. Noriega <enoriega@vizuri.com> <egnoriega@users.noreply.github.com>
Eric Hanchrow <ehanchrow@ine.com> <eric.hanchrow@gmail.com>
Eric Rosenberg <ehaydenr@gmail.com> <ehaydenr@users.noreply.github.com>
Erica Windisch <erica@windisch.us> <eric@windisch.us>
Erica Windisch <erica@windisch.us> <ewindisch@docker.com>
Erik Hollensbe <github@hollensbe.org> <erik+github@hollensbe.org>
Erwin van der Koogh <info@erronis.nl>
Euan Kemp <euan.kemp@coreos.com> <euank@amazon.com>
Eugen Krizo <eugen.krizo@gmail.com>
Evan Hazlett <ejhazlett@gmail.com> <ehazlett@users.noreply.github.com>
Evelyn Xu <evelynhsu21@gmail.com>
Evgeny Shmarnev <shmarnev@gmail.com>
Faiz Khan <faizkhan00@gmail.com>
Felix Hupfeld <felix@quobyte.com> <quofelix@users.noreply.github.com>
Felix Ruess <felix.ruess@gmail.com> <felix.ruess@roboception.de>
Feng Yan <fy2462@gmail.com>
Fengtu Wang <wangfengtu@huawei.com> <wangfengtu@huawei.com>
Francisco Carriedo <fcarriedo@gmail.com>
Frank Rosquin <frank.rosquin+github@gmail.com> <frank.rosquin@gmail.com>
Frederick F. Kautz IV <fkautz@redhat.com> <fkautz@alumni.cmu.edu>
Gabriel Nicolas Avellaneda <avellaneda.gabriel@gmail.com>
Gaetan de Villele <gdevillele@gmail.com>
Gang Qiao <qiaohai8866@gmail.com> <1373319223@qq.com>
George Kontridze <george@bugsnag.com>
Gerwim Feiken <g.feiken@tfe.nl> <gerwim@gmail.com>
Giampaolo Mancini <giampaolo@trampolineup.com>
Gopikannan Venugopalsamy <gopikannan.venugopalsamy@gmail.com>
Gou Rao <gou@portworx.com> <gourao@users.noreply.github.com>
Greg Stephens <greg@udon.org>
Guillaume J. Charmes <guillaume.charmes@docker.com> <charmes.guillaume@gmail.com>
Guillaume J. Charmes <guillaume.charmes@docker.com> <guillaume.charmes@dotcloud.com>
Guillaume J. Charmes <guillaume.charmes@docker.com> <guillaume@charmes.net>
Guillaume J. Charmes <guillaume.charmes@docker.com> <guillaume@docker.com>
Guillaume J. Charmes <guillaume.charmes@docker.com> <guillaume@dotcloud.com>
Gurjeet Singh <gurjeet@singh.im> <singh.gurjeet@gmail.com>
Gustav Sinder <gustav.sinder@gmail.com>
Günther Jungbluth <gunther@gameslabs.net>
Hakan Özler <hakan.ozler@kodcu.com>
Hao Shu Wei <haosw@cn.ibm.com>
Hao Shu Wei <haosw@cn.ibm.com> <haoshuwei1989@163.com>
Harald Albers <github@albersweb.de> <albers@users.noreply.github.com>
Harold Cooper <hrldcpr@gmail.com>
Harry Zhang <harryz@hyper.sh> <harryzhang@zju.edu.cn>
Harry Zhang <harryz@hyper.sh> <resouer@163.com>
Harry Zhang <harryz@hyper.sh> <resouer@gmail.com>
Harry Zhang <resouer@163.com>
Harshal Patil <harshal.patil@in.ibm.com> <harche@users.noreply.github.com>
Helen Xie <chenjg@harmonycloud.cn>
Hollie Teal <hollie@docker.com>
Hollie Teal <hollie@docker.com> <hollie.teal@docker.com>
Hollie Teal <hollie@docker.com> <hollietealok@users.noreply.github.com>
Hu Keping <hukeping@huawei.com>
Huu Nguyen <huu@prismskylabs.com> <whoshuu@gmail.com>
Hyzhou Zhy <hyzhou.zhy@alibaba-inc.com>
Hyzhou Zhy <hyzhou.zhy@alibaba-inc.com> <1187766782@qq.com>
Ilya Khlopotov <ilya.khlopotov@gmail.com>
Jack Laxson <jackjrabbit@gmail.com>
Jacob Atzen <jacob@jacobatzen.dk> <jatzen@gmail.com>
Jacob Tomlinson <jacob@tom.linson.uk> <jacobtomlinson@users.noreply.github.com>
Jaivish Kothari <janonymous.codevulture@gmail.com>
Jamie Hannaford <jamie@limetree.org> <jamie.hannaford@rackspace.com>
Jean-Baptiste Barth <jeanbaptiste.barth@gmail.com>
Jean-Baptiste Dalido <jeanbaptiste@appgratis.com>
Jean-Tiare Le Bigot <jt@yadutaf.fr> <admin@jtlebi.fr>
Jeff Anderson <jeff@docker.com> <jefferya@programmerq.net>
Jeff Nickoloff <jeff.nickoloff@gmail.com> <jeff@allingeek.com>
Jeroen Franse <jeroenfranse@gmail.com>
Jessica Frazelle <jessfraz@google.com>
Jessica Frazelle <jessfraz@google.com> <acidburn@docker.com>
Jessica Frazelle <jessfraz@google.com> <acidburn@google.com>
Jessica Frazelle <jessfraz@google.com> <jess@docker.com>
Jessica Frazelle <jessfraz@google.com> <jess@mesosphere.com>
Jessica Frazelle <jessfraz@google.com> <jfrazelle@users.noreply.github.com>
Jessica Frazelle <jessfraz@google.com> <me@jessfraz.com>
Jessica Frazelle <jessfraz@google.com> <princess@docker.com>
Jim Galasyn <jim.galasyn@docker.com>
Jiuyue Ma <majiuyue@huawei.com>
Joey Geiger <jgeiger@gmail.com>
Joffrey F <joffrey@docker.com>
Joffrey F <joffrey@docker.com> <f.joffrey@gmail.com>
Joffrey F <joffrey@docker.com> <joffrey@dotcloud.com>
Johan Euphrosine <proppy@google.com> <proppy@aminche.com>
John Harris <john@johnharris.io>
John Howard (VM) <John.Howard@microsoft.com>
John Howard (VM) <John.Howard@microsoft.com> <jhoward@microsoft.com>
John Howard (VM) <John.Howard@microsoft.com> <jhoward@ntdev.microsoft.com>
John Howard (VM) <John.Howard@microsoft.com> <jhowardmsft@users.noreply.github.com>
John Howard (VM) <John.Howard@microsoft.com> <john.howard@microsoft.com>
John Stephens <johnstep@docker.com> <johnstep@users.noreply.github.com>
Jordan Arentsen <blissdev@gmail.com>
Jordan Jennings <jjn2009@gmail.com> <jjn2009@users.noreply.github.com>
Jorit Kleine-Möllhoff <joppich@bricknet.de> <joppich@users.noreply.github.com>
Jose Diaz-Gonzalez <jose@seatgeek.com> <josegonzalez@users.noreply.github.com>
Josh Eveleth <joshe@opendns.com> <jeveleth@users.noreply.github.com>
Josh Hawn <josh.hawn@docker.com> <jlhawn@berkeley.edu>
Josh Horwitz <horwitz@addthis.com> <horwitzja@gmail.com>
Josh Soref <jsoref@gmail.com> <jsoref@users.noreply.github.com>
Josh Wilson <josh.wilson@fivestars.com> <jcwilson@users.noreply.github.com>
Joyce Jang <mail@joycejang.com>
Julien Bordellier <julienbordellier@gmail.com> <git@julienbordellier.com>
Julien Bordellier <julienbordellier@gmail.com> <me@julienbordellier.com>
Justin Cormack <justin.cormack@docker.com>
Justin Cormack <justin.cormack@docker.com> <justin.cormack@unikernel.com>
Justin Cormack <justin.cormack@docker.com> <justin@specialbusservice.com>
Justin Simonelis <justin.p.simonelis@gmail.com> <justin.simonelis@PTS-JSIMON2.toronto.exclamation.com>
Jérôme Petazzoni <jerome.petazzoni@docker.com> <jerome.petazzoni@dotcloud.com>
Jérôme Petazzoni <jerome.petazzoni@docker.com> <jerome.petazzoni@gmail.com>
Jérôme Petazzoni <jerome.petazzoni@docker.com> <jp@enix.org>
K. Heller <pestophagous@gmail.com> <pestophagous@users.noreply.github.com>
Kai Qiang Wu (Kennan) <wkq5325@gmail.com>
Kai Qiang Wu (Kennan) <wkq5325@gmail.com> <wkqwu@cn.ibm.com>
Kamil Domański <kamil@domanski.co>
Kamjar Gerami <kami.gerami@gmail.com>
Kat Samperi <kat.samperi@gmail.com> <kizzie@users.noreply.github.com>
Ken Cochrane <kencochrane@gmail.com> <KenCochrane@gmail.com>
Ken Herner <kherner@progress.com> <chosenken@gmail.com>
Kenfe-Mickaël Laventure <mickael.laventure@gmail.com>
Kevin Feyrer <kevin.feyrer@btinternet.com> <kevinfeyrer@users.noreply.github.com>
Kevin Kern <kaiwentan@harmonycloud.cn>
Kevin Meredith <kevin.m.meredith@gmail.com>
Kir Kolyshkin <kolyshkin@gmail.com>
Kir Kolyshkin <kolyshkin@gmail.com> <kir@openvz.org>
Kir Kolyshkin <kolyshkin@gmail.com> <kolyshkin@users.noreply.github.com>
Konrad Kleine <konrad.wilhelm.kleine@gmail.com> <kwk@users.noreply.github.com>
Konstantin Gribov <grossws@gmail.com>
Konstantin Pelykh <kpelykh@zettaset.com>
Kotaro Yoshimatsu <kotaro.yoshimatsu@gmail.com>
Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp> <kunal.kushwaha@gmail.com>
Lajos Papp <lajos.papp@sequenceiq.com> <lalyos@yahoo.com>
Lei Jitang <leijitang@huawei.com>
Lei Jitang <leijitang@huawei.com> <leijitang@gmail.com>
Liang Mingqiang <mqliang.zju@gmail.com>
Liang-Chi Hsieh <viirya@gmail.com>
Liao Qingwei <liaoqingwei@huawei.com>
Linus Heckemann <lheckemann@twig-world.com>
Linus Heckemann <lheckemann@twig-world.com> <anonymouse2048@gmail.com>
Lokesh Mandvekar <lsm5@fedoraproject.org> <lsm5@redhat.com>
Lorenzo Fontana <lo@linux.com> <fontanalorenzo@me.com>
Louis Opter <kalessin@kalessin.fr>
Louis Opter <kalessin@kalessin.fr> <louis@dotcloud.com>
Luca Favatella <luca.favatella@erlang-solutions.com> <lucafavatella@users.noreply.github.com>
Luke Marsden <me@lukemarsden.net> <luke@digital-crocus.com>
Lyn <energylyn@zju.edu.cn>
Lynda O'Leary <lyndaoleary29@gmail.com>
Lynda O'Leary <lyndaoleary29@gmail.com> <lyndaoleary@hotmail.com>
Ma Müller <mueller-ma@users.noreply.github.com>
Madhan Raj Mookkandy <MadhanRaj.Mookkandy@microsoft.com> <madhanm@microsoft.com>
Madhu Venugopal <madhu@socketplane.io> <madhu@docker.com>
Mageee <fangpuyi@foxmail.com> <21521230.zju.edu.cn>
Mansi Nahar <mmn4185@rit.edu> <mansi.nahar@macbookpro-mansinahar.local>
Mansi Nahar <mmn4185@rit.edu> <mansinahar@users.noreply.github.com>
Marc Abramowitz <marc@marc-abramowitz.com> <msabramo@gmail.com>
Marcelo Horacio Fortino <info@fortinux.com> <fortinux@users.noreply.github.com>
Marcus Linke <marcus.linke@gmx.de>
Marianna Tessel <mtesselh@gmail.com>
Mark Oates <fl0yd@me.com>
Markan Patel <mpatel678@gmail.com>
Markus Kortlang <hyp3rdino@googlemail.com> <markus.kortlang@lhsystems.com>
Martin Redmond <redmond.martin@gmail.com> <martin@tinychat.com>
Martin Redmond <redmond.martin@gmail.com> <xgithub@redmond5.com>
Mary Anthony <mary.anthony@docker.com> <mary@docker.com>
Mary Anthony <mary.anthony@docker.com> <moxieandmore@gmail.com>
Mary Anthony <mary.anthony@docker.com> moxiegirl <mary@docker.com>
Mateusz Major <apkd@users.noreply.github.com>
Matt Bentley <matt.bentley@docker.com> <mbentley@mbentley.net>
Matt Schurenko <matt.schurenko@gmail.com>
Matt Williams <mattyw@me.com>
Matt Williams <mattyw@me.com> <gh@mattyw.net>
Matthew Heon <mheon@redhat.com> <mheon@mheonlaptop.redhat.com>
Matthew Mosesohn <raytrac3r@gmail.com>
Matthew Mueller <mattmuelle@gmail.com>
Matthias Kühnle <git.nivoc@neverbox.com> <kuehnle@online.de>
Mauricio Garavaglia <mauricio@medallia.com> <mauriciogaravaglia@gmail.com>
Michael Crosby <michael@docker.com> <crosby.michael@gmail.com>
Michael Crosby <michael@docker.com> <crosbymichael@gmail.com>
Michael Crosby <michael@docker.com> <michael@crosbymichael.com>
Michael Hudson-Doyle <michael.hudson@canonical.com> <michael.hudson@linaro.org>
Michael Huettermann <michael@huettermann.net>
Michael Käufl <docker@c.michael-kaeufl.de> <michael-k@users.noreply.github.com>
Michael Spetsiotis <michael_spets@hotmail.com>
Michal Minář <miminar@redhat.com>
Miguel Angel Alvarez Cabrerizo <doncicuto@gmail.com> <30386061+doncicuto@users.noreply.github.com>
Miguel Angel Fernández <elmendalerenda@gmail.com>
Mihai Borobocea <MihaiBorob@gmail.com> <MihaiBorobocea@gmail.com>
Mike Casas <mkcsas0@gmail.com> <mikecasas@users.noreply.github.com>
Mike Goelzer <mike.goelzer@docker.com> <mgoelzer@docker.com>
Milind Chawre <milindchawre@gmail.com>
Misty Stanley-Jones <misty@docker.com> <misty@apache.org>
Mohit Soni <mosoni@ebay.com> <mohitsoni1989@gmail.com>
Moorthy RS <rsmoorthy@gmail.com> <rsmoorthy@users.noreply.github.com>
Moysés Borges <moysesb@gmail.com>
Moysés Borges <moysesb@gmail.com> <moyses.furtado@wplex.com.br>
Nace Oroz <orkica@gmail.com>
Nathan LeClaire <nathan.leclaire@docker.com> <nathan.leclaire@gmail.com>
Nathan LeClaire <nathan.leclaire@docker.com> <nathanleclaire@gmail.com>
Neil Horman <nhorman@tuxdriver.com> <nhorman@hmswarspite.think-freely.org>
Nick Russo <nicholasjamesrusso@gmail.com> <nicholasrusso@icloud.com>
Nicolas Borboën <ponsfrilus@gmail.com> <ponsfrilus@users.noreply.github.com>
Nigel Poulton <nigelpoulton@hotmail.com>
Nik Nyby <nikolas@gnu.org> <nnyby@columbia.edu>
Nolan Darilek <nolan@thewordnerd.info>
O.S. Tezer <ostezer@gmail.com>
O.S. Tezer <ostezer@gmail.com> <ostezer@users.noreply.github.com>
Oh Jinkyun <tintypemolly@gmail.com> <tintypemolly@Ohui-MacBook-Pro.local>
Ouyang Liduo <oyld0210@163.com>
Patrick Stapleton <github@gdi2290.com>
Paul Liljenberg <liljenberg.paul@gmail.com> <letters@paulnotcom.se>
Pavel Tikhomirov <ptikhomirov@virtuozzo.com> <ptikhomirov@parallels.com>
Pawel Konczalski <mail@konczalski.de>
Peter Choi <phkchoi89@gmail.com> <reikani@Peters-MacBook-Pro.local>
Peter Dave Hello <hsu@peterdavehello.org> <PeterDaveHello@users.noreply.github.com>
Peter Jaffe <pjaffe@nevo.com>
Peter Nagy <xificurC@gmail.com> <pnagy@gratex.com>
Peter Waller <p@pwaller.net> <peter@scraperwiki.com>
Phil Estes <estesp@linux.vnet.ibm.com> <estesp@gmail.com>
Philip Alexander Etling <paetling@gmail.com>
Philipp Gillé <philipp.gille@gmail.com> <philippgille@users.noreply.github.com>
Qiang Huang <h.huangqiang@huawei.com>
Qiang Huang <h.huangqiang@huawei.com> <qhuang@10.0.2.15>
Ray Tsang <rayt@google.com> <saturnism@users.noreply.github.com>
Renaud Gaubert <rgaubert@nvidia.com> <renaud.gaubert@gmail.com>
Robert Terhaar <rterhaar@atlanticdynamic.com> <robbyt@users.noreply.github.com>
Roberto G. Hashioka <roberto.hashioka@docker.com> <roberto_hashioka@hotmail.com>
Roberto Muñoz Fernández <robertomf@gmail.com> <roberto.munoz.fernandez.contractor@bbva.com>
Roman Dudin <katrmr@gmail.com> <decadent@users.noreply.github.com>
Ross Boucher <rboucher@gmail.com>
Runshen Zhu <runshen.zhu@gmail.com>
Ryan Stelly <ryan.stelly@live.com>
Sakeven Jiang <jc5930@sina.cn>
Sandeep Bansal <sabansal@microsoft.com>
Sandeep Bansal <sabansal@microsoft.com> <msabansal@microsoft.com>
Sargun Dhillon <sargun@netflix.com> <sargun@sargun.me>
Sean Lee <seanlee@tw.ibm.com> <scaleoutsean@users.noreply.github.com>
Sebastiaan van Stijn <github@gone.nl> <sebastiaan@ws-key-sebas3.dpi1.dpi>
Sebastiaan van Stijn <github@gone.nl> <thaJeztah@users.noreply.github.com>
Shaun Kaasten <shaunk@gmail.com>
Shawn Landden <shawn@churchofgit.com> <shawnlandden@gmail.com>
Shengbo Song <thomassong@tencent.com>
Shengbo Song <thomassong@tencent.com> <mymneo@163.com>
Shih-Yuan Lee <fourdollars@gmail.com>
Shishir Mahajan <shishir.mahajan@redhat.com> <smahajan@redhat.com>
Shukui Yang <yangshukui@huawei.com>
Shuwei Hao <haosw@cn.ibm.com>
Shuwei Hao <haosw@cn.ibm.com> <haoshuwei24@gmail.com>
Sidhartha Mani <sidharthamn@gmail.com>
Sjoerd Langkemper <sjoerd-github@linuxonly.nl> <sjoerd@byte.nl>
Solomon Hykes <solomon@docker.com> <s@docker.com>
Solomon Hykes <solomon@docker.com> <solomon.hykes@dotcloud.com>
Solomon Hykes <solomon@docker.com> <solomon@dotcloud.com>
Soshi Katsuta <soshi.katsuta@gmail.com>
Soshi Katsuta <soshi.katsuta@gmail.com> <katsuta_soshi@cyberagent.co.jp>
Sridhar Ratnakumar <sridharr@activestate.com>
Sridhar Ratnakumar <sridharr@activestate.com> <github@srid.name>
Srini Brahmaroutu <srbrahma@us.ibm.com> <sbrahma@us.ibm.com>
Srinivasan Srivatsan <srinivasan.srivatsan@hpe.com> <srinsriv@users.noreply.github.com>
Stefan Berger <stefanb@linux.vnet.ibm.com>
Stefan Berger <stefanb@linux.vnet.ibm.com> <stefanb@us.ibm.com>
Stefan J. Wernli <swernli@microsoft.com> <swernli@ntdev.microsoft.com>
Stefan S. <tronicum@user.github.com>
Stephen Day <stephen.day@docker.com>
Stephen Day <stephen.day@docker.com> <stevvooe@users.noreply.github.com>
Steve Desmond <steve@vtsv.ca> <stevedesmond-ca@users.noreply.github.com>
Sun Gengze <690388648@qq.com>
Sun Jianbo <wonderflow.sun@gmail.com>
Sun Jianbo <wonderflow.sun@gmail.com> <wonderflow@zju.edu.cn>
Sven Dowideit <SvenDowideit@home.org.au>
Sven Dowideit <SvenDowideit@home.org.au> <sven@t440s.home.gateway>
Sven Dowideit <SvenDowideit@home.org.au> <SvenDowideit@docker.com>
Sven Dowideit <SvenDowideit@home.org.au> <SvenDowideit@fosiki.com>
Sven Dowideit <SvenDowideit@home.org.au> <SvenDowideit@home.org.au>
Sven Dowideit <SvenDowideit@home.org.au> <SvenDowideit@users.noreply.github.com>
Sven Dowideit <SvenDowideit@home.org.au> <¨SvenDowideit@home.org.au¨>
Sylvain Bellemare <sylvain@ascribe.io>
Sylvain Bellemare <sylvain@ascribe.io> <sylvain.bellemare@ezeep.com>
Tangi Colin <tangicolin@gmail.com>
Tejesh Mehta <tejesh.mehta@gmail.com> <tj@init.me>
Thatcher Peskens <thatcher@docker.com>
Thatcher Peskens <thatcher@docker.com> <thatcher@dotcloud.com>
Thatcher Peskens <thatcher@docker.com> <thatcher@gmx.net>
Thomas Gazagnaire <thomas@gazagnaire.org> <thomas@gazagnaire.com>
Thomas Krzero <thomas.kovatchitch@gmail.com>
Thomas Léveil <thomasleveil@gmail.com>
Thomas Léveil <thomasleveil@gmail.com> <thomasleveil@users.noreply.github.com>
Tibor Vass <teabee89@gmail.com> <tibor@docker.com>
Tibor Vass <teabee89@gmail.com> <tiborvass@users.noreply.github.com>
Tim Bart <tim@fewagainstmany.com>
Tim Bosse <taim@bosboot.org> <maztaim@users.noreply.github.com>
Tim Ruffles <oi@truffles.me.uk> <timruffles@googlemail.com>
Tim Terhorst <mynamewastaken+git@gmail.com>
Tim Zju <21651152@zju.edu.cn>
Timothy Hobbs <timothyhobbs@seznam.cz>
Toli Kuznets <toli@docker.com>
Tom Barlow <tomwbarlow@gmail.com>
Tom Sweeney <tsweeney@redhat.com>
Tõnis Tiigi <tonistiigi@gmail.com>
Trishna Guha <trishnaguha17@gmail.com>
Tristan Carel <tristan@cogniteev.com>
Tristan Carel <tristan@cogniteev.com> <tristan.carel@gmail.com>
Umesh Yadav <umesh4257@gmail.com>
Umesh Yadav <umesh4257@gmail.com> <dungeonmaster18@users.noreply.github.com>
Victor Lyuboslavsky <victor@victoreda.com>
Victor Vieux <victor.vieux@docker.com> <dev@vvieux.com>
Victor Vieux <victor.vieux@docker.com> <victor.vieux@dotcloud.com>
Victor Vieux <victor.vieux@docker.com> <victor@docker.com>
Victor Vieux <victor.vieux@docker.com> <victor@dotcloud.com>
Victor Vieux <victor.vieux@docker.com> <victorvieux@gmail.com>
Victor Vieux <victor.vieux@docker.com> <vieux@docker.com>
Viktor Vojnovski <viktor.vojnovski@amadeus.com> <vojnovski@gmail.com>
Vincent Batts <vbatts@redhat.com> <vbatts@hashbangbash.com>
Vincent Bernat <Vincent.Bernat@exoscale.ch> <bernat@luffy.cx>
Vincent Bernat <Vincent.Bernat@exoscale.ch> <vincent@bernat.im>
Vincent Demeester <vincent.demeester@docker.com> <vincent+github@demeester.fr>
Vincent Demeester <vincent.demeester@docker.com> <vincent@demeester.fr>
Vincent Demeester <vincent.demeester@docker.com> <vincent@sbr.pm>
Vishnu Kannan <vishnuk@google.com>
Vladimir Rutsky <altsysrq@gmail.com> <iamironbob@gmail.com>
Walter Stanish <walter@pratyeka.org>
Wang Guoliang <liangcszzu@163.com>
Wang Jie <wangjie5@chinaskycloud.com>
Wang Ping <present.wp@icloud.com>
Wang Xing <hzwangxing@corp.netease.com> <root@localhost>
Wang Yuexiao <wang.yuexiao@zte.com.cn>
Wayne Chang <wayne@neverfear.org>
Wayne Song <wsong@docker.com> <wsong@users.noreply.github.com>
Wei Wu <wuwei4455@gmail.com> cizixs <cizixs@163.com>
Wenjun Tang <tangwj2@lenovo.com> <dodia@163.com>
Wewang Xiaorenfine <wang.xiaoren@zte.com.cn>
Will Weaver <monkey@buildingbananas.com>
Xianglin Gao <xlgao@zju.edu.cn>
Xianlu Bird <xianlubird@gmail.com>
Xiaoyu Zhang <zhang.xiaoyu33@zte.com.cn>
Xuecong Liao <satorulogic@gmail.com>
Yamasaki Masahide <masahide.y@gmail.com>
Yao Zaiyong <yaozaiyong@hotmail.com>
Yassine Tijani <yasstij11@gmail.com>
Yazhong Liu <yorkiefixer@gmail.com>
Yestin Sun <sunyi0804@gmail.com> <yestin.sun@polyera.com>
Yi EungJun <eungjun.yi@navercorp.com> <semtlenori@gmail.com>
Ying Li <ying.li@docker.com>
Ying Li <ying.li@docker.com> <cyli@twistedmatrix.com>
Yong Tang <yong.tang.github@outlook.com> <yongtang@users.noreply.github.com>
Yosef Fertel <yfertel@gmail.com> <frosforever@users.noreply.github.com>
Yu Changchun <yuchangchun1@huawei.com>
Yu Chengxia <yuchengxia@huawei.com>
Yu Peng <yu.peng36@zte.com.cn>
Yu Peng <yu.peng36@zte.com.cn> <yupeng36@zte.com.cn>
Zachary Jaffee <zjaffee@us.ibm.com> <zij@case.edu>
Zachary Jaffee <zjaffee@us.ibm.com> <zjaffee@apache.org>
ZhangHang <stevezhang2014@gmail.com>
Zhenkun Bi <bi.zhenkun@zte.com.cn>
Zhou Hao <zhouhao@cn.fujitsu.com>
Zhu Kunjia <zhu.kunjia@zte.com.cn>
Zou Yu <zouyu7@huawei.com>

638
components/cli/AUTHORS Normal file
View File

@ -0,0 +1,638 @@
# This file lists all individuals having contributed content to the repository.
# For how it is generated, see `scripts/docs/generate-authors.sh`.
Aanand Prasad <aanand.prasad@gmail.com>
Aaron L. Xu <liker.xu@foxmail.com>
Aaron Lehmann <aaron.lehmann@docker.com>
Aaron.L.Xu <likexu@harmonycloud.cn>
Abdur Rehman <abdur_rehman@mentor.com>
Abhinandan Prativadi <abhi@docker.com>
Abin Shahab <ashahab@altiscale.com>
Addam Hardy <addam.hardy@gmail.com>
Adolfo Ochagavía <aochagavia92@gmail.com>
Adrien Duermael <adrien@duermael.com>
Adrien Folie <folie.adrien@gmail.com>
Ahmet Alp Balkan <ahmetb@microsoft.com>
Aidan Feldman <aidan.feldman@gmail.com>
Aidan Hobson Sayers <aidanhs@cantab.net>
AJ Bowen <aj@gandi.net>
Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Akim Demaille <akim.demaille@docker.com>
Alan Thompson <cloojure@gmail.com>
Albert Callarisa <shark234@gmail.com>
Aleksa Sarai <asarai@suse.de>
Alessandro Boch <aboch@tetrationanalytics.com>
Alex Mavrogiannis <alex.mavrogiannis@docker.com>
Alexander Boyd <alex@opengroove.org>
Alexander Larsson <alexl@redhat.com>
Alexander Morozov <lk4d4@docker.com>
Alexandre González <agonzalezro@gmail.com>
Alfred Landrum <alfred.landrum@docker.com>
Alicia Lauerman <alicia@eta.im>
Allen Sun <allensun.shl@alibaba-inc.com>
Alvin Deng <alvin.q.deng@utexas.edu>
Amen Belayneh <amenbelayneh@gmail.com>
Amir Goldstein <amir73il@aquasec.com>
Amit Krishnan <amit.krishnan@oracle.com>
Amit Shukla <amit.shukla@docker.com>
Amy Lindburg <amy.lindburg@docker.com>
Andrea Luzzardi <aluzzardi@gmail.com>
Andreas Köhler <andi5.py@gmx.net>
Andrew France <andrew@avito.co.uk>
Andrew Hsu <andrewhsu@docker.com>
Andrew Macpherson <hopscotch23@gmail.com>
Andrew McDonnell <bugs@andrewmcdonnell.net>
Andrew Po <absourd.noise@gmail.com>
Andrey Petrov <andrey.petrov@shazow.net>
André Martins <aanm90@gmail.com>
Andy Goldstein <agoldste@redhat.com>
Andy Rothfusz <github@developersupport.net>
Anil Madhavapeddy <anil@recoil.org>
Ankush Agarwal <ankushagarwal11@gmail.com>
Anton Polonskiy <anton.polonskiy@gmail.com>
Antonio Murdaca <antonio.murdaca@gmail.com>
Antonis Kalipetis <akalipetis@gmail.com>
Anusha Ragunathan <anusha.ragunathan@docker.com>
Arash Deshmeh <adeshmeh@ca.ibm.com>
Arnaud Porterie <arnaud.porterie@docker.com>
Ashwini Oruganti <ashwini.oruganti@gmail.com>
Azat Khuyiyakhmetov <shadow_uz@mail.ru>
Bardia Keyoumarsi <bkeyouma@ucsc.edu>
Barnaby Gray <barnaby@pickle.me.uk>
Bastiaan Bakker <bbakker@xebia.com>
BastianHofmann <bastianhofmann@me.com>
Ben Bonnefoy <frenchben@docker.com>
Ben Firshman <ben@firshman.co.uk>
Benjamin Boudreau <boudreau.benjamin@gmail.com>
Bhumika Bayani <bhumikabayani@gmail.com>
Bill Wang <ozbillwang@gmail.com>
Bin Liu <liubin0329@gmail.com>
Bingshen Wang <bingshen.wbs@alibaba-inc.com>
Boaz Shuster <ripcurld.github@gmail.com>
Boris Pruessmann <boris@pruessmann.org>
Bradley Cicenas <bradley.cicenas@gmail.com>
Brandon Philips <brandon.philips@coreos.com>
Brent Salisbury <brent.salisbury@docker.com>
Bret Fisher <bret@bretfisher.com>
Brian (bex) Exelbierd <bexelbie@redhat.com>
Brian Goff <cpuguy83@gmail.com>
Bryan Bess <squarejaw@bsbess.com>
Bryan Boreham <bjboreham@gmail.com>
Bryan Murphy <bmurphy1976@gmail.com>
bryfry <bryon.fryer@gmail.com>
Cameron Spear <cameronspear@gmail.com>
Cao Weiwei <cao.weiwei30@zte.com.cn>
Carlo Mion <mion00@gmail.com>
Carlos Alexandro Becker <caarlos0@gmail.com>
Ce Gao <ce.gao@outlook.com>
Cedric Davies <cedricda@microsoft.com>
Cezar Sa Espinola <cezarsa@gmail.com>
Chao Wang <wangchao.fnst@cn.fujitsu.com>
Charles Chan <charleswhchan@users.noreply.github.com>
Charles Law <claw@conduce.com>
Charles Smith <charles.smith@docker.com>
Charlie Drage <charlie@charliedrage.com>
ChaYoung You <yousbe@gmail.com>
Chen Chuanliang <chen.chuanliang@zte.com.cn>
Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
Chen Mingjie <chenmingjie0828@163.com>
Chen Qiu <cheney-90@hotmail.com>
Chris Gavin <chris@chrisgavin.me>
Chris Gibson <chris@chrisg.io>
Chris McKinnel <chrismckinnel@gmail.com>
Chris Snow <chsnow123@gmail.com>
Chris Weyl <cweyl@alumni.drew.edu>
Christian Persson <saser@live.se>
Christian Stefanescu <st.chris@gmail.com>
Christophe Robin <crobin@nekoo.com>
Christophe Vidal <kriss@krizalys.com>
Christopher Biscardi <biscarch@sketcht.com>
Christopher Jones <tophj@linux.vnet.ibm.com>
Christy Perez <christy@linux.vnet.ibm.com>
Chun Chen <ramichen@tencent.com>
Clinton Kitson <clintonskitson@gmail.com>
Coenraad Loubser <coenraad@wish.org.za>
Colin Hebert <hebert.colin@gmail.com>
Collin Guarino <collin.guarino@gmail.com>
Colm Hally <colmhally@gmail.com>
Corey Farrell <git@cfware.com>
Cristian Staretu <cristian.staretu@gmail.com>
Daehyeok Mun <daehyeok@gmail.com>
Dafydd Crosby <dtcrsby@gmail.com>
dalanlan <dalanlan925@gmail.com>
Damien Nadé <github@livna.org>
Dan Cotora <dan@bluevision.ro>
Daniel Dao <dqminh@cloudflare.com>
Daniel Farrell <dfarrell@redhat.com>
Daniel Gasienica <daniel@gasienica.ch>
Daniel Goosen <daniel.goosen@surveysampling.com>
Daniel Hiltgen <daniel.hiltgen@docker.com>
Daniel J Walsh <dwalsh@redhat.com>
Daniel Nephin <dnephin@docker.com>
Daniel Norberg <dano@spotify.com>
Daniel Watkins <daniel@daniel-watkins.co.uk>
Daniel Zhang <jmzwcn@gmail.com>
Danny Berger <dpb587@gmail.com>
Darren Shepherd <darren.s.shepherd@gmail.com>
Darren Stahl <darst@microsoft.com>
Dattatraya Kumbhar <dattatraya.kumbhar@gslab.com>
Dave Goodchild <buddhamagnet@gmail.com>
Dave Henderson <dhenderson@gmail.com>
Dave Tucker <dt@docker.com>
David Calavera <david.calavera@gmail.com>
David Cramer <davcrame@cisco.com>
David Dooling <dooling@gmail.com>
David Gageot <david@gageot.net>
David Lechner <david@lechnology.com>
David Sheets <dsheets@docker.com>
David Williamson <david.williamson@docker.com>
David Xia <dxia@spotify.com>
David Young <yangboh@cn.ibm.com>
Deng Guangxing <dengguangxing@huawei.com>
Denis Defreyne <denis@soundcloud.com>
Denis Gladkikh <denis@gladkikh.email>
Denis Ollier <larchunix@users.noreply.github.com>
Dennis Docter <dennis@d23.nl>
Derek McGowan <derek@mcgstyle.net>
Deshi Xiao <dxiao@redhat.com>
Dharmit Shah <shahdharmit@gmail.com>
Dhawal Yogesh Bhanushali <dbhanushali@vmware.com>
Dieter Reuter <dieter.reuter@me.com>
Dima Stopel <dima@twistlock.com>
Dimitry Andric <d.andric@activevideo.com>
Ding Fei <dingfei@stars.org.cn>
Diogo Monica <diogo@docker.com>
Dmitry Gusev <dmitry.gusev@gmail.com>
Dmitry Smirnov <onlyjob@member.fsf.org>
Dmitry V. Krivenok <krivenok.dmitry@gmail.com>
Don Kjer <don.kjer@gmail.com>
Dong Chen <dongluo.chen@docker.com>
Doug Davis <dug@us.ibm.com>
Drew Erny <drew.erny@docker.com>
Ed Costello <epc@epcostello.com>
Eli Uriegas <eli.uriegas@docker.com>
Eli Uriegas <seemethere101@gmail.com>
Elias Faxö <elias.faxo@tre.se>
Eric G. Noriega <enoriega@vizuri.com>
Eric Rosenberg <ehaydenr@gmail.com>
Eric Sage <eric.david.sage@gmail.com>
Eric-Olivier Lamey <eo@lamey.me>
Erica Windisch <erica@windisch.us>
Erik Hollensbe <github@hollensbe.org>
Erik St. Martin <alakriti@gmail.com>
Ethan Haynes <ethanhaynes@alumni.harvard.edu>
Eugene Yakubovich <eugene.yakubovich@coreos.com>
Evan Allrich <evan@unguku.com>
Evan Hazlett <ejhazlett@gmail.com>
Evan Krall <krall@yelp.com>
Evelyn Xu <evelynhsu21@gmail.com>
Everett Toews <everett.toews@rackspace.com>
Fabio Falci <fabiofalci@gmail.com>
Fabrizio Soppelsa <fsoppelsa@mirantis.com>
Felix Hupfeld <felix@quobyte.com>
Felix Rabe <felix@rabe.io>
Flavio Crisciani <flavio.crisciani@docker.com>
Florian Klein <florian.klein@free.fr>
Foysal Iqbal <foysal.iqbal.fb@gmail.com>
Fred Lifton <fred.lifton@docker.com>
Frederick F. Kautz IV <fkautz@redhat.com>
Frederik Nordahl Jul Sabroe <frederikns@gmail.com>
Frieder Bluemle <frieder.bluemle@gmail.com>
Gabriel Nicolas Avellaneda <avellaneda.gabriel@gmail.com>
Gaetan de Villele <gdevillele@gmail.com>
Gang Qiao <qiaohai8866@gmail.com>
Gary Schaetz <gary@schaetzkc.com>
Genki Takiuchi <genki@s21g.com>
George MacRorie <gmacr31@gmail.com>
George Xie <georgexsh@gmail.com>
Gianluca Borello <g.borello@gmail.com>
Gildas Cuisinier <gildas.cuisinier@gcuisinier.net>
Gou Rao <gou@portworx.com>
Grant Reaber <grant.reaber@gmail.com>
Greg Pflaum <gpflaum@users.noreply.github.com>
Guilhem Lettron <guilhem+github@lettron.fr>
Guillaume J. Charmes <guillaume.charmes@docker.com>
gwx296173 <gaojing3@huawei.com>
Günther Jungbluth <gunther@gameslabs.net>
Hakan Özler <hakan.ozler@kodcu.com>
Hao Zhang <21521210@zju.edu.cn>
Harald Albers <github@albersweb.de>
Harold Cooper <hrldcpr@gmail.com>
Harry Zhang <harryz@hyper.sh>
He Simei <hesimei@zju.edu.cn>
Helen Xie <chenjg@harmonycloud.cn>
Henning Sprang <henning.sprang@gmail.com>
Hernan Garcia <hernandanielg@gmail.com>
Hongbin Lu <hongbin034@gmail.com>
Hu Keping <hukeping@huawei.com>
Huayi Zhang <irachex@gmail.com>
huqun <huqun@zju.edu.cn>
Huu Nguyen <huu@prismskylabs.com>
Hyzhou Zhy <hyzhou.zhy@alibaba-inc.com>
Ian Campbell <ian.campbell@docker.com>
Ian Philpot <ian.philpot@microsoft.com>
Ignacio Capurro <icapurrofagian@gmail.com>
Ilya Dmitrichenko <errordeveloper@gmail.com>
Ilya Khlopotov <ilya.khlopotov@gmail.com>
Ilya Sotkov <ilya@sotkov.com>
Isabel Jimenez <contact.isabeljimenez@gmail.com>
Ivan Grcic <igrcic@gmail.com>
Ivan Markin <sw@nogoegst.net>
Jacob Atzen <jacob@jacobatzen.dk>
Jacob Tomlinson <jacob@tom.linson.uk>
Jaivish Kothari <janonymous.codevulture@gmail.com>
Jake Sanders <jsand@google.com>
James Nesbitt <james.nesbitt@wunderkraut.com>
James Turnbull <james@lovedthanlost.net>
Jamie Hannaford <jamie@limetree.org>
Jan Koprowski <jan.koprowski@gmail.com>
Jan Pazdziora <jpazdziora@redhat.com>
Jan-Jaap Driessen <janjaapdriessen@gmail.com>
Jana Radhakrishnan <mrjana@docker.com>
Jared Hocutt <jaredh@netapp.com>
Jasmine Hegman <jasmine@jhegman.com>
Jason Heiss <jheiss@aput.net>
Jason Plum <jplum@devonit.com>
Jay Kamat <github@jgkamat.33mail.com>
Jean-Pierre Huynh <jean-pierre.huynh@ounet.fr>
Jean-Pierre Huynh <jp@moogsoft.com>
Jeff Lindsay <progrium@gmail.com>
Jeff Nickoloff <jeff.nickoloff@gmail.com>
Jeff Silberman <jsilberm@gmail.com>
Jeremy Chambers <jeremy@thehipbot.com>
Jeremy Unruh <jeremybunruh@gmail.com>
Jeremy Yallop <yallop@docker.com>
Jeroen Franse <jeroenfranse@gmail.com>
Jesse Adametz <jesseadametz@gmail.com>
Jessica Frazelle <jessfraz@google.com>
Jezeniel Zapanta <jpzapanta22@gmail.com>
Jian Zhang <zhangjian.fnst@cn.fujitsu.com>
Jie Luo <luo612@zju.edu.cn>
Jilles Oldenbeuving <ojilles@gmail.com>
Jim Galasyn <jim.galasyn@docker.com>
Jimmy Leger <jimmy.leger@gmail.com>
Jimmy Song <rootsongjc@gmail.com>
jimmyxian <jimmyxian2004@yahoo.com.cn>
Joao Fernandes <joao.fernandes@docker.com>
Joe Doliner <jdoliner@pachyderm.io>
Joe Gordon <joe.gordon0@gmail.com>
Joel Handwell <joelhandwell@gmail.com>
Joey Geiger <jgeiger@gmail.com>
Joffrey F <joffrey@docker.com>
Johan Euphrosine <proppy@google.com>
Johannes 'fish' Ziemke <github@freigeist.org>
John Feminella <jxf@jxf.me>
John Harris <john@johnharris.io>
John Howard (VM) <John.Howard@microsoft.com>
John Laswell <john.n.laswell@gmail.com>
John Maguire <jmaguire@duosecurity.com>
John Mulhausen <john@docker.com>
John Starks <jostarks@microsoft.com>
John Stephens <johnstep@docker.com>
John Tims <john.k.tims@gmail.com>
John V. Martinez <jvmatl@gmail.com>
John Willis <john.willis@docker.com>
Jonathan Boulle <jonathanboulle@gmail.com>
Jonathan Lee <jonjohn1232009@gmail.com>
Jonathan Lomas <jonathan@floatinglomas.ca>
Jonathan McCrohan <jmccrohan@gmail.com>
Jonh Wendell <jonh.wendell@redhat.com>
Jordan Jennings <jjn2009@gmail.com>
Joseph Kern <jkern@semafour.net>
Josh Bodah <jb3689@yahoo.com>
Josh Chorlton <jchorlton@gmail.com>
Josh Hawn <josh.hawn@docker.com>
Josh Horwitz <horwitz@addthis.com>
Josh Soref <jsoref@gmail.com>
Julien Barbier <write0@gmail.com>
Julien Kassar <github@kassisol.com>
Julien Maitrehenry <julien.maitrehenry@me.com>
Justas Brazauskas <brazauskasjustas@gmail.com>
Justin Cormack <justin.cormack@docker.com>
Justin Simonelis <justin.p.simonelis@gmail.com>
Jyrki Puttonen <jyrkiput@gmail.com>
Jérôme Petazzoni <jerome.petazzoni@docker.com>
Jörg Thalheim <joerg@higgsboson.tk>
Kai Blin <kai@samba.org>
Kai Qiang Wu (Kennan) <wkq5325@gmail.com>
Kara Alexandra <kalexandra@us.ibm.com>
Kareem Khazem <karkhaz@karkhaz.com>
Karthik Nayak <Karthik.188@gmail.com>
Kat Samperi <kat.samperi@gmail.com>
Katie McLaughlin <katie@glasnt.com>
Ke Xu <leonhartx.k@gmail.com>
Kei Ohmura <ohmura.kei@gmail.com>
Keith Hudgins <greenman@greenman.org>
Ken Cochrane <kencochrane@gmail.com>
Ken ICHIKAWA <ichikawa.ken@jp.fujitsu.com>
Kenfe-Mickaël Laventure <mickael.laventure@gmail.com>
Kevin Burke <kev@inburke.com>
Kevin Feyrer <kevin.feyrer@btinternet.com>
Kevin Kern <kaiwentan@harmonycloud.cn>
Kevin Meredith <kevin.m.meredith@gmail.com>
Kevin Richardson <kevin@kevinrichardson.co>
khaled souf <khaled.souf@gmail.com>
Kim Eik <kim@heldig.org>
Kir Kolyshkin <kolyshkin@gmail.com>
Kotaro Yoshimatsu <kotaro.yoshimatsu@gmail.com>
Krasi Georgiev <krasi@vip-consult.solutions>
Kris-Mikael Krister <krismikael@protonmail.com>
Kun Zhang <zkazure@gmail.com>
Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
Kyle Spiers <kyle@spiers.me>
Lachlan Cooper <lachlancooper@gmail.com>
Lai Jiangshan <jiangshanlai@gmail.com>
Lars Kellogg-Stedman <lars@redhat.com>
Laura Frank <ljfrank@gmail.com>
Laurent Erignoux <lerignoux@gmail.com>
Lei Jitang <leijitang@huawei.com>
Lennie <github@consolejunkie.net>
Leo Gallucci <elgalu3@gmail.com>
Lewis Daly <lewisdaly@me.com>
Li Yi <denverdino@gmail.com>
Li Yi <weiyuan.yl@alibaba-inc.com>
Liang-Chi Hsieh <viirya@gmail.com>
Lily Guo <lily.guo@docker.com>
Lin Lu <doraalin@163.com>
Linus Heckemann <lheckemann@twig-world.com>
Liping Xue <lipingxue@gmail.com>
Liron Levin <liron@twistlock.com>
liwenqi <vikilwq@zju.edu.cn>
lixiaobing10051267 <li.xiaobing1@zte.com.cn>
Lloyd Dewolf <foolswisdom@gmail.com>
Lorenzo Fontana <lo@linux.com>
Louis Opter <kalessin@kalessin.fr>
Luca Favatella <luca.favatella@erlang-solutions.com>
Luca Marturana <lucamarturana@gmail.com>
Lucas Chan <lucas-github@lucaschan.com>
Luka Hartwig <mail@lukahartwig.de>
Lukasz Zajaczkowski <Lukasz.Zajaczkowski@ts.fujitsu.com>
Lénaïc Huard <lhuard@amadeus.com>
Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
Mabin <bin.ma@huawei.com>
Madhav Puri <madhav.puri@gmail.com>
Madhu Venugopal <madhu@socketplane.io>
Malte Janduda <mail@janduda.net>
Manjunath A Kumatagi <mkumatag@in.ibm.com>
Mansi Nahar <mmn4185@rit.edu>
mapk0y <mapk0y@gmail.com>
Marc Bihlmaier <marc.bihlmaier@reddoxx.com>
Marco Mariani <marco.mariani@alterway.fr>
Marcus Martins <marcus@docker.com>
Marianna Tessel <mtesselh@gmail.com>
Marius Sturm <marius@graylog.com>
Mark Oates <fl0yd@me.com>
Martin Mosegaard Amdisen <martin.amdisen@praqma.com>
Mary Anthony <mary.anthony@docker.com>
Mason Malone <mason.malone@gmail.com>
Mateusz Major <apkd@users.noreply.github.com>
Matt Gucci <matt9ucci@gmail.com>
Matt Robenolt <matt@ydekproductions.com>
Matthew Heon <mheon@redhat.com>
Matthieu Hauglustaine <matt.hauglustaine@gmail.com>
Max Shytikov <mshytikov@gmail.com>
Maxime Petazzoni <max@signalfuse.com>
Mei ChunTao <mei.chuntao@zte.com.cn>
Micah Zoltu <micah@newrelic.com>
Michael A. Smith <michael@smith-li.com>
Michael Bridgen <mikeb@squaremobius.net>
Michael Crosby <michael@docker.com>
Michael Friis <friism@gmail.com>
Michael Irwin <mikesir87@gmail.com>
Michael Käufl <docker@c.michael-kaeufl.de>
Michael Prokop <github@michael-prokop.at>
Michael Scharf <github@scharf.gr>
Michael Spetsiotis <michael_spets@hotmail.com>
Michael Steinert <mike.steinert@gmail.com>
Michael West <mwest@mdsol.com>
Michal Minář <miminar@redhat.com>
Michał Czeraszkiewicz <czerasz@gmail.com>
Miguel Angel Alvarez Cabrerizo <doncicuto@gmail.com>
Mihai Borobocea <MihaiBorob@gmail.com>
Mihuleacc Sergiu <mihuleac.sergiu@gmail.com>
Mike Brown <brownwm@us.ibm.com>
Mike Casas <mkcsas0@gmail.com>
Mike Danese <mikedanese@google.com>
Mike Dillon <mike@embody.org>
Mike Goelzer <mike.goelzer@docker.com>
Mike MacCana <mike.maccana@gmail.com>
mikelinjie <294893458@qq.com>
Mikhail Vasin <vasin@cloud-tv.ru>
Milind Chawre <milindchawre@gmail.com>
Misty Stanley-Jones <misty@docker.com>
Mohammad Banikazemi <mb@us.ibm.com>
Mohammed Aaqib Ansari <maaquib@gmail.com>
Moorthy RS <rsmoorthy@gmail.com>
Morgan Bauer <mbauer@us.ibm.com>
Moysés Borges <moysesb@gmail.com>
Mrunal Patel <mrunalp@gmail.com>
muicoder <muicoder@gmail.com>
Muthukumar R <muthur@gmail.com>
Máximo Cuadros <mcuadros@gmail.com>
Nace Oroz <orkica@gmail.com>
Nahum Shalman <nshalman@omniti.com>
Nalin Dahyabhai <nalin@redhat.com>
Natalie Parker <nparker@omnifone.com>
Nate Brennand <nate.brennand@clever.com>
Nathan Hsieh <hsieh.nathan@gmail.com>
Nathan LeClaire <nathan.leclaire@docker.com>
Nathan McCauley <nathan.mccauley@docker.com>
Neil Peterson <neilpeterson@outlook.com>
Nicola Kabar <nicolaka@gmail.com>
Nicolas Borboën <ponsfrilus@gmail.com>
Nicolas De Loof <nicolas.deloof@gmail.com>
Nikhil Chawla <chawlanikhil24@gmail.com>
Nikolas Garofil <nikolas.garofil@uantwerpen.be>
Nikolay Milovanov <nmil@itransformers.net>
Nishant Totla <nishanttotla@gmail.com>
NIWA Hideyuki <niwa.niwa@nifty.ne.jp>
Noah Treuhaft <noah.treuhaft@docker.com>
O.S. Tezer <ostezer@gmail.com>
ohmystack <jun.jiang02@ele.me>
Olle Jonsson <olle.jonsson@gmail.com>
Otto Kekäläinen <otto@seravo.fi>
Ovidio Mallo <ovidio.mallo@gmail.com>
Pascal Borreli <pascal@borreli.com>
Patrick Böänziger <patrick.baenziger@bsi-software.com>
Patrick Hemmer <patrick.hemmer@gmail.com>
Patrick Lang <plang@microsoft.com>
Paul <paul9869@gmail.com>
Paul Kehrer <paul.l.kehrer@gmail.com>
Paul Lietar <paul@lietar.net>
Paul Weaver <pauweave@cisco.com>
Pavel Pospisil <pospispa@gmail.com>
Paweł Szczekutowicz <pszczekutowicz@gmail.com>
Peeyush Gupta <gpeeyush@linux.vnet.ibm.com>
Peter Edge <peter.edge@gmail.com>
Peter Jaffe <pjaffe@nevo.com>
Peter Nagy <xificurC@gmail.com>
Peter Salvatore <peter@psftw.com>
Peter Waller <p@pwaller.net>
Phil Estes <estesp@linux.vnet.ibm.com>
Philip Alexander Etling <paetling@gmail.com>
Philipp Gillé <philipp.gille@gmail.com>
pidster <pid@pidster.com>
pixelistik <pixelistik@users.noreply.github.com>
Pratik Karki <prertik@outlook.com>
Prayag Verma <prayag.verma@gmail.com>
Pure White <daniel48@126.com>
Qiang Huang <h.huangqiang@huawei.com>
Qinglan Peng <qinglanpeng@zju.edu.cn>
qudongfang <qudongfang@gmail.com>
Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
Ray Tsang <rayt@google.com>
Reficul <xuzhenglun@gmail.com>
Remy Suen <remy.suen@gmail.com>
Renaud Gaubert <rgaubert@nvidia.com>
Ricardo N Feliciano <FelicianoTech@gmail.com>
Rich Moyse <rich@moyse.us>
Richard Mathie <richard.mathie@amey.co.uk>
Richard Scothern <richard.scothern@gmail.com>
Rick Wieman <git@rickw.nl>
Ritesh H Shukla <sritesh@vmware.com>
Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Robert Wallis <smilingrob@gmail.com>
Robin Naundorf <r.naundorf@fh-muenster.de>
Robin Speekenbrink <robin@kingsquare.nl>
Rodolfo Ortiz <rodolfo.ortiz@definityfirst.com>
Rogelio Canedo <rcanedo@mappy.priv>
Roland Kammerer <roland.kammerer@linbit.com>
Roman Dudin <katrmr@gmail.com>
Rory Hunter <roryhunter2@gmail.com>
Ross Boucher <rboucher@gmail.com>
Rubens Figueiredo <r.figueiredo.52@gmail.com>
Ryan Belgrave <rmb1993@gmail.com>
Ryan Detzel <ryan.detzel@gmail.com>
Ryan Stelly <ryan.stelly@live.com>
Sainath Grandhi <sainath.grandhi@intel.com>
Sakeven Jiang <jc5930@sina.cn>
Sally O'Malley <somalley@redhat.com>
Sam Neirinck <sam@samneirinck.com>
Sambuddha Basu <sambuddhabasu1@gmail.com>
Samuel Karp <skarp@amazon.com>
Santhosh Manohar <santhosh@docker.com>
Scott Collier <emailscottcollier@gmail.com>
Sean Christopherson <sean.j.christopherson@intel.com>
Sean Rodman <srodman7689@gmail.com>
Sebastiaan van Stijn <github@gone.nl>
Sergey Tryuber <Sergeant007@users.noreply.github.com>
Serhat Gülçiçek <serhat25@gmail.com>
Sevki Hasirci <s@sevki.org>
Shaun Kaasten <shaunk@gmail.com>
Sheng Yang <sheng@yasker.org>
Shijiang Wei <mountkin@gmail.com>
Shishir Mahajan <shishir.mahajan@redhat.com>
Shoubhik Bose <sbose78@gmail.com>
Shukui Yang <yangshukui@huawei.com>
Sian Lerk Lau <kiawin@gmail.com>
Sidhartha Mani <sidharthamn@gmail.com>
sidharthamani <sid@rancher.com>
Silvin Lubecki <silvin.lubecki@docker.com>
Simei He <hesimei@zju.edu.cn>
Simon Ferquel <simon.ferquel@docker.com>
Sindhu S <sindhus@live.in>
Slava Semushin <semushin@redhat.com>
Solomon Hykes <solomon@docker.com>
Song Gao <song@gao.io>
Spencer Brown <spencer@spencerbrown.org>
squeegels <1674195+squeegels@users.noreply.github.com>
Srini Brahmaroutu <srbrahma@us.ibm.com>
Stefan S. <tronicum@user.github.com>
Stefan Scherer <scherer_stefan@icloud.com>
Stefan Weil <sw@weilnetz.de>
Stephen Day <stephen.day@docker.com>
Stephen Rust <srust@blockbridge.com>
Steve Durrheimer <s.durrheimer@gmail.com>
Steven Burgess <steven.a.burgess@hotmail.com>
Subhajit Ghosh <isubuz.g@gmail.com>
Sun Jianbo <wonderflow.sun@gmail.com>
Sungwon Han <sungwon.han@navercorp.com>
Sven Dowideit <SvenDowideit@home.org.au>
Sylvain Baubeau <sbaubeau@redhat.com>
Sébastien HOUZÉ <cto@verylastroom.com>
T K Sourabh <sourabhtk37@gmail.com>
TAGOMORI Satoshi <tagomoris@gmail.com>
Taylor Jones <monitorjbl@gmail.com>
Thatcher Peskens <thatcher@docker.com>
Thomas Gazagnaire <thomas@gazagnaire.org>
Thomas Krzero <thomas.kovatchitch@gmail.com>
Thomas Leonard <thomas.leonard@docker.com>
Thomas Léveil <thomasleveil@gmail.com>
Thomas Riccardi <riccardi@systran.fr>
Thomas Swift <tgs242@gmail.com>
Tianon Gravi <admwiggin@gmail.com>
Tianyi Wang <capkurmagati@gmail.com>
Tibor Vass <teabee89@gmail.com>
Tim Dettrick <t.dettrick@uq.edu.au>
Tim Hockin <thockin@google.com>
Tim Smith <timbot@google.com>
Tim Waugh <twaugh@redhat.com>
Tim Wraight <tim.wraight@tangentlabs.co.uk>
timfeirg <kkcocogogo@gmail.com>
Timothy Hobbs <timothyhobbs@seznam.cz>
Tobias Bradtke <webwurst@gmail.com>
Tobias Gesellchen <tobias@gesellix.de>
Todd Whiteman <todd.whiteman@joyent.com>
Tom Denham <tom@tomdee.co.uk>
Tom Fotherby <tom+github@peopleperhour.com>
Tom X. Tobin <tomxtobin@tomxtobin.com>
Tomas Tomecek <ttomecek@redhat.com>
Tomasz Kopczynski <tomek@kopczynski.net.pl>
Tomáš Hrčka <thrcka@redhat.com>
Tony Abboud <tdabboud@hotmail.com>
Tõnis Tiigi <tonistiigi@gmail.com>
Trapier Marshall <trapier.marshall@docker.com>
Travis Cline <travis.cline@gmail.com>
Tristan Carel <tristan@cogniteev.com>
Tycho Andersen <tycho@docker.com>
Tycho Andersen <tycho@tycho.ws>
uhayate <uhayate.gong@daocloud.io>
Umesh Yadav <umesh4257@gmail.com>
Valentin Lorentz <progval+git@progval.net>
Veres Lajos <vlajos@gmail.com>
Victor Vieux <victor.vieux@docker.com>
Victoria Bialas <victoria.bialas@docker.com>
Viktor Stanchev <me@viktorstanchev.com>
Vincent Batts <vbatts@redhat.com>
Vincent Bernat <Vincent.Bernat@exoscale.ch>
Vincent Demeester <vincent.demeester@docker.com>
Vincent Woo <me@vincentwoo.com>
Vishnu Kannan <vishnuk@google.com>
Vivek Goyal <vgoyal@redhat.com>
Wang Jie <wangjie5@chinaskycloud.com>
Wang Long <long.wanglong@huawei.com>
Wang Ping <present.wp@icloud.com>
Wang Xing <hzwangxing@corp.netease.com>
Wang Yuexiao <wang.yuexiao@zte.com.cn>
Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
Wayne Song <wsong@docker.com>
Wen Cheng Ma <wenchma@cn.ibm.com>
Wenzhi Liang <wenzhi.liang@gmail.com>
Wes Morgan <cap10morgan@gmail.com>
Wewang Xiaorenfine <wang.xiaoren@zte.com.cn>
William Henry <whenry@redhat.com>
Xianglin Gao <xlgao@zju.edu.cn>
Xinbo Weng <xihuanbo_0521@zju.edu.cn>
Xuecong Liao <satorulogic@gmail.com>
Yan Feng <yanfeng2@huawei.com>
Yanqiang Miao <miao.yanqiang@zte.com.cn>
Yassine Tijani <yasstij11@gmail.com>
Yi EungJun <eungjun.yi@navercorp.com>
Ying Li <ying.li@docker.com>
Yong Tang <yong.tang.github@outlook.com>
Yosef Fertel <yfertel@gmail.com>
Yu Peng <yu.peng36@zte.com.cn>
Yuan Sun <sunyuan3@huawei.com>
Yunxiang Huang <hyxqshk@vip.qq.com>
zebrilee <zebrilee@gmail.com>
Zhang Kun <zkazure@gmail.com>
Zhang Wei <zhangwei555@huawei.com>
Zhang Wentao <zhangwentao234@huawei.com>
ZhangHang <stevezhang2014@gmail.com>
zhenghenghuo <zhenghenghuo@zju.edu.cn>
Zhou Hao <zhouhao@cn.fujitsu.com>
Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
Álex González <agonzalezro@gmail.com>
Álvaro Lázaro <alvaro.lazaro.g@gmail.com>
Átila Camurça Alves <camurca.home@gmail.com>
徐俊杰 <paco.xu@daocloud.io>

View File

@ -1,6 +1,6 @@
# Docker maintainers file
#
# This file describes who runs the docker/docker project and how.
# This file describes who runs the docker/cli project and how.
# This is a living document - if you see something out of date or missing, speak up!
#
# It is structured to be consumable by both humans and programs.
@ -21,23 +21,12 @@
# a subsystem, they are responsible for doing so and holding the
# subsystem maintainers accountable. If ownership is unclear, they are the de facto owners.
# For each release (including minor releases), a "release captain" is assigned from the
# pool of core maintainers. Rotation is encouraged across all maintainers, to ensure
# the release process is clear and up-to-date.
people = [
"aaronlehmann",
"albers",
"aluzzardi",
"anusha",
"cpuguy83",
"crosbymichael",
"dnephin",
"ehazlett",
"johnstep",
"justincormack",
"mavenugo",
"mlaventure",
"stevvooe",
"tibor",
"tonistiigi",
@ -67,7 +56,6 @@
# - close an issue or pull request when it's inappropriate or off-topic
people = [
"ehazlett",
"programmerq",
"thajeztah"
]
@ -90,41 +78,16 @@
Email = "github@albersweb.de"
GitHub = "albers"
[people.aluzzardi]
Name = "Andrea Luzzardi"
Email = "al@docker.com"
GitHub = "aluzzardi"
[people.anusha]
Name = "Anusha Ragunathan"
Email = "anusha@docker.com"
GitHub = "anusha-ragunathan"
[people.cpuguy83]
Name = "Brian Goff"
Email = "cpuguy83@gmail.com"
GitHub = "cpuguy83"
[people.crosbymichael]
Name = "Michael Crosby"
Email = "crosbymichael@gmail.com"
GitHub = "crosbymichael"
[people.dnephin]
Name = "Daniel Nephin"
Email = "dnephin@gmail.com"
GitHub = "dnephin"
[people.ehazlett]
Name = "Evan Hazlett"
Email = "ejhazlett@gmail.com"
GitHub = "ehazlett"
[people.johnstep]
Name = "John Stephens"
Email = "johnstep@docker.com"
GitHub = "johnstep"
[people.justincormack]
Name = "Justin Cormack"
Email = "justin.cormack@docker.com"
@ -135,15 +98,10 @@
Email = "misty@docker.com"
GitHub = "mistyhacks"
[people.mlaventure]
Name = "Kenfe-Mickaël Laventure"
Email = "mickael.laventure@docker.com"
GitHub = "mlaventure"
[people.shykes]
Name = "Solomon Hykes"
Email = "solomon@docker.com"
GitHub = "shykes"
[people.programmerq]
Name = "Jeff Anderson"
Email = "jeff@docker.com"
GitHub = "programmerq"
[people.stevvooe]
Name = "Stephen Day"

View File

@ -51,9 +51,14 @@ watch: ## monitor file changes and run go test
./scripts/test/watch
vendor: vendor.conf ## check that vendor matches vendor.conf
vndr 2> /dev/null
rm -rf vendor
bash -c 'vndr |& grep -v -i clone'
scripts/validate/check-git-diff vendor
.PHONY: authors
authors: ## generate AUTHORS file from git history
scripts/docs/generate-authors.sh
.PHONY: manpages
manpages: ## generate man pages from go source and markdown
scripts/docs/generate-man.sh

View File

@ -1 +1 @@
17.12.1-ce
18.03.1-ce

View File

@ -0,0 +1,23 @@
version: "{build}"
clone_folder: c:\gopath\src\github.com\docker\cli
environment:
GOPATH: c:\gopath
GOVERSION: 1.10
DEPVERSION: v0.4.1
install:
- rmdir c:\go /s /q
- appveyor DownloadFile https://storage.googleapis.com/golang/go%GOVERSION%.windows-amd64.msi
- msiexec /i go%GOVERSION%.windows-amd64.msi /q
- go version
- go env
deploy: false
build_script:
- ps: .\scripts\make.ps1 -Binary
test_script:
- ps: .\scripts\make.ps1 -TestUnit

View File

@ -5,7 +5,8 @@ import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
)
func TestLoadFileV01Success(t *testing.T) {
@ -25,9 +26,9 @@ func TestLoadFileV01Success(t *testing.T) {
}`)
bundle, err := LoadFile(reader)
assert.NoError(t, err)
assert.Equal(t, "0.1", bundle.Version)
assert.Len(t, bundle.Services, 2)
assert.NilError(t, err)
assert.Check(t, is.Equal("0.1", bundle.Version))
assert.Check(t, is.Len(bundle.Services, 2))
}
func TestLoadFileSyntaxError(t *testing.T) {
@ -37,7 +38,7 @@ func TestLoadFileSyntaxError(t *testing.T) {
}`)
_, err := LoadFile(reader)
assert.EqualError(t, err, "JSON syntax error at byte 37: invalid character 'u' looking for beginning of value")
assert.Error(t, err, "JSON syntax error at byte 37: invalid character 'u' looking for beginning of value")
}
func TestLoadFileTypeError(t *testing.T) {
@ -52,7 +53,7 @@ func TestLoadFileTypeError(t *testing.T) {
}`)
_, err := LoadFile(reader)
assert.EqualError(t, err, "Unexpected type at byte 94. Expected []string but received string.")
assert.Error(t, err, "Unexpected type at byte 94. Expected []string but received string.")
}
func TestPrint(t *testing.T) {
@ -66,12 +67,12 @@ func TestPrint(t *testing.T) {
},
},
}
assert.NoError(t, Print(&buffer, bundle))
assert.Check(t, Print(&buffer, bundle))
output := buffer.String()
assert.Contains(t, output, "\"Image\": \"image\"")
assert.Contains(t, output,
assert.Check(t, is.Contains(output, "\"Image\": \"image\""))
assert.Check(t, is.Contains(output,
`"Command": [
"echo",
"something"
]`)
]`))
}

View File

@ -6,10 +6,10 @@ import (
"testing"
"github.com/docker/cli/internal/test"
"github.com/docker/cli/internal/test/testutil"
"github.com/docker/docker/api/types"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
)
func TestCheckpointCreateErrors(t *testing.T) {
@ -42,7 +42,7 @@ func TestCheckpointCreateErrors(t *testing.T) {
cmd := newCreateCommand(cli)
cmd.SetArgs(tc.args)
cmd.SetOutput(ioutil.Discard)
testutil.ErrorContains(t, cmd.Execute(), tc.expectedError)
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
}
}
@ -63,10 +63,10 @@ func TestCheckpointCreateWithOptions(t *testing.T) {
cmd.SetArgs([]string{"container-foo", checkpoint})
cmd.Flags().Set("leave-running", "true")
cmd.Flags().Set("checkpoint-dir", "/dir/foo")
assert.NoError(t, cmd.Execute())
assert.Equal(t, "container-foo", containerID)
assert.Equal(t, checkpoint, checkpointID)
assert.Equal(t, "/dir/foo", checkpointDir)
assert.Equal(t, false, exit)
assert.Equal(t, checkpoint, strings.TrimSpace(cli.OutBuffer().String()))
assert.NilError(t, cmd.Execute())
assert.Check(t, is.Equal("container-foo", containerID))
assert.Check(t, is.Equal(checkpoint, checkpointID))
assert.Check(t, is.Equal("/dir/foo", checkpointDir))
assert.Check(t, is.Equal(false, exit))
assert.Check(t, is.Equal(checkpoint, strings.TrimSpace(cli.OutBuffer().String())))
}

View File

@ -5,11 +5,11 @@ import (
"testing"
"github.com/docker/cli/internal/test"
"github.com/docker/cli/internal/test/testutil"
"github.com/docker/docker/api/types"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/gotestyourself/gotestyourself/golden"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
)
func TestCheckpointListErrors(t *testing.T) {
@ -42,7 +42,7 @@ func TestCheckpointListErrors(t *testing.T) {
cmd := newListCommand(cli)
cmd.SetArgs(tc.args)
cmd.SetOutput(ioutil.Discard)
testutil.ErrorContains(t, cmd.Execute(), tc.expectedError)
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
}
}
@ -60,8 +60,8 @@ func TestCheckpointListWithOptions(t *testing.T) {
cmd := newListCommand(cli)
cmd.SetArgs([]string{"container-foo"})
cmd.Flags().Set("checkpoint-dir", "/dir/foo")
assert.NoError(t, cmd.Execute())
assert.Equal(t, "container-foo", containerID)
assert.Equal(t, "/dir/foo", checkpointDir)
assert.NilError(t, cmd.Execute())
assert.Check(t, is.Equal("container-foo", containerID))
assert.Check(t, is.Equal("/dir/foo", checkpointDir))
golden.Assert(t, cli.OutBuffer().String(), "checkpoint-list-with-options.golden")
}

View File

@ -5,10 +5,10 @@ import (
"testing"
"github.com/docker/cli/internal/test"
"github.com/docker/cli/internal/test/testutil"
"github.com/docker/docker/api/types"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
)
func TestCheckpointRemoveErrors(t *testing.T) {
@ -41,7 +41,7 @@ func TestCheckpointRemoveErrors(t *testing.T) {
cmd := newRemoveCommand(cli)
cmd.SetArgs(tc.args)
cmd.SetOutput(ioutil.Discard)
testutil.ErrorContains(t, cmd.Execute(), tc.expectedError)
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
}
}
@ -58,8 +58,8 @@ func TestCheckpointRemoveWithOptions(t *testing.T) {
cmd := newRemoveCommand(cli)
cmd.SetArgs([]string{"container-foo", "checkpoint-bar"})
cmd.Flags().Set("checkpoint-dir", "/dir/foo")
assert.NoError(t, cmd.Execute())
assert.Equal(t, "container-foo", containerID)
assert.Equal(t, "checkpoint-bar", checkpointID)
assert.Equal(t, "/dir/foo", checkpointDir)
assert.NilError(t, cmd.Execute())
assert.Check(t, is.Equal("container-foo", containerID))
assert.Check(t, is.Equal("checkpoint-bar", checkpointID))
assert.Check(t, is.Equal("/dir/foo", checkpointDir))
}

View File

@ -5,18 +5,23 @@ import (
"net"
"net/http"
"os"
"path/filepath"
"runtime"
"time"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/config"
cliconfig "github.com/docker/cli/cli/config"
"github.com/docker/cli/cli/config/configfile"
cliflags "github.com/docker/cli/cli/flags"
manifeststore "github.com/docker/cli/cli/manifest/store"
registryclient "github.com/docker/cli/cli/registry/client"
"github.com/docker/cli/cli/trust"
dopts "github.com/docker/cli/opts"
"github.com/docker/docker/api"
"github.com/docker/docker/api/types"
registrytypes "github.com/docker/docker/api/types/registry"
"github.com/docker/docker/client"
"github.com/docker/go-connections/sockets"
"github.com/docker/go-connections/tlsconfig"
"github.com/pkg/errors"
"github.com/spf13/cobra"
@ -42,24 +47,30 @@ type Cli interface {
SetIn(in *InStream)
ConfigFile() *configfile.ConfigFile
ServerInfo() ServerInfo
ClientInfo() ClientInfo
NotaryClient(imgRefAndAuth trust.ImageRefAndAuth, actions []string) (notaryclient.Repository, error)
DefaultVersion() string
ManifestStore() manifeststore.Store
RegistryClient(bool) registryclient.RegistryClient
ContentTrustEnabled() bool
}
// DockerCli is an instance the docker command line client.
// Instances of the client can be returned from NewDockerCli.
type DockerCli struct {
configFile *configfile.ConfigFile
in *InStream
out *OutStream
err io.Writer
client client.APIClient
defaultVersion string
server ServerInfo
configFile *configfile.ConfigFile
in *InStream
out *OutStream
err io.Writer
client client.APIClient
serverInfo ServerInfo
clientInfo ClientInfo
contentTrust bool
}
// DefaultVersion returns api.defaultVersion or DOCKER_API_VERSION if specified.
func (cli *DockerCli) DefaultVersion() string {
return cli.defaultVersion
return cli.clientInfo.DefaultVersion
}
// Client returns the APIClient
@ -104,7 +115,33 @@ func (cli *DockerCli) ConfigFile() *configfile.ConfigFile {
// ServerInfo returns the server version details for the host this client is
// connected to
func (cli *DockerCli) ServerInfo() ServerInfo {
return cli.server
return cli.serverInfo
}
// ClientInfo returns the client details for the cli
func (cli *DockerCli) ClientInfo() ClientInfo {
return cli.clientInfo
}
// ContentTrustEnabled returns whether content trust has been enabled by an
// environment variable.
func (cli *DockerCli) ContentTrustEnabled() bool {
return cli.contentTrust
}
// ManifestStore returns a store for local manifests
func (cli *DockerCli) ManifestStore() manifeststore.Store {
// TODO: support override default location from config file
return manifeststore.NewStore(filepath.Join(config.Dir(), "manifests"))
}
// RegistryClient returns a client for communicating with a Docker distribution
// registry
func (cli *DockerCli) RegistryClient(allowInsecure bool) registryclient.RegistryClient {
resolver := func(ctx context.Context, index *registrytypes.IndexInfo) types.AuthConfig {
return ResolveAuthConfig(ctx, cli, index)
}
return registryclient.NewRegistryClient(resolver, UserAgent(), allowInsecure)
}
// Initialize the dockerCli runs initialization that must happen after command
@ -125,17 +162,36 @@ func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions) error {
if err != nil {
return err
}
hasExperimental, err := isEnabled(cli.configFile.Experimental)
if err != nil {
return errors.Wrap(err, "Experimental field")
}
orchestrator := GetOrchestrator(hasExperimental, opts.Common.Orchestrator, cli.configFile.Orchestrator)
cli.clientInfo = ClientInfo{
DefaultVersion: cli.client.ClientVersion(),
HasExperimental: hasExperimental,
Orchestrator: orchestrator,
}
cli.initializeFromClient()
return nil
}
func (cli *DockerCli) initializeFromClient() {
cli.defaultVersion = cli.client.ClientVersion()
func isEnabled(value string) (bool, error) {
switch value {
case "enabled":
return true, nil
case "", "disabled":
return false, nil
default:
return false, errors.Errorf("%q is not valid, should be either enabled or disabled", value)
}
}
func (cli *DockerCli) initializeFromClient() {
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}
cli.serverInfo = ServerInfo{HasExperimental: true}
if ping.APIVersion != "" {
cli.client.NegotiateAPIVersionPing(ping)
@ -143,7 +199,7 @@ func (cli *DockerCli) initializeFromClient() {
return
}
cli.server = ServerInfo{
cli.serverInfo = ServerInfo{
HasExperimental: ping.Experimental,
OSType: ping.OSType,
}
@ -176,9 +232,21 @@ type ServerInfo struct {
OSType string
}
// ClientInfo stores details about the supported features of the client
type ClientInfo struct {
HasExperimental bool
DefaultVersion string
Orchestrator Orchestrator
}
// HasKubernetes checks if kubernetes orchestrator is enabled
func (c ClientInfo) HasKubernetes() bool {
return c.HasExperimental && c.Orchestrator == OrchestratorKubernetes
}
// NewDockerCli returns a DockerCli instance with IO output and error streams set by in, out and err.
func NewDockerCli(in io.ReadCloser, out, err io.Writer) *DockerCli {
return &DockerCli{in: NewInStream(in), out: NewOutStream(out), err: err}
func NewDockerCli(in io.ReadCloser, out, err io.Writer, isTrusted bool) *DockerCli {
return &DockerCli{in: NewInStream(in), out: NewOutStream(out), err: err, contentTrust: isTrusted}
}
// NewAPIClientFromFlags creates a new APIClient from command line flags
@ -199,12 +267,12 @@ func NewAPIClientFromFlags(opts *cliflags.CommonOptions, configFile *configfile.
verStr = tmpStr
}
httpClient, err := newHTTPClient(host, opts.TLSOptions)
if err != nil {
return &client.Client{}, err
}
return client.NewClient(host, verStr, httpClient, customHeaders)
return client.NewClientWithOpts(
withHTTPClient(opts.TLSOptions),
client.WithHTTPHeaders(customHeaders),
client.WithVersion(verStr),
client.WithHost(host),
)
}
func getServerHost(hosts []string, tlsOptions *tlsconfig.Options) (string, error) {
@ -221,35 +289,32 @@ func getServerHost(hosts []string, tlsOptions *tlsconfig.Options) (string, error
return dopts.ParseHost(tlsOptions != nil, host)
}
func newHTTPClient(host string, tlsOptions *tlsconfig.Options) (*http.Client, error) {
if tlsOptions == nil {
// let the api client configure the default transport.
return nil, nil
}
opts := *tlsOptions
opts.ExclusiveRootPools = true
config, err := tlsconfig.Client(opts)
if err != nil {
return nil, err
}
tr := &http.Transport{
TLSClientConfig: config,
DialContext: (&net.Dialer{
KeepAlive: 30 * time.Second,
Timeout: 30 * time.Second,
}).DialContext,
}
proto, addr, _, err := client.ParseHost(host)
if err != nil {
return nil, err
}
func withHTTPClient(tlsOpts *tlsconfig.Options) func(*client.Client) error {
return func(c *client.Client) error {
if tlsOpts == nil {
// Use the default HTTPClient
return nil
}
sockets.ConfigureTransport(tr, proto, addr)
opts := *tlsOpts
opts.ExclusiveRootPools = true
tlsConfig, err := tlsconfig.Client(opts)
if err != nil {
return err
}
return &http.Client{
Transport: tr,
CheckRedirect: client.CheckRedirect,
}, nil
httpClient := &http.Client{
Transport: &http.Transport{
TLSClientConfig: tlsConfig,
DialContext: (&net.Dialer{
KeepAlive: 30 * time.Second,
Timeout: 30 * time.Second,
}).DialContext,
},
CheckRedirect: client.CheckRedirect,
}
return client.WithHTTPClient(httpClient)(c)
}
}
// UserAgent returns the user agent string used for making API requests

View File

@ -1,25 +1,29 @@
package command
import (
"crypto/x509"
"os"
"runtime"
"testing"
"crypto/x509"
cliconfig "github.com/docker/cli/cli/config"
"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/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/gotestyourself/gotestyourself/fs"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/net/context"
)
func TestNewAPIClientFromFlags(t *testing.T) {
host := "unix://path"
if runtime.GOOS == "windows" {
host = "npipe://./"
}
opts := &flags.CommonOptions{Hosts: []string{host}}
configFile := &configfile.ConfigFile{
HTTPHeaders: map[string]string{
@ -27,15 +31,15 @@ func TestNewAPIClientFromFlags(t *testing.T) {
},
}
apiclient, err := NewAPIClientFromFlags(opts, configFile)
require.NoError(t, err)
assert.Equal(t, host, apiclient.DaemonHost())
assert.NilError(t, err)
assert.Check(t, is.Equal(host, apiclient.DaemonHost()))
expectedHeaders := map[string]string{
"My-Header": "Custom-Value",
"User-Agent": UserAgent(),
}
assert.Equal(t, expectedHeaders, apiclient.(*client.Client).CustomHTTPHeaders())
assert.Equal(t, api.DefaultVersion, apiclient.ClientVersion())
assert.Check(t, is.DeepEqual(expectedHeaders, apiclient.(*client.Client).CustomHTTPHeaders()))
assert.Check(t, is.Equal(api.DefaultVersion, apiclient.ClientVersion()))
}
func TestNewAPIClientFromFlagsWithAPIVersionFromEnv(t *testing.T) {
@ -45,20 +49,20 @@ func TestNewAPIClientFromFlagsWithAPIVersionFromEnv(t *testing.T) {
opts := &flags.CommonOptions{}
configFile := &configfile.ConfigFile{}
apiclient, err := NewAPIClientFromFlags(opts, configFile)
require.NoError(t, err)
assert.Equal(t, customVersion, apiclient.ClientVersion())
assert.NilError(t, err)
assert.Check(t, is.Equal(customVersion, apiclient.ClientVersion()))
}
// 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))
assert.NilError(t, os.Setenv(key, value))
return func() {
if !ok {
require.NoError(t, os.Unsetenv(key))
assert.NilError(t, os.Unsetenv(key))
return
}
require.NoError(t, os.Setenv(key, oldValue))
assert.NilError(t, os.Setenv(key, oldValue))
}
}
@ -124,9 +128,151 @@ func TestInitializeFromClient(t *testing.T) {
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)
assert.Check(t, is.DeepEqual(testcase.expectedServer, cli.serverInfo))
assert.Check(t, is.Equal(testcase.negotiated, apiclient.negotiated))
})
}
}
func TestExperimentalCLI(t *testing.T) {
defaultVersion := "v1.55"
var testcases = []struct {
doc string
configfile string
expectedExperimentalCLI bool
}{
{
doc: "default",
configfile: `{}`,
expectedExperimentalCLI: false,
},
{
doc: "experimental",
configfile: `{
"experimental": "enabled"
}`,
expectedExperimentalCLI: true,
},
}
for _, testcase := range testcases {
t.Run(testcase.doc, func(t *testing.T) {
dir := fs.NewDir(t, testcase.doc, fs.WithFile("config.json", testcase.configfile))
defer dir.Remove()
apiclient := &fakeClient{
version: defaultVersion,
}
cli := &DockerCli{client: apiclient, err: os.Stderr}
cliconfig.SetDir(dir.Path())
err := cli.Initialize(flags.NewClientOptions())
assert.NilError(t, err)
assert.Check(t, is.Equal(testcase.expectedExperimentalCLI, cli.ClientInfo().HasExperimental))
})
}
}
func TestOrchestratorSwitch(t *testing.T) {
defaultVersion := "v0.00"
var testcases = []struct {
doc string
configfile string
envOrchestrator string
flagOrchestrator string
expectedOrchestrator string
expectedKubernetes bool
}{
{
doc: "default",
configfile: `{
"experimental": "enabled"
}`,
expectedOrchestrator: "swarm",
expectedKubernetes: false,
},
{
doc: "kubernetesIsExperimental",
configfile: `{
"experimental": "disabled",
"orchestrator": "kubernetes"
}`,
envOrchestrator: "kubernetes",
flagOrchestrator: "kubernetes",
expectedOrchestrator: "swarm",
expectedKubernetes: false,
},
{
doc: "kubernetesConfigFile",
configfile: `{
"experimental": "enabled",
"orchestrator": "kubernetes"
}`,
expectedOrchestrator: "kubernetes",
expectedKubernetes: true,
},
{
doc: "kubernetesEnv",
configfile: `{
"experimental": "enabled"
}`,
envOrchestrator: "kubernetes",
expectedOrchestrator: "kubernetes",
expectedKubernetes: true,
},
{
doc: "kubernetesFlag",
configfile: `{
"experimental": "enabled"
}`,
flagOrchestrator: "kubernetes",
expectedOrchestrator: "kubernetes",
expectedKubernetes: true,
},
{
doc: "envOverridesConfigFile",
configfile: `{
"experimental": "enabled",
"orchestrator": "kubernetes"
}`,
envOrchestrator: "swarm",
expectedOrchestrator: "swarm",
expectedKubernetes: false,
},
{
doc: "flagOverridesEnv",
configfile: `{
"experimental": "enabled"
}`,
envOrchestrator: "kubernetes",
flagOrchestrator: "swarm",
expectedOrchestrator: "swarm",
expectedKubernetes: false,
},
}
for _, testcase := range testcases {
t.Run(testcase.doc, func(t *testing.T) {
dir := fs.NewDir(t, testcase.doc, fs.WithFile("config.json", testcase.configfile))
defer dir.Remove()
apiclient := &fakeClient{
version: defaultVersion,
}
if testcase.envOrchestrator != "" {
defer patchEnvVariable(t, "DOCKER_ORCHESTRATOR", testcase.envOrchestrator)()
}
cli := &DockerCli{client: apiclient, err: os.Stderr}
cliconfig.SetDir(dir.Path())
options := flags.NewClientOptions()
if testcase.flagOrchestrator != "" {
options.Common.Orchestrator = testcase.flagOrchestrator
}
err := cli.Initialize(options)
assert.NilError(t, err)
assert.Check(t, is.Equal(testcase.expectedKubernetes, cli.ClientInfo().HasKubernetes()))
assert.Check(t, is.Equal(testcase.expectedOrchestrator, string(cli.ClientInfo().Orchestrator)))
})
}
}
@ -188,11 +334,11 @@ func TestGetClientWithPassword(t *testing.T) {
_, err := getClientWithPassword(passRetriever, newClient)
if testcase.expectedErr != "" {
testutil.ErrorContains(t, err, testcase.expectedErr)
assert.ErrorContains(t, err, testcase.expectedErr)
return
}
assert.NoError(t, err)
assert.NilError(t, err)
})
}
}

View File

@ -8,6 +8,7 @@ import (
"github.com/docker/cli/cli/command/config"
"github.com/docker/cli/cli/command/container"
"github.com/docker/cli/cli/command/image"
"github.com/docker/cli/cli/command/manifest"
"github.com/docker/cli/cli/command/network"
"github.com/docker/cli/cli/command/node"
"github.com/docker/cli/cli/command/plugin"
@ -39,12 +40,15 @@ func AddCommands(cmd *cobra.Command, dockerCli *command.DockerCli) {
image.NewImageCommand(dockerCli),
image.NewBuildCommand(dockerCli),
// node
node.NewNodeCommand(dockerCli),
// manifest
manifest.NewManifestCommand(dockerCli),
// network
network.NewNetworkCommand(dockerCli),
// node
node.NewNodeCommand(dockerCli),
// plugin
plugin.NewPluginCommand(dockerCli),

View File

@ -10,11 +10,14 @@ import (
// NewConfigCommand returns a cobra command for `config` subcommands
func NewConfigCommand(dockerCli command.Cli) *cobra.Command {
cmd := &cobra.Command{
Use: "config",
Short: "Manage Docker configs",
Args: cli.NoArgs,
RunE: command.ShowHelp(dockerCli.Err()),
Annotations: 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",
"swarm": "",
},
}
cmd.AddCommand(
newConfigListCommand(dockerCli),

View File

@ -16,9 +16,10 @@ import (
)
type createOptions struct {
name string
file string
labels opts.ListOpts
name string
templateDriver string
file string
labels opts.ListOpts
}
func newConfigCreateCommand(dockerCli command.Cli) *cobra.Command {
@ -28,7 +29,7 @@ func newConfigCreateCommand(dockerCli command.Cli) *cobra.Command {
cmd := &cobra.Command{
Use: "create [OPTIONS] CONFIG file|-",
Short: "Create a configuration file from a file or STDIN as content",
Short: "Create a config from a file or STDIN",
Args: cli.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
createOpts.name = args[0]
@ -38,6 +39,8 @@ func newConfigCreateCommand(dockerCli command.Cli) *cobra.Command {
}
flags := cmd.Flags()
flags.VarP(&createOpts.labels, "label", "l", "Config labels")
flags.StringVar(&createOpts.templateDriver, "template-driver", "", "Template driver")
flags.SetAnnotation("driver", "version", []string{"1.37"})
return cmd
}
@ -68,7 +71,11 @@ func runConfigCreate(dockerCli command.Cli, options createOptions) error {
},
Data: configData,
}
if options.templateDriver != "" {
spec.Templating = &swarm.Driver{
Name: options.templateDriver,
}
}
r, err := client.ConfigCreate(ctx, spec)
if err != nil {
return err

View File

@ -8,12 +8,12 @@ import (
"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/swarm"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/gotestyourself/gotestyourself/golden"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
)
const configDataFile = "config-create-with-name.golden"
@ -47,7 +47,7 @@ func TestConfigCreateErrors(t *testing.T) {
)
cmd.SetArgs(tc.args)
cmd.SetOutput(ioutil.Discard)
testutil.ErrorContains(t, cmd.Execute(), tc.expectedError)
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
}
}
@ -70,9 +70,9 @@ func TestConfigCreateWithName(t *testing.T) {
cmd := newConfigCreateCommand(cli)
cmd.SetArgs([]string{name, filepath.Join("testdata", configDataFile)})
assert.NoError(t, cmd.Execute())
assert.NilError(t, cmd.Execute())
golden.Assert(t, string(actual), configDataFile)
assert.Equal(t, "ID-"+name, strings.TrimSpace(cli.OutBuffer().String()))
assert.Check(t, is.Equal("ID-"+name, strings.TrimSpace(cli.OutBuffer().String())))
}
func TestConfigCreateWithLabels(t *testing.T) {
@ -82,14 +82,21 @@ func TestConfigCreateWithLabels(t *testing.T) {
}
name := "foo"
data, err := ioutil.ReadFile(filepath.Join("testdata", configDataFile))
assert.NilError(t, err)
expected := swarm.ConfigSpec{
Annotations: swarm.Annotations{
Name: name,
Labels: expectedLabels,
},
Data: data,
}
cli := test.NewFakeCli(&fakeClient{
configCreateFunc: func(spec swarm.ConfigSpec) (types.ConfigCreateResponse, error) {
if spec.Name != name {
return types.ConfigCreateResponse{}, errors.Errorf("expected name %q, got %q", name, spec.Name)
}
if !reflect.DeepEqual(spec.Labels, expectedLabels) {
return types.ConfigCreateResponse{}, errors.Errorf("expected labels %v, got %v", expectedLabels, spec.Labels)
if !reflect.DeepEqual(spec, expected) {
return types.ConfigCreateResponse{}, errors.Errorf("expected %+v, got %+v", expected, spec)
}
return types.ConfigCreateResponse{
@ -102,6 +109,35 @@ func TestConfigCreateWithLabels(t *testing.T) {
cmd.SetArgs([]string{name, filepath.Join("testdata", configDataFile)})
cmd.Flags().Set("label", "lbl1=Label-foo")
cmd.Flags().Set("label", "lbl2=Label-bar")
assert.NoError(t, cmd.Execute())
assert.Equal(t, "ID-"+name, strings.TrimSpace(cli.OutBuffer().String()))
assert.NilError(t, cmd.Execute())
assert.Check(t, is.Equal("ID-"+name, strings.TrimSpace(cli.OutBuffer().String())))
}
func TestConfigCreateWithTemplatingDriver(t *testing.T) {
expectedDriver := &swarm.Driver{
Name: "template-driver",
}
name := "foo"
cli := test.NewFakeCli(&fakeClient{
configCreateFunc: func(spec swarm.ConfigSpec) (types.ConfigCreateResponse, error) {
if spec.Name != name {
return types.ConfigCreateResponse{}, errors.Errorf("expected name %q, got %q", name, spec.Name)
}
if spec.Templating.Name != expectedDriver.Name {
return types.ConfigCreateResponse{}, errors.Errorf("expected driver %v, got %v", expectedDriver, spec.Labels)
}
return types.ConfigCreateResponse{
ID: "ID-" + spec.Name,
}, nil
},
})
cmd := newConfigCreateCommand(cli)
cmd.SetArgs([]string{name, filepath.Join("testdata", configDataFile)})
cmd.Flags().Set("template-driver", expectedDriver.Name)
assert.NilError(t, cmd.Execute())
assert.Check(t, is.Equal("ID-"+name, strings.TrimSpace(cli.OutBuffer().String())))
}

View File

@ -21,7 +21,7 @@ func newConfigInspectCommand(dockerCli command.Cli) *cobra.Command {
opts := inspectOptions{}
cmd := &cobra.Command{
Use: "inspect [OPTIONS] CONFIG [CONFIG...]",
Short: "Display detailed information on one or more configuration files",
Short: "Display detailed information on one or more configs",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.names = args

View File

@ -11,9 +11,8 @@ import (
"github.com/pkg/errors"
// Import builders to get the builder function as package function
. "github.com/docker/cli/internal/test/builders"
"github.com/docker/cli/internal/test/testutil"
"github.com/gotestyourself/gotestyourself/assert"
"github.com/gotestyourself/gotestyourself/golden"
"github.com/stretchr/testify/assert"
)
func TestConfigInspectErrors(t *testing.T) {
@ -62,7 +61,7 @@ func TestConfigInspectErrors(t *testing.T) {
cmd.Flags().Set(key, value)
}
cmd.SetOutput(ioutil.Discard)
testutil.ErrorContains(t, cmd.Execute(), tc.expectedError)
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
}
}
@ -96,7 +95,7 @@ func TestConfigInspectWithoutFormat(t *testing.T) {
cli := test.NewFakeCli(&fakeClient{configInspectFunc: tc.configInspectFunc})
cmd := newConfigInspectCommand(cli)
cmd.SetArgs(tc.args)
assert.NoError(t, cmd.Execute())
assert.NilError(t, cmd.Execute())
golden.Assert(t, cli.OutBuffer().String(), fmt.Sprintf("config-inspect-without-format.%s.golden", tc.name))
}
}
@ -133,7 +132,7 @@ func TestConfigInspectWithFormat(t *testing.T) {
cmd := newConfigInspectCommand(cli)
cmd.SetArgs(tc.args)
cmd.Flags().Set("format", tc.format)
assert.NoError(t, cmd.Execute())
assert.NilError(t, cmd.Execute())
golden.Assert(t, cli.OutBuffer().String(), fmt.Sprintf("config-inspect-with-format.%s.golden", tc.name))
}
}
@ -167,7 +166,7 @@ func TestConfigInspectPretty(t *testing.T) {
cmd.SetArgs([]string{"configID"})
cmd.Flags().Set("pretty", "true")
assert.NoError(t, cmd.Execute())
assert.NilError(t, cmd.Execute())
golden.Assert(t, cli.OutBuffer().String(), fmt.Sprintf("config-inspect-pretty.%s.golden", tc.name))
}
}

View File

@ -12,9 +12,9 @@ import (
"github.com/pkg/errors"
// Import builders to get the builder function as package function
. "github.com/docker/cli/internal/test/builders"
"github.com/docker/cli/internal/test/testutil"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/gotestyourself/gotestyourself/golden"
"github.com/stretchr/testify/assert"
)
func TestConfigListErrors(t *testing.T) {
@ -42,7 +42,7 @@ func TestConfigListErrors(t *testing.T) {
)
cmd.SetArgs(tc.args)
cmd.SetOutput(ioutil.Discard)
testutil.ErrorContains(t, cmd.Execute(), tc.expectedError)
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
}
}
@ -72,7 +72,7 @@ func TestConfigList(t *testing.T) {
},
})
cmd := newConfigListCommand(cli)
assert.NoError(t, cmd.Execute())
assert.NilError(t, cmd.Execute())
golden.Assert(t, cli.OutBuffer().String(), "config-list-sort.golden")
}
@ -89,7 +89,7 @@ func TestConfigListWithQuietOption(t *testing.T) {
})
cmd := newConfigListCommand(cli)
cmd.Flags().Set("quiet", "true")
assert.NoError(t, cmd.Execute())
assert.NilError(t, cmd.Execute())
golden.Assert(t, cli.OutBuffer().String(), "config-list-with-quiet-option.golden")
}
@ -108,7 +108,7 @@ func TestConfigListWithConfigFormat(t *testing.T) {
ConfigFormat: "{{ .Name }} {{ .Labels }}",
})
cmd := newConfigListCommand(cli)
assert.NoError(t, cmd.Execute())
assert.NilError(t, cmd.Execute())
golden.Assert(t, cli.OutBuffer().String(), "config-list-with-config-format.golden")
}
@ -125,15 +125,15 @@ func TestConfigListWithFormat(t *testing.T) {
})
cmd := newConfigListCommand(cli)
cmd.Flags().Set("format", "{{ .Name }} {{ .Labels }}")
assert.NoError(t, cmd.Execute())
assert.NilError(t, cmd.Execute())
golden.Assert(t, cli.OutBuffer().String(), "config-list-with-format.golden")
}
func TestConfigListWithFilter(t *testing.T) {
cli := test.NewFakeCli(&fakeClient{
configListFunc: func(options types.ConfigListOptions) ([]swarm.Config, error) {
assert.Equal(t, "foo", options.Filters.Get("name")[0])
assert.Equal(t, "lbl1=Label-bar", options.Filters.Get("label")[0])
assert.Check(t, is.Equal("foo", options.Filters.Get("name")[0]))
assert.Check(t, is.Equal("lbl1=Label-bar", options.Filters.Get("label")[0]))
return []swarm.Config{
*Config(ConfigID("ID-foo"),
ConfigName("foo"),
@ -153,6 +153,6 @@ func TestConfigListWithFilter(t *testing.T) {
cmd := newConfigListCommand(cli)
cmd.Flags().Set("filter", "name=foo")
cmd.Flags().Set("filter", "label=lbl1=Label-bar")
assert.NoError(t, cmd.Execute())
assert.NilError(t, cmd.Execute())
golden.Assert(t, cli.OutBuffer().String(), "config-list-with-filter.golden")
}

View File

@ -19,7 +19,7 @@ func newConfigRemoveCommand(dockerCli command.Cli) *cobra.Command {
return &cobra.Command{
Use: "rm CONFIG [CONFIG...]",
Aliases: []string{"remove"},
Short: "Remove one or more configuration files",
Short: "Remove one or more configs",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts := removeOptions{

View File

@ -6,9 +6,9 @@ import (
"testing"
"github.com/docker/cli/internal/test"
"github.com/docker/cli/internal/test/testutil"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
)
func TestConfigRemoveErrors(t *testing.T) {
@ -37,7 +37,7 @@ func TestConfigRemoveErrors(t *testing.T) {
)
cmd.SetArgs(tc.args)
cmd.SetOutput(ioutil.Discard)
testutil.ErrorContains(t, cmd.Execute(), tc.expectedError)
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
}
}
@ -52,9 +52,9 @@ func TestConfigRemoveWithName(t *testing.T) {
})
cmd := newConfigRemoveCommand(cli)
cmd.SetArgs(names)
assert.NoError(t, cmd.Execute())
assert.Equal(t, names, strings.Split(strings.TrimSpace(cli.OutBuffer().String()), "\n"))
assert.Equal(t, names, removedConfigs)
assert.NilError(t, cmd.Execute())
assert.Check(t, is.DeepEqual(names, strings.Split(strings.TrimSpace(cli.OutBuffer().String()), "\n")))
assert.Check(t, is.DeepEqual(names, removedConfigs))
}
func TestConfigRemoveContinueAfterError(t *testing.T) {
@ -74,6 +74,6 @@ func TestConfigRemoveContinueAfterError(t *testing.T) {
cmd := newConfigRemoveCommand(cli)
cmd.SetArgs(names)
cmd.SetOutput(ioutil.Discard)
assert.EqualError(t, cmd.Execute(), "error removing config: foo")
assert.Equal(t, names, removedConfigs)
assert.Error(t, cmd.Execute(), "error removing config: foo")
assert.Check(t, is.DeepEqual(names, removedConfigs))
}

View File

@ -1,12 +1,14 @@
package container
import (
"fmt"
"io"
"net/http/httputil"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/client"
"github.com/docker/docker/pkg/signal"
"github.com/pkg/errors"
@ -66,6 +68,9 @@ func runAttach(dockerCli command.Cli, opts *attachOptions) error {
ctx := context.Background()
client := dockerCli.Client()
// request channel to wait for client
resultC, errC := client.ContainerWait(ctx, opts.container, "")
c, err := inspectContainerAndCheckState(ctx, client, opts.container)
if err != nil {
return err
@ -140,7 +145,24 @@ func runAttach(dockerCli command.Cli, opts *attachOptions) error {
if errAttach != nil {
return errAttach
}
return getExitStatus(ctx, dockerCli.Client(), opts.container)
return getExitStatus(errC, resultC)
}
func getExitStatus(errC <-chan error, resultC <-chan container.ContainerWaitOKBody) error {
select {
case result := <-resultC:
if result.Error != nil {
return fmt.Errorf(result.Error.Message)
}
if result.StatusCode != 0 {
return cli.StatusError{StatusCode: int(result.StatusCode)}
}
case err := <-errC:
return err
}
return nil
}
func resizeTTY(ctx context.Context, dockerCli command.Cli, containerID string) {
@ -157,19 +179,3 @@ func resizeTTY(ctx context.Context, dockerCli command.Cli, containerID string) {
logrus.Debugf("Error monitoring TTY size: %s", err)
}
}
func getExitStatus(ctx context.Context, apiclient client.ContainerAPIClient, containerID string) error {
container, err := apiclient.ContainerInspect(ctx, containerID)
if err != nil {
// If we can't connect, then the daemon probably died.
if !client.IsErrConnectionFailed(err) {
return err
}
return cli.StatusError{StatusCode: -1}
}
status := container.State.ExitCode
if status != 0 {
return cli.StatusError{StatusCode: status}
}
return nil
}

View File

@ -1,16 +1,16 @@
package container
import (
"fmt"
"io/ioutil"
"testing"
"github.com/docker/cli/cli"
"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/gotestyourself/gotestyourself/assert"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"golang.org/x/net/context"
)
func TestNewAttachCommandErrors(t *testing.T) {
@ -73,45 +73,57 @@ func TestNewAttachCommandErrors(t *testing.T) {
cmd := NewAttachCommand(test.NewFakeCli(&fakeClient{inspectFunc: tc.containerInspectFunc}))
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
testutil.ErrorContains(t, cmd.Execute(), tc.expectedError)
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
}
}
func TestGetExitStatus(t *testing.T) {
containerID := "the exec id"
expecatedErr := errors.New("unexpected error")
var (
expectedErr = fmt.Errorf("unexpected error")
errC = make(chan error, 1)
resultC = make(chan container.ContainerWaitOKBody, 1)
)
testcases := []struct {
inspectError error
exitCode int
result *container.ContainerWaitOKBody
err error
expectedError error
}{
{
inspectError: nil,
exitCode: 0,
result: &container.ContainerWaitOKBody{
StatusCode: 0,
},
},
{
inspectError: expecatedErr,
expectedError: expecatedErr,
err: expectedErr,
expectedError: expectedErr,
},
{
exitCode: 15,
result: &container.ContainerWaitOKBody{
Error: &container.ContainerWaitOKBodyError{expectedErr.Error()},
},
expectedError: expectedErr,
},
{
result: &container.ContainerWaitOKBody{
StatusCode: 15,
},
expectedError: cli.StatusError{StatusCode: 15},
},
}
for _, testcase := range testcases {
client := &fakeClient{
inspectFunc: func(id string) (types.ContainerJSON, error) {
assert.Equal(t, containerID, id)
return types.ContainerJSON{
ContainerJSONBase: &types.ContainerJSONBase{
State: &types.ContainerState{ExitCode: testcase.exitCode},
},
}, testcase.inspectError
},
if testcase.err != nil {
errC <- testcase.err
}
if testcase.result != nil {
resultC <- *testcase.result
}
err := getExitStatus(errC, resultC)
if testcase.expectedError == nil {
assert.NilError(t, err)
} else {
assert.Error(t, err, testcase.expectedError.Error())
}
err := getExitStatus(context.Background(), client, containerID)
assert.Equal(t, testcase.expectedError, err)
}
}

View File

@ -16,11 +16,22 @@ type fakeClient struct {
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)
containerStartFunc func(container string, options types.ContainerStartOptions) 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)
waitFunc func(string) (<-chan container.ContainerWaitOKBody, <-chan error)
containerListFunc func(types.ContainerListOptions) ([]types.Container, error)
Version string
}
func (f *fakeClient) ContainerList(_ context.Context, options types.ContainerListOptions) ([]types.Container, error) {
if f.containerListFunc != nil {
return f.containerListFunc(options)
}
return []types.Container{}, nil
}
func (f *fakeClient) ContainerInspect(_ context.Context, containerID string) (types.ContainerJSON, error) {
@ -95,3 +106,21 @@ func (f *fakeClient) ContainerLogs(_ context.Context, container string, options
}
return nil, nil
}
func (f *fakeClient) ClientVersion() string {
return f.Version
}
func (f *fakeClient) ContainerWait(_ context.Context, container string, _ container.WaitCondition) (<-chan container.ContainerWaitOKBody, <-chan error) {
if f.waitFunc != nil {
return f.waitFunc(container)
}
return nil, nil
}
func (f *fakeClient) ContainerStart(_ context.Context, container string, options types.ContainerStartOptions) error {
if f.containerStartFunc != nil {
return f.containerStartFunc(container, options)
}
return nil
}

View File

@ -3,18 +3,18 @@ package container
import (
"io"
"io/ioutil"
"os"
"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/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"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) {
@ -43,7 +43,7 @@ func TestRunCopyWithInvalidArguments(t *testing.T) {
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)
assert.Error(t, err, testcase.expectedErr)
})
}
}
@ -53,16 +53,16 @@ func TestRunCopyFromContainerToStdout(t *testing.T) {
fakeClient := &fakeClient{
containerCopyFromFunc: func(container, srcPath string) (io.ReadCloser, types.ContainerPathStat, error) {
assert.Equal(t, "container", container)
assert.Check(t, is.Equal("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())
assert.NilError(t, err)
assert.Check(t, is.Equal(tarContent, cli.OutBuffer().String()))
assert.Check(t, is.Equal("", cli.ErrBuffer().String()))
}
func TestRunCopyFromContainerToFilesystem(t *testing.T) {
@ -72,7 +72,7 @@ func TestRunCopyFromContainerToFilesystem(t *testing.T) {
fakeClient := &fakeClient{
containerCopyFromFunc: func(container, srcPath string) (io.ReadCloser, types.ContainerPathStat, error) {
assert.Equal(t, "container", container)
assert.Check(t, is.Equal("container", container))
readCloser, err := archive.TarWithOptions(destDir.Path(), &archive.TarOptions{})
return readCloser, types.ContainerPathStat{}, err
},
@ -80,13 +80,13 @@ func TestRunCopyFromContainerToFilesystem(t *testing.T) {
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())
assert.NilError(t, err)
assert.Check(t, is.Equal("", cli.OutBuffer().String()))
assert.Check(t, is.Equal("", cli.ErrBuffer().String()))
content, err := ioutil.ReadFile(destDir.Join("file1"))
require.NoError(t, err)
assert.Equal(t, "content\n", string(content))
assert.NilError(t, err)
assert.Check(t, is.Equal("content\n", string(content)))
}
func TestRunCopyFromContainerToFilesystemMissingDestinationDirectory(t *testing.T) {
@ -96,7 +96,7 @@ func TestRunCopyFromContainerToFilesystemMissingDestinationDirectory(t *testing.
fakeClient := &fakeClient{
containerCopyFromFunc: func(container, srcPath string) (io.ReadCloser, types.ContainerPathStat, error) {
assert.Equal(t, "container", container)
assert.Check(t, is.Equal("container", container))
readCloser, err := archive.TarWithOptions(destDir.Path(), &archive.TarOptions{})
return readCloser, types.ContainerPathStat{}, err
},
@ -108,7 +108,39 @@ func TestRunCopyFromContainerToFilesystemMissingDestinationDirectory(t *testing.
}
cli := test.NewFakeCli(fakeClient)
err := runCopy(cli, options)
testutil.ErrorContains(t, err, destDir.Join("missing"))
assert.ErrorContains(t, err, destDir.Join("missing"))
}
func TestRunCopyToContainerFromFileWithTrailingSlash(t *testing.T) {
srcFile := fs.NewFile(t, t.Name())
defer srcFile.Remove()
options := copyOptions{
source: srcFile.Path() + string(os.PathSeparator),
destination: "container:/path",
}
cli := test.NewFakeCli(&fakeClient{})
err := runCopy(cli, options)
expectedError := "not a directory"
if runtime.GOOS == "windows" {
expectedError = "The filename, directory name, or volume label syntax is incorrect"
}
assert.ErrorContains(t, err, expectedError)
}
func TestRunCopyToContainerSourceDoesNotExist(t *testing.T) {
options := copyOptions{
source: "/does/not/exist",
destination: "container:/path",
}
cli := test.NewFakeCli(&fakeClient{})
err := runCopy(cli, options)
expected := "no such file or directory"
if runtime.GOOS == "windows" {
expected = "cannot find the file specified"
}
assert.ErrorContains(t, err, expected)
}
func TestSplitCpArg(t *testing.T) {
@ -153,8 +185,8 @@ func TestSplitCpArg(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)
assert.Check(t, is.Equal(testcase.expectedContainer, container))
assert.Check(t, is.Equal(testcase.expectedPath, path))
})
}
}

View File

@ -21,8 +21,9 @@ import (
)
type createOptions struct {
name string
platform string
name string
platform string
untrusted bool
}
// NewCreateCommand creates a new cobra.Command for `docker create`
@ -53,7 +54,7 @@ func NewCreateCommand(dockerCli command.Cli) *cobra.Command {
flags.Bool("help", false, "Print usage")
command.AddPlatformFlag(flags, &opts.platform)
command.AddTrustVerificationFlags(flags)
command.AddTrustVerificationFlags(flags, &opts.untrusted, dockerCli.ContentTrustEnabled())
copts = addFlags(flags)
return cmd
}
@ -64,7 +65,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, opts.platform)
response, err := createContainer(context.Background(), dockerCli, containerConfig, opts)
if err != nil {
return err
}
@ -158,7 +159,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, platform string) (*container.ContainerCreateCreatedBody, error) {
func createContainer(ctx context.Context, dockerCli command.Cli, containerConfig *containerConfig, opts *createOptions) (*container.ContainerCreateCreatedBody, error) {
config := containerConfig.Config
hostConfig := containerConfig.HostConfig
networkingConfig := containerConfig.NetworkingConfig
@ -182,7 +183,7 @@ func createContainer(ctx context.Context, dockerCli command.Cli, containerConfig
if named, ok := ref.(reference.Named); ok {
namedRef = reference.TagNameOnly(named)
if taggedRef, ok := namedRef.(reference.NamedTagged); ok && command.IsTrusted() {
if taggedRef, ok := namedRef.(reference.NamedTagged); ok && !opts.untrusted {
var err error
trustedRef, err = image.TrustedReference(ctx, dockerCli, taggedRef, nil)
if err != nil {
@ -193,7 +194,7 @@ func createContainer(ctx context.Context, dockerCli command.Cli, containerConfig
}
//create the container
response, err := dockerCli.Client().ContainerCreate(ctx, config, hostConfig, networkingConfig, name)
response, err := dockerCli.Client().ContainerCreate(ctx, config, hostConfig, networkingConfig, opts.name)
//if image not found try to pull it
if err != nil {
@ -201,7 +202,7 @@ func createContainer(ctx context.Context, dockerCli command.Cli, containerConfig
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, platform, stderr); err != nil {
if err := pullImage(ctx, dockerCli, config.Image, opts.platform, stderr); err != nil {
return nil, err
}
if taggedRef, ok := namedRef.(reference.NamedTagged); ok && trustedRef != nil {
@ -211,7 +212,7 @@ func createContainer(ctx context.Context, dockerCli command.Cli, containerConfig
}
// Retry
var retryErr error
response, retryErr = dockerCli.Client().ContainerCreate(ctx, config, hostConfig, networkingConfig, name)
response, retryErr = dockerCli.Client().ContainerCreate(ctx, config, hostConfig, networkingConfig, opts.name)
if retryErr != nil {
return nil, retryErr
}

View File

@ -2,6 +2,7 @@ package container
import (
"context"
"fmt"
"io"
"io/ioutil"
"os"
@ -10,23 +11,24 @@ import (
"testing"
"github.com/docker/cli/internal/test"
"github.com/docker/cli/internal/test/testutil"
"github.com/docker/cli/internal/test/notary"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/network"
"github.com/google/go-cmp/cmp"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/gotestyourself/gotestyourself/fs"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestCIDFileNoOPWithNoFilename(t *testing.T) {
file, err := newCIDFile("")
require.NoError(t, err)
assert.Equal(t, &cidFile{}, file)
assert.NilError(t, err)
assert.DeepEqual(t, &cidFile{}, file, cmp.AllowUnexported(cidFile{}))
assert.NoError(t, file.Write("id"))
assert.NoError(t, file.Close())
assert.NilError(t, file.Write("id"))
assert.NilError(t, file.Close())
}
func TestNewCIDFileWhenFileAlreadyExists(t *testing.T) {
@ -34,7 +36,7 @@ func TestNewCIDFileWhenFileAlreadyExists(t *testing.T) {
defer tempfile.Remove()
_, err := newCIDFile(tempfile.Path())
testutil.ErrorContains(t, err, "Container ID file found")
assert.ErrorContains(t, err, "Container ID file found")
}
func TestCIDFileCloseWithNoWrite(t *testing.T) {
@ -43,12 +45,12 @@ func TestCIDFileCloseWithNoWrite(t *testing.T) {
path := tempdir.Join("cidfile")
file, err := newCIDFile(path)
require.NoError(t, err)
assert.Equal(t, file.path, path)
assert.NilError(t, err)
assert.Check(t, is.Equal(file.path, path))
assert.NoError(t, file.Close())
assert.NilError(t, file.Close())
_, err = os.Stat(path)
assert.True(t, os.IsNotExist(err))
assert.Check(t, os.IsNotExist(err))
}
func TestCIDFileCloseWithWrite(t *testing.T) {
@ -57,18 +59,18 @@ func TestCIDFileCloseWithWrite(t *testing.T) {
path := tempdir.Join("cidfile")
file, err := newCIDFile(path)
require.NoError(t, err)
assert.NilError(t, err)
content := "id"
assert.NoError(t, file.Write(content))
assert.NilError(t, file.Write(content))
actual, err := ioutil.ReadFile(path)
require.NoError(t, err)
assert.Equal(t, content, string(actual))
assert.NilError(t, err)
assert.Check(t, is.Equal(content, string(actual)))
assert.NoError(t, file.Close())
assert.NilError(t, file.Close())
_, err = os.Stat(path)
require.NoError(t, err)
assert.NilError(t, err)
}
func TestCreateContainerPullsImageIfMissing(t *testing.T) {
@ -107,12 +109,61 @@ func TestCreateContainerPullsImageIfMissing(t *testing.T) {
},
HostConfig: &container.HostConfig{},
}
body, err := createContainer(context.Background(), cli, config, "name", runtime.GOOS)
require.NoError(t, err)
body, err := createContainer(context.Background(), cli, config, &createOptions{
name: "name",
platform: runtime.GOOS,
untrusted: true,
})
assert.NilError(t, err)
expected := container.ContainerCreateCreatedBody{ID: containerID}
assert.Equal(t, expected, *body)
assert.Check(t, is.DeepEqual(expected, *body))
stderr := cli.ErrBuffer().String()
assert.Contains(t, stderr, "Unable to find image 'does-not-exist-locally:latest' locally")
assert.Check(t, is.Contains(stderr, "Unable to find image 'does-not-exist-locally:latest' locally"))
}
func TestNewCreateCommandWithContentTrustErrors(t *testing.T) {
testCases := []struct {
name string
args []string
expectedError string
notaryFunc test.NotaryClientFuncType
}{
{
name: "offline-notary-server",
notaryFunc: notary.GetOfflineNotaryRepository,
expectedError: "client is offline",
args: []string{"image:tag"},
},
{
name: "uninitialized-notary-server",
notaryFunc: notary.GetUninitializedNotaryRepository,
expectedError: "remote trust data does not exist",
args: []string{"image:tag"},
},
{
name: "empty-notary-server",
notaryFunc: notary.GetEmptyTargetsNotaryRepository,
expectedError: "No valid trust data for tag",
args: []string{"image:tag"},
},
}
for _, tc := range testCases {
cli := test.NewFakeCli(&fakeClient{
createContainerFunc: func(config *container.Config,
hostConfig *container.HostConfig,
networkingConfig *network.NetworkingConfig,
containerName string,
) (container.ContainerCreateCreatedBody, error) {
return container.ContainerCreateCreatedBody{}, fmt.Errorf("shouldn't try to pull image")
},
}, test.EnableContentTrust)
cli.SetNotaryClient(tc.notaryFunc)
cmd := NewCreateCommand(cli)
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
err := cmd.Execute()
assert.ErrorContains(t, err, tc.expectedError)
}
}
type fakeNotFound struct{}

View File

@ -7,11 +7,11 @@ import (
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/config/configfile"
"github.com/docker/cli/internal/test"
"github.com/docker/cli/internal/test/testutil"
"github.com/docker/cli/opts"
"github.com/docker/docker/api/types"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"golang.org/x/net/context"
)
@ -106,7 +106,7 @@ func TestParseExec(t *testing.T) {
for _, testcase := range testcases {
execConfig := parseExec(testcase.options, &testcase.configFile)
assert.Equal(t, testcase.expected, *execConfig)
assert.Check(t, is.DeepEqual(testcase.expected, *execConfig))
}
}
@ -150,14 +150,14 @@ func TestRunExec(t *testing.T) {
err := runExec(cli, testcase.options)
if testcase.expectedError != "" {
testutil.ErrorContains(t, err, testcase.expectedError)
assert.ErrorContains(t, err, testcase.expectedError)
} else {
if !assert.NoError(t, err) {
if !assert.Check(t, err) {
return
}
}
assert.Equal(t, testcase.expectedOut, cli.OutBuffer().String())
assert.Equal(t, testcase.expectedErr, cli.ErrBuffer().String())
assert.Check(t, is.Equal(testcase.expectedOut, cli.OutBuffer().String()))
assert.Check(t, is.Equal(testcase.expectedErr, cli.ErrBuffer().String()))
})
}
}
@ -192,12 +192,12 @@ func TestGetExecExitStatus(t *testing.T) {
for _, testcase := range testcases {
client := &fakeClient{
execInspectFunc: func(id string) (types.ContainerExecInspect, error) {
assert.Equal(t, execID, id)
assert.Check(t, is.Equal(execID, id))
return types.ContainerExecInspect{ExitCode: testcase.exitCode}, testcase.inspectError
},
}
err := getExecExitStatus(context.Background(), client, execID)
assert.Equal(t, testcase.expectedError, err)
assert.Check(t, is.Equal(testcase.expectedError, err))
}
}
@ -222,6 +222,6 @@ func TestNewExecCommandErrors(t *testing.T) {
cmd := NewExecCommand(cli)
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
testutil.ErrorContains(t, cmd.Execute(), tc.expectedError)
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
}
}

View File

@ -0,0 +1,164 @@
package container
import (
"fmt"
"io/ioutil"
"testing"
"github.com/docker/cli/cli/config/configfile"
"github.com/docker/cli/internal/test"
"github.com/docker/docker/api/types"
// Import builders to get the builder function as package function
. "github.com/docker/cli/internal/test/builders"
"github.com/gotestyourself/gotestyourself/assert"
"github.com/gotestyourself/gotestyourself/golden"
)
func TestContainerListErrors(t *testing.T) {
testCases := []struct {
args []string
flags map[string]string
containerListFunc func(types.ContainerListOptions) ([]types.Container, error)
expectedError string
}{
{
flags: map[string]string{
"format": "{{invalid}}",
},
expectedError: `function "invalid" not defined`,
},
{
flags: map[string]string{
"format": "{{join}}",
},
expectedError: `wrong number of args for join`,
},
{
containerListFunc: func(_ types.ContainerListOptions) ([]types.Container, error) {
return nil, fmt.Errorf("error listing containers")
},
expectedError: "error listing containers",
},
}
for _, tc := range testCases {
cmd := newListCommand(
test.NewFakeCli(&fakeClient{
containerListFunc: tc.containerListFunc,
}),
)
cmd.SetArgs(tc.args)
for key, value := range tc.flags {
cmd.Flags().Set(key, value)
}
cmd.SetOutput(ioutil.Discard)
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
}
}
func TestContainerListWithoutFormat(t *testing.T) {
cli := test.NewFakeCli(&fakeClient{
containerListFunc: func(_ types.ContainerListOptions) ([]types.Container, error) {
return []types.Container{
*Container("c1"),
*Container("c2", WithName("foo")),
*Container("c3", WithPort(80, 80, TCP), WithPort(81, 81, TCP), WithPort(82, 82, TCP)),
*Container("c4", WithPort(81, 81, UDP)),
*Container("c5", WithPort(82, 82, IP("8.8.8.8"), TCP)),
}, nil
},
})
cmd := newListCommand(cli)
assert.NilError(t, cmd.Execute())
golden.Assert(t, cli.OutBuffer().String(), "container-list-without-format.golden")
}
func TestContainerListNoTrunc(t *testing.T) {
cli := test.NewFakeCli(&fakeClient{
containerListFunc: func(_ types.ContainerListOptions) ([]types.Container, error) {
return []types.Container{
*Container("c1"),
*Container("c2", WithName("foo/bar")),
}, nil
},
})
cmd := newListCommand(cli)
cmd.Flags().Set("no-trunc", "true")
assert.NilError(t, cmd.Execute())
golden.Assert(t, cli.OutBuffer().String(), "container-list-without-format-no-trunc.golden")
}
// Test for GitHub issue docker/docker#21772
func TestContainerListNamesMultipleTime(t *testing.T) {
cli := test.NewFakeCli(&fakeClient{
containerListFunc: func(_ types.ContainerListOptions) ([]types.Container, error) {
return []types.Container{
*Container("c1"),
*Container("c2", WithName("foo/bar")),
}, nil
},
})
cmd := newListCommand(cli)
cmd.Flags().Set("format", "{{.Names}} {{.Names}}")
assert.NilError(t, cmd.Execute())
golden.Assert(t, cli.OutBuffer().String(), "container-list-format-name-name.golden")
}
// Test for GitHub issue docker/docker#30291
func TestContainerListFormatTemplateWithArg(t *testing.T) {
cli := test.NewFakeCli(&fakeClient{
containerListFunc: func(_ types.ContainerListOptions) ([]types.Container, error) {
return []types.Container{
*Container("c1", WithLabel("some.label", "value")),
*Container("c2", WithName("foo/bar"), WithLabel("foo", "bar")),
}, nil
},
})
cmd := newListCommand(cli)
cmd.Flags().Set("format", `{{.Names}} {{.Label "some.label"}}`)
assert.NilError(t, cmd.Execute())
golden.Assert(t, cli.OutBuffer().String(), "container-list-format-with-arg.golden")
}
func TestContainerListFormatSizeSetsOption(t *testing.T) {
cli := test.NewFakeCli(&fakeClient{
containerListFunc: func(options types.ContainerListOptions) ([]types.Container, error) {
assert.Check(t, options.Size)
return []types.Container{}, nil
},
})
cmd := newListCommand(cli)
cmd.Flags().Set("format", `{{.Size}}`)
assert.NilError(t, cmd.Execute())
}
func TestContainerListWithConfigFormat(t *testing.T) {
cli := test.NewFakeCli(&fakeClient{
containerListFunc: func(_ types.ContainerListOptions) ([]types.Container, error) {
return []types.Container{
*Container("c1", WithLabel("some.label", "value")),
*Container("c2", WithName("foo/bar"), WithLabel("foo", "bar")),
}, nil
},
})
cli.SetConfigFile(&configfile.ConfigFile{
PsFormat: "{{ .Names }} {{ .Image }} {{ .Labels }}",
})
cmd := newListCommand(cli)
assert.NilError(t, cmd.Execute())
golden.Assert(t, cli.OutBuffer().String(), "container-list-with-config-format.golden")
}
func TestContainerListWithFormat(t *testing.T) {
cli := test.NewFakeCli(&fakeClient{
containerListFunc: func(_ types.ContainerListOptions) ([]types.Container, error) {
return []types.Container{
*Container("c1", WithLabel("some.label", "value")),
*Container("c2", WithName("foo/bar"), WithLabel("foo", "bar")),
}, nil
},
})
cmd := newListCommand(cli)
cmd.Flags().Set("format", "{{ .Names }} {{ .Image }} {{ .Labels }}")
assert.NilError(t, cmd.Execute())
golden.Assert(t, cli.OutBuffer().String(), "container-list-with-format.golden")
}

View File

@ -7,10 +7,10 @@ import (
"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"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
)
var logFn = func(expectedOut string) func(string, types.ContainerLogsOptions) (io.ReadCloser, error) {
@ -49,14 +49,14 @@ func TestRunLogs(t *testing.T) {
err := runLogs(cli, testcase.options)
if testcase.expectedError != "" {
testutil.ErrorContains(t, err, testcase.expectedError)
assert.ErrorContains(t, err, testcase.expectedError)
} else {
if !assert.NoError(t, err) {
if !assert.Check(t, err) {
return
}
}
assert.Equal(t, testcase.expectedOut, cli.OutBuffer().String())
assert.Equal(t, testcase.expectedErr, cli.ErrBuffer().String())
assert.Check(t, is.Equal(testcase.expectedOut, cli.OutBuffer().String()))
assert.Check(t, is.Equal(testcase.expectedErr, cli.ErrBuffer().String()))
})
}
}

View File

@ -145,7 +145,7 @@ func addFlags(flags *pflag.FlagSet) *containerOptions {
expose: opts.NewListOpts(nil),
extraHosts: opts.NewListOpts(opts.ValidateExtraHost),
groupAdd: opts.NewListOpts(nil),
labels: opts.NewListOpts(opts.ValidateEnv),
labels: opts.NewListOpts(nil),
labelsFile: opts.NewListOpts(nil),
linkLocalIPs: opts.NewListOpts(nil),
links: opts.NewListOpts(opts.ValidateLink),
@ -410,7 +410,7 @@ func parse(flags *pflag.FlagSet, copts *containerOptions) (*containerConfig, err
}
// collect all the environment variables for the container
envVariables, err := opts.ReadKVStrings(copts.envFile.GetAll(), copts.env.GetAll())
envVariables, err := opts.ReadKVEnvStrings(copts.envFile.GetAll(), copts.env.GetAll())
if err != nil {
return nil, err
}

View File

@ -9,14 +9,13 @@ import (
"testing"
"time"
"github.com/docker/cli/internal/test/testutil"
"github.com/docker/docker/api/types/container"
networktypes "github.com/docker/docker/api/types/network"
"github.com/docker/go-connections/nat"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/pkg/errors"
"github.com/spf13/pflag"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestValidateAttach(t *testing.T) {
@ -67,12 +66,12 @@ func setupRunFlags() (*pflag.FlagSet, *containerOptions) {
func parseMustError(t *testing.T, args string) {
_, _, _, err := parseRun(strings.Split(args+" ubuntu bash", " "))
assert.Error(t, err, args)
assert.ErrorContains(t, err, "", args)
}
func mustParse(t *testing.T, args string) (*container.Config, *container.HostConfig) {
config, hostConfig, _, err := parseRun(append(strings.Split(args, " "), "ubuntu", "bash"))
assert.NoError(t, err)
assert.NilError(t, err)
return config, hostConfig
}
@ -236,23 +235,23 @@ 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`)
assert.ErrorContains(t, err, `invalid argument "invalid" for "-m, --memory" flag`)
_, hostconfig := mustParse(t, "--memory=1G")
assert.Equal(t, int64(1073741824), hostconfig.Memory)
assert.Check(t, is.Equal(int64(1073741824), hostconfig.Memory))
}
func TestParseWithMemorySwap(t *testing.T) {
flags, _ := setupRunFlags()
args := []string{"--memory-swap=invalid", "img", "cmd"}
err := flags.Parse(args)
testutil.ErrorContains(t, err, `invalid argument "invalid" for "--memory-swap" flag`)
assert.ErrorContains(t, err, `invalid argument "invalid" for "--memory-swap" flag`)
_, hostconfig := mustParse(t, "--memory-swap=1G")
assert.Equal(t, int64(1073741824), hostconfig.MemorySwap)
assert.Check(t, is.Equal(int64(1073741824), hostconfig.MemorySwap))
_, hostconfig = mustParse(t, "--memory-swap=-1")
assert.Equal(t, int64(-1), hostconfig.MemorySwap)
assert.Check(t, is.Equal(int64(-1), hostconfig.MemorySwap))
}
func TestParseHostname(t *testing.T) {
@ -373,24 +372,24 @@ func TestParseModes(t *testing.T) {
// pid ko
flags, copts := setupRunFlags()
args := []string{"--pid=container:", "img", "cmd"}
require.NoError(t, flags.Parse(args))
assert.NilError(t, flags.Parse(args))
_, err := parse(flags, copts)
testutil.ErrorContains(t, err, "--pid: invalid PID mode")
assert.ErrorContains(t, err, "--pid: invalid PID mode")
// pid ok
_, hostconfig, _, err := parseRun([]string{"--pid=host", "img", "cmd"})
require.NoError(t, err)
assert.NilError(t, err)
if !hostconfig.PidMode.Valid() {
t.Fatalf("Expected a valid PidMode, got %v", hostconfig.PidMode)
}
// uts ko
_, _, _, err = parseRun([]string{"--uts=container:", "img", "cmd"})
testutil.ErrorContains(t, err, "--uts: invalid UTS mode")
assert.ErrorContains(t, err, "--uts: invalid UTS mode")
// uts ok
_, hostconfig, _, err = parseRun([]string{"--uts=host", "img", "cmd"})
require.NoError(t, err)
assert.NilError(t, err)
if !hostconfig.UTSMode.Valid() {
t.Fatalf("Expected a valid UTSMode, got %v", hostconfig.UTSMode)
}
@ -402,11 +401,11 @@ func TestRunFlagsParseShmSize(t *testing.T) {
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)
assert.ErrorContains(t, err, expectedErr)
// shm-size ok
_, hostconfig, _, err := parseRun([]string{"--shm-size=128m", "img", "cmd"})
require.NoError(t, err)
assert.NilError(t, err)
if hostconfig.ShmSize != 134217728 {
t.Fatalf("Expected a valid ShmSize, got %d", hostconfig.ShmSize)
}

View File

@ -4,13 +4,14 @@ import (
"testing"
"github.com/docker/cli/opts"
"github.com/stretchr/testify/assert"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
)
func TestBuildContainerListOptions(t *testing.T) {
filters := opts.NewFilterOpt()
assert.NoError(t, filters.Set("foo=bar"))
assert.NoError(t, filters.Set("baz=foo"))
assert.NilError(t, filters.Set("foo=bar"))
assert.NilError(t, filters.Set("baz=foo"))
contexts := []struct {
psOpts *psOptions
@ -101,12 +102,12 @@ func TestBuildContainerListOptions(t *testing.T) {
for _, c := range contexts {
options, err := buildContainerListOptions(c.psOpts)
assert.NoError(t, err)
assert.NilError(t, err)
assert.Equal(t, c.expectedAll, options.All)
assert.Equal(t, c.expectedSize, options.Size)
assert.Equal(t, c.expectedLimit, options.Limit)
assert.Equal(t, len(c.expectedFilters), options.Filters.Len())
assert.Check(t, is.Equal(c.expectedAll, options.All))
assert.Check(t, is.Equal(c.expectedSize, options.Size))
assert.Check(t, is.Equal(c.expectedLimit, options.Limit))
assert.Check(t, is.Equal(len(c.expectedFilters), options.Filters.Len()))
for k, v := range c.expectedFilters {
f := options.Filters

View File

@ -25,11 +25,10 @@ import (
)
type runOptions struct {
createOptions
detach bool
sigProxy bool
name string
detachKeys string
platform string
}
// NewRunCommand create a new `docker run` command
@ -64,7 +63,7 @@ func NewRunCommand(dockerCli command.Cli) *cobra.Command {
flags.Bool("help", false, "Print usage")
command.AddPlatformFlag(flags, &opts.platform)
command.AddTrustVerificationFlags(flags)
command.AddTrustVerificationFlags(flags, &opts.untrusted, dockerCli.ContentTrustEnabled())
copts = addFlags(flags)
return cmd
}
@ -162,7 +161,7 @@ func runContainer(dockerCli command.Cli, opts *runOptions, copts *containerOptio
ctx, cancelFun := context.WithCancel(context.Background())
createResponse, err := createContainer(ctx, dockerCli, containerConfig, opts.name, opts.platform)
createResponse, err := createContainer(ctx, dockerCli, containerConfig, &opts.createOptions)
if err != nil {
reportError(stderr, cmdPath, err.Error(), true)
return runStartContainerErr(err)

View File

@ -0,0 +1,73 @@
package container
import (
"fmt"
"testing"
"github.com/docker/cli/internal/test"
"github.com/docker/cli/internal/test/notary"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/network"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
)
func TestRunLabel(t *testing.T) {
cli := test.NewFakeCli(&fakeClient{
createContainerFunc: func(_ *container.Config, _ *container.HostConfig, _ *network.NetworkingConfig, _ string) (container.ContainerCreateCreatedBody, error) {
return container.ContainerCreateCreatedBody{
ID: "id",
}, nil
},
Version: "1.36",
})
cmd := NewRunCommand(cli)
cmd.Flags().Set("detach", "true")
cmd.SetArgs([]string{"--label", "foo", "busybox"})
assert.NilError(t, cmd.Execute())
}
func TestRunCommandWithContentTrustErrors(t *testing.T) {
testCases := []struct {
name string
args []string
expectedError string
notaryFunc test.NotaryClientFuncType
}{
{
name: "offline-notary-server",
notaryFunc: notary.GetOfflineNotaryRepository,
expectedError: "client is offline",
args: []string{"image:tag"},
},
{
name: "uninitialized-notary-server",
notaryFunc: notary.GetUninitializedNotaryRepository,
expectedError: "remote trust data does not exist",
args: []string{"image:tag"},
},
{
name: "empty-notary-server",
notaryFunc: notary.GetEmptyTargetsNotaryRepository,
expectedError: "No valid trust data for tag",
args: []string{"image:tag"},
},
}
for _, tc := range testCases {
cli := test.NewFakeCli(&fakeClient{
createContainerFunc: func(config *container.Config,
hostConfig *container.HostConfig,
networkingConfig *network.NetworkingConfig,
containerName string,
) (container.ContainerCreateCreatedBody, error) {
return container.ContainerCreateCreatedBody{}, fmt.Errorf("shouldn't try to pull image")
},
}, test.EnableContentTrust)
cli.SetNotaryClient(tc.notaryFunc)
cmd := NewRunCommand(cli)
cmd.SetArgs(tc.args)
err := cmd.Execute()
assert.Assert(t, err != nil)
assert.Assert(t, is.Contains(cli.ErrBuffer().String(), tc.expectedError))
}
}

View File

@ -1,10 +1,11 @@
package container
import (
"fmt"
"testing"
"github.com/docker/docker/api/types"
"github.com/stretchr/testify/assert"
"github.com/gotestyourself/gotestyourself/assert"
)
func TestCalculateMemUsageUnixNoCache(t *testing.T) {
@ -15,7 +16,7 @@ func TestCalculateMemUsageUnixNoCache(t *testing.T) {
result := calculateMemUsageUnixNoCache(stats)
// Then
assert.InDelta(t, 100.0, result, 1e-6)
assert.Assert(t, inDelta(100.0, result, 1e-6))
}
func TestCalculateMemPercentUnixNoCache(t *testing.T) {
@ -27,10 +28,20 @@ func TestCalculateMemPercentUnixNoCache(t *testing.T) {
// When and Then
t.Run("Limit is set", func(t *testing.T) {
result := calculateMemPercentUnixNoCache(someLimit, used)
assert.InDelta(t, 70.0, result, 1e-6)
assert.Assert(t, inDelta(70.0, result, 1e-6))
})
t.Run("No limit, no cgroup data", func(t *testing.T) {
result := calculateMemPercentUnixNoCache(noLimit, used)
assert.InDelta(t, 0.0, result, 1e-6)
assert.Assert(t, inDelta(0.0, result, 1e-6))
})
}
func inDelta(x, y, delta float64) func() (bool, string) {
return func() (bool, string) {
diff := x - y
if diff < -delta || diff > delta {
return false, fmt.Sprintf("%f != %f within %f", x, y, delta)
}
return true, ""
}
}

View File

@ -0,0 +1,2 @@
c1 c1
c2 c2

View File

@ -0,0 +1,2 @@
c1 value
c2

View File

@ -0,0 +1,2 @@
c1 busybox:latest some.label=value
c2 busybox:latest foo=bar

View File

@ -0,0 +1,2 @@
c1 busybox:latest some.label=value
c2 busybox:latest foo=bar

View File

@ -0,0 +1,3 @@
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
container_id busybox:latest "top" Less than a second ago Up 1 second c1
container_id busybox:latest "top" Less than a second ago Up 1 second c2,foo/bar

View File

@ -0,0 +1,6 @@
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
container_id busybox:latest "top" Less than a second ago Up 1 second c1
container_id busybox:latest "top" Less than a second ago Up 1 second c2
container_id busybox:latest "top" Less than a second ago Up 1 second 80-82/tcp c3
container_id busybox:latest "top" Less than a second ago Up 1 second 81/udp c4
container_id busybox:latest "top" Less than a second ago Up 1 second 8.8.8.8:82->82/tcp c5

View File

@ -37,7 +37,12 @@ func waitExitOrRemoved(ctx context.Context, dockerCli command.Cli, containerID s
go func() {
select {
case result := <-resultC:
statusC <- int(result.StatusCode)
if result.Error != nil {
logrus.Errorf("Error waiting for container: %v", result.Error.Message)
statusC <- 125
} else {
statusC <- int(result.StatusCode)
}
case err := <-errC:
logrus.Errorf("error waiting for container: %v", err)
statusC <- 125

View File

@ -0,0 +1,70 @@
package container
import (
"strings"
"testing"
"github.com/docker/cli/internal/test"
"github.com/docker/docker/api"
"github.com/docker/docker/api/types/container"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/pkg/errors"
"golang.org/x/net/context"
)
func waitFn(cid string) (<-chan container.ContainerWaitOKBody, <-chan error) {
resC := make(chan container.ContainerWaitOKBody)
errC := make(chan error, 1)
var res container.ContainerWaitOKBody
go func() {
switch {
case strings.Contains(cid, "exit-code-42"):
res.StatusCode = 42
resC <- res
case strings.Contains(cid, "non-existent"):
err := errors.Errorf("No such container: %v", cid)
errC <- err
case strings.Contains(cid, "wait-error"):
res.Error = &container.ContainerWaitOKBodyError{Message: "removal failed"}
resC <- res
default:
// normal exit
resC <- res
}
}()
return resC, errC
}
func TestWaitExitOrRemoved(t *testing.T) {
testcases := []struct {
cid string
exitCode int
}{
{
cid: "normal-container",
exitCode: 0,
},
{
cid: "give-me-exit-code-42",
exitCode: 42,
},
{
cid: "i-want-a-wait-error",
exitCode: 125,
},
{
cid: "non-existent-container-id",
exitCode: 125,
},
}
client := test.NewFakeCli(&fakeClient{waitFunc: waitFn, Version: api.DefaultVersion})
for _, testcase := range testcases {
statusC := waitExitOrRemoved(context.Background(), client, testcase.cid, true)
exitCode := <-statusC
assert.Check(t, is.Equal(testcase.exitCode, exitCode))
}
}

View File

@ -5,7 +5,7 @@ import (
"testing"
"github.com/docker/docker/api/types"
"github.com/stretchr/testify/assert"
"github.com/gotestyourself/gotestyourself/assert"
)
func TestCheckpointContextFormatWrite(t *testing.T) {
@ -46,10 +46,7 @@ checkpoint-3:
out := bytes.NewBufferString("")
testcase.context.Output = out
err := CheckpointWrite(testcase.context, checkpoints)
if err != nil {
assert.Error(t, err, testcase.expected)
} else {
assert.Equal(t, out.String(), testcase.expected)
}
assert.NilError(t, err)
assert.Equal(t, out.String(), testcase.expected)
}
}

View File

@ -6,7 +6,8 @@ import (
"time"
"github.com/docker/docker/api/types/swarm"
"github.com/stretchr/testify/assert"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
)
func TestConfigContextFormatWrite(t *testing.T) {
@ -55,9 +56,9 @@ id_rsa
out := bytes.NewBufferString("")
testcase.context.Output = out
if err := ConfigWrite(testcase.context, configs); err != nil {
assert.Error(t, err, testcase.expected)
assert.ErrorContains(t, err, testcase.expected)
} else {
assert.Equal(t, out.String(), testcase.expected)
assert.Check(t, is.Equal(out.String(), testcase.expected))
}
}
}

View File

@ -10,9 +10,9 @@ import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/stringid"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/gotestyourself/gotestyourself/golden"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestContainerPsContext(t *testing.T) {
@ -244,9 +244,9 @@ size: 0B
testcase.context.Output = out
err := ContainerWrite(testcase.context, containers)
if err != nil {
assert.EqualError(t, err, testcase.expected)
assert.Error(t, err, testcase.expected)
} else {
assert.Equal(t, testcase.expected, out.String())
assert.Check(t, is.Equal(testcase.expected, out.String()))
}
}
}
@ -305,7 +305,7 @@ func TestContainerContextWriteWithNoContainers(t *testing.T) {
for _, context := range contexts {
ContainerWrite(context.context, containers)
assert.Equal(t, context.expected, out.String())
assert.Check(t, is.Equal(context.expected, out.String()))
// Clean buffer
out.Reset()
}
@ -359,8 +359,8 @@ func TestContainerContextWriteJSON(t *testing.T) {
msg := fmt.Sprintf("Output: line %d: %s", i, line)
var m map[string]interface{}
err := json.Unmarshal([]byte(line), &m)
require.NoError(t, err, msg)
assert.Equal(t, expectedJSONs[i], m, msg)
assert.NilError(t, err, msg)
assert.Check(t, is.DeepEqual(expectedJSONs[i], m), msg)
}
}
@ -378,8 +378,8 @@ func TestContainerContextWriteJSONField(t *testing.T) {
msg := fmt.Sprintf("Output: line %d: %s", i, line)
var s string
err := json.Unmarshal([]byte(line), &s)
require.NoError(t, err, msg)
assert.Equal(t, containers[i].ID, s, msg)
assert.NilError(t, err, msg)
assert.Check(t, is.Equal(containers[i].ID, s), msg)
}
}
@ -642,14 +642,17 @@ func TestDisplayablePorts(t *testing.T) {
PublicPort: 1024,
PrivatePort: 80,
Type: "udp",
}, {
PrivatePort: 12345,
Type: "sctp",
},
},
"80/tcp, 80/udp, 1024/tcp, 1024/udp, 1.1.1.1:1024->80/tcp, 1.1.1.1:1024->80/udp, 2.1.1.1:1024->80/tcp, 2.1.1.1:1024->80/udp, 1.1.1.1:80->1024/tcp, 1.1.1.1:80->1024/udp, 2.1.1.1:80->1024/tcp, 2.1.1.1:80->1024/udp",
"80/tcp, 80/udp, 1024/tcp, 1024/udp, 12345/sctp, 1.1.1.1:1024->80/tcp, 1.1.1.1:1024->80/udp, 2.1.1.1:1024->80/tcp, 2.1.1.1:1024->80/udp, 1.1.1.1:80->1024/tcp, 1.1.1.1:80->1024/udp, 2.1.1.1:80->1024/tcp, 2.1.1.1:80->1024/udp",
},
}
for _, port := range cases {
actual := DisplayablePorts(port.ports)
assert.Equal(t, port.expected, actual)
assert.Check(t, is.Equal(port.expected, actual))
}
}

View File

@ -4,7 +4,8 @@ import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
)
func compareMultipleValues(t *testing.T, value, expected string) {
@ -23,5 +24,5 @@ func compareMultipleValues(t *testing.T, value, expected string) {
keyval := strings.Split(expected, "=")
expMap[keyval[0]] = keyval[1]
}
assert.Equal(t, expMap, entriesMap)
assert.Check(t, is.DeepEqual(expMap, entriesMap))
}

View File

@ -6,7 +6,8 @@ import (
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/pkg/archive"
"github.com/stretchr/testify/assert"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
)
func TestDiffContextFormatWrite(t *testing.T) {
@ -51,9 +52,9 @@ D: /usr/app/old_app.js
testcase.context.Output = out
err := DiffWrite(testcase.context, diffs)
if err != nil {
assert.EqualError(t, err, testcase.expected)
assert.Error(t, err, testcase.expected)
} else {
assert.Equal(t, testcase.expected, out.String())
assert.Check(t, is.Equal(testcase.expected, out.String()))
}
}
}

View File

@ -4,8 +4,9 @@ import (
"bytes"
"testing"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/gotestyourself/gotestyourself/golden"
"github.com/stretchr/testify/assert"
)
func TestDiskUsageContextFormatWrite(t *testing.T) {
@ -101,9 +102,9 @@ Build Cache 0B
out := bytes.NewBufferString("")
testcase.context.Output = out
if err := testcase.context.Write(); err != nil {
assert.Equal(t, testcase.expected, err.Error())
assert.Check(t, is.Equal(testcase.expected, err.Error()))
} else {
assert.Equal(t, testcase.expected, out.String())
assert.Check(t, is.Equal(testcase.expected, out.String()))
}
}
}

View File

@ -3,7 +3,8 @@ package formatter
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
)
func TestEllipsis(t *testing.T) {
@ -25,6 +26,6 @@ func TestEllipsis(t *testing.T) {
}
for _, testcase := range testcases {
assert.Equal(t, testcase.expected, Ellipsis(testcase.source, testcase.width))
assert.Check(t, is.Equal(testcase.expected, Ellipsis(testcase.source, testcase.width)))
}
}

View File

@ -1,16 +1,16 @@
package formatter
import (
"bytes"
"strconv"
"strings"
"testing"
"time"
"bytes"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/pkg/stringid"
"github.com/stretchr/testify/assert"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
)
type historyCase struct {
@ -50,6 +50,7 @@ func TestHistoryContext_ID(t *testing.T) {
}
func TestHistoryContext_CreatedSince(t *testing.T) {
dateStr := "2009-11-10T23:00:00Z"
var ctx historyContext
cases := []historyCase{
{
@ -64,7 +65,7 @@ func TestHistoryContext_CreatedSince(t *testing.T) {
h: image.HistoryResponseItem{Created: time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC).Unix()},
trunc: false,
human: false,
}, "2009-11-10T23:00:00Z", ctx.CreatedSince,
}, dateStr, ctx.CreatedSince,
},
}
@ -218,7 +219,7 @@ imageID4 24 hours ago /bin/bash grep
for _, context := range contexts {
HistoryWrite(context.context, true, histories)
assert.Equal(t, context.expected, out.String())
assert.Check(t, is.Equal(context.expected, out.String()))
// Clean buffer
out.Reset()
}

View File

@ -9,7 +9,8 @@ import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/stringid"
"github.com/stretchr/testify/assert"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
)
func TestImageContext(t *testing.T) {
@ -83,7 +84,7 @@ func TestImageContext(t *testing.T) {
if strings.Contains(v, ",") {
compareMultipleValues(t, v, c.expValue)
} else {
assert.Equal(t, c.expValue, v)
assert.Check(t, is.Equal(c.expValue, v))
}
}
}
@ -293,9 +294,9 @@ image_id: imageID3
testcase.context.Output = out
err := ImageWrite(testcase.context, images)
if err != nil {
assert.EqualError(t, err, testcase.expected)
assert.Error(t, err, testcase.expected)
} else {
assert.Equal(t, testcase.expected, out.String())
assert.Check(t, is.Equal(testcase.expected, out.String()))
}
}
}
@ -348,7 +349,7 @@ func TestImageContextWriteWithNoImage(t *testing.T) {
for _, context := range contexts {
ImageWrite(context.context, images)
assert.Equal(t, context.expected, out.String())
assert.Check(t, is.Equal(context.expected, out.String()))
// Clean buffer
out.Reset()
}

View File

@ -10,8 +10,8 @@ import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/stringid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
)
func TestNetworkContext(t *testing.T) {
@ -162,9 +162,9 @@ foobar_bar 2017-01-01 00:00:00 +0000 UTC
testcase.context.Output = out
err := NetworkWrite(testcase.context, networks)
if err != nil {
assert.EqualError(t, err, testcase.expected)
assert.Error(t, err, testcase.expected)
} else {
assert.Equal(t, testcase.expected, out.String())
assert.Check(t, is.Equal(testcase.expected, out.String()))
}
}
}
@ -188,8 +188,8 @@ func TestNetworkContextWriteJSON(t *testing.T) {
msg := fmt.Sprintf("Output: line %d: %s", i, line)
var m map[string]interface{}
err := json.Unmarshal([]byte(line), &m)
require.NoError(t, err, msg)
assert.Equal(t, expectedJSONs[i], m, msg)
assert.NilError(t, err, msg)
assert.Check(t, is.DeepEqual(expectedJSONs[i], m), msg)
}
}
@ -207,7 +207,7 @@ func TestNetworkContextWriteJSONField(t *testing.T) {
msg := fmt.Sprintf("Output: line %d: %s", i, line)
var s string
err := json.Unmarshal([]byte(line), &s)
require.NoError(t, err, msg)
assert.Equal(t, networks[i].ID, s, msg)
assert.NilError(t, err, msg)
assert.Check(t, is.Equal(networks[i].ID, s), msg)
}
}

View File

@ -14,7 +14,7 @@ import (
)
const (
defaultNodeTableFormat = "table {{.ID}} {{if .Self}}*{{else}} {{ end }}\t{{.Hostname}}\t{{.Status}}\t{{.Availability}}\t{{.ManagerStatus}}"
defaultNodeTableFormat = "table {{.ID}} {{if .Self}}*{{else}} {{ end }}\t{{.Hostname}}\t{{.Status}}\t{{.Availability}}\t{{.ManagerStatus}}\t{{.EngineVersion}}"
nodeInspectPrettyTemplate Format = `ID: {{.ID}}
{{- if .Name }}
Name: {{.Name}}
@ -75,6 +75,7 @@ TLS Info:
hostnameHeader = "HOSTNAME"
availabilityHeader = "AVAILABILITY"
managerStatusHeader = "MANAGER STATUS"
engineVersionHeader = "ENGINE VERSION"
tlsStatusHeader = "TLS STATUS"
)
@ -115,6 +116,7 @@ func NodeWrite(ctx Context, nodes []swarm.Node, info types.Info) error {
"Status": statusHeader,
"Availability": availabilityHeader,
"ManagerStatus": managerStatusHeader,
"EngineVersion": engineVersionHeader,
"TLSStatus": tlsStatusHeader,
}
nodeCtx := nodeContext{}
@ -176,6 +178,10 @@ func (c *nodeContext) TLSStatus() string {
return "Needs Rotation"
}
func (c *nodeContext) EngineVersion() string {
return c.n.Description.Engine.EngineVersion
}
// NodeInspectWrite renders the context for a list of nodes
func NodeInspectWrite(ctx Context, refs []string, getRef inspect.GetRefFunc) error {
if ctx.Format != nodeInspectPrettyTemplate {

View File

@ -10,8 +10,8 @@ import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/swarm"
"github.com/docker/docker/pkg/stringid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
)
func TestNodeContext(t *testing.T) {
@ -74,10 +74,10 @@ func TestNodeContextWrite(t *testing.T) {
// Table format
{
context: Context{Format: NewNodeFormat("table", false)},
expected: `ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
nodeID1 foobar_baz Foo Drain Leader
nodeID2 foobar_bar Bar Active Reachable
nodeID3 foobar_boo Boo Active ` + "\n", // (to preserve whitespace)
expected: `ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS ENGINE VERSION
nodeID1 foobar_baz Foo Drain Leader 18.03.0-ce
nodeID2 foobar_bar Bar Active Reachable 1.2.3
nodeID3 foobar_boo Boo Active ` + "\n", // (to preserve whitespace)
clusterInfo: swarm.ClusterInfo{TLSInfo: swarm.TLSInfo{TrustRoot: "hi"}},
},
{
@ -172,6 +172,7 @@ foobar_boo Unknown
Description: swarm.NodeDescription{
Hostname: "foobar_baz",
TLSInfo: swarm.TLSInfo{TrustRoot: "no"},
Engine: swarm.EngineDescription{EngineVersion: "18.03.0-ce"},
},
Status: swarm.NodeStatus{State: swarm.NodeState("foo")},
Spec: swarm.NodeSpec{Availability: swarm.NodeAvailability("drain")},
@ -182,6 +183,7 @@ foobar_boo Unknown
Description: swarm.NodeDescription{
Hostname: "foobar_bar",
TLSInfo: swarm.TLSInfo{TrustRoot: "hi"},
Engine: swarm.EngineDescription{EngineVersion: "1.2.3"},
},
Status: swarm.NodeStatus{State: swarm.NodeState("bar")},
Spec: swarm.NodeSpec{Availability: swarm.NodeAvailability("active")},
@ -201,9 +203,9 @@ foobar_boo Unknown
testcase.context.Output = out
err := NodeWrite(testcase.context, nodes, types.Info{Swarm: swarm.Info{Cluster: &testcase.clusterInfo}})
if err != nil {
assert.EqualError(t, err, testcase.expected)
assert.Error(t, err, testcase.expected)
} else {
assert.Equal(t, testcase.expected, out.String())
assert.Check(t, is.Equal(testcase.expected, out.String()))
}
}
}
@ -215,17 +217,17 @@ func TestNodeContextWriteJSON(t *testing.T) {
}{
{
expected: []map[string]interface{}{
{"Availability": "", "Hostname": "foobar_baz", "ID": "nodeID1", "ManagerStatus": "", "Status": "", "Self": false, "TLSStatus": "Unknown"},
{"Availability": "", "Hostname": "foobar_bar", "ID": "nodeID2", "ManagerStatus": "", "Status": "", "Self": false, "TLSStatus": "Unknown"},
{"Availability": "", "Hostname": "foobar_boo", "ID": "nodeID3", "ManagerStatus": "", "Status": "", "Self": false, "TLSStatus": "Unknown"},
{"Availability": "", "Hostname": "foobar_baz", "ID": "nodeID1", "ManagerStatus": "", "Status": "", "Self": false, "TLSStatus": "Unknown", "EngineVersion": "1.2.3"},
{"Availability": "", "Hostname": "foobar_bar", "ID": "nodeID2", "ManagerStatus": "", "Status": "", "Self": false, "TLSStatus": "Unknown", "EngineVersion": ""},
{"Availability": "", "Hostname": "foobar_boo", "ID": "nodeID3", "ManagerStatus": "", "Status": "", "Self": false, "TLSStatus": "Unknown", "EngineVersion": "18.03.0-ce"},
},
info: types.Info{},
},
{
expected: []map[string]interface{}{
{"Availability": "", "Hostname": "foobar_baz", "ID": "nodeID1", "ManagerStatus": "", "Status": "", "Self": false, "TLSStatus": "Ready"},
{"Availability": "", "Hostname": "foobar_bar", "ID": "nodeID2", "ManagerStatus": "", "Status": "", "Self": false, "TLSStatus": "Needs Rotation"},
{"Availability": "", "Hostname": "foobar_boo", "ID": "nodeID3", "ManagerStatus": "", "Status": "", "Self": false, "TLSStatus": "Unknown"},
{"Availability": "", "Hostname": "foobar_baz", "ID": "nodeID1", "ManagerStatus": "", "Status": "", "Self": false, "TLSStatus": "Ready", "EngineVersion": "1.2.3"},
{"Availability": "", "Hostname": "foobar_bar", "ID": "nodeID2", "ManagerStatus": "", "Status": "", "Self": false, "TLSStatus": "Needs Rotation", "EngineVersion": ""},
{"Availability": "", "Hostname": "foobar_boo", "ID": "nodeID3", "ManagerStatus": "", "Status": "", "Self": false, "TLSStatus": "Unknown", "EngineVersion": "18.03.0-ce"},
},
info: types.Info{
Swarm: swarm.Info{
@ -240,9 +242,9 @@ func TestNodeContextWriteJSON(t *testing.T) {
for _, testcase := range cases {
nodes := []swarm.Node{
{ID: "nodeID1", Description: swarm.NodeDescription{Hostname: "foobar_baz", TLSInfo: swarm.TLSInfo{TrustRoot: "hi"}}},
{ID: "nodeID1", Description: swarm.NodeDescription{Hostname: "foobar_baz", TLSInfo: swarm.TLSInfo{TrustRoot: "hi"}, Engine: swarm.EngineDescription{EngineVersion: "1.2.3"}}},
{ID: "nodeID2", Description: swarm.NodeDescription{Hostname: "foobar_bar", TLSInfo: swarm.TLSInfo{TrustRoot: "no"}}},
{ID: "nodeID3", Description: swarm.NodeDescription{Hostname: "foobar_boo"}},
{ID: "nodeID3", Description: swarm.NodeDescription{Hostname: "foobar_boo", Engine: swarm.EngineDescription{EngineVersion: "18.03.0-ce"}}},
}
out := bytes.NewBufferString("")
err := NodeWrite(Context{Format: "{{json .}}", Output: out}, nodes, testcase.info)
@ -253,8 +255,8 @@ func TestNodeContextWriteJSON(t *testing.T) {
msg := fmt.Sprintf("Output: line %d: %s", i, line)
var m map[string]interface{}
err := json.Unmarshal([]byte(line), &m)
require.NoError(t, err, msg)
assert.Equal(t, testcase.expected[i], m, msg)
assert.NilError(t, err, msg)
assert.Check(t, is.DeepEqual(testcase.expected[i], m), msg)
}
}
}
@ -273,8 +275,8 @@ func TestNodeContextWriteJSONField(t *testing.T) {
msg := fmt.Sprintf("Output: line %d: %s", i, line)
var s string
err := json.Unmarshal([]byte(line), &s)
require.NoError(t, err, msg)
assert.Equal(t, nodes[i].ID, s, msg)
assert.NilError(t, err, msg)
assert.Check(t, is.Equal(nodes[i].ID, s), msg)
}
}
@ -342,5 +344,5 @@ data
Issuer Subject: c3ViamVjdA==
Issuer Public Key: cHViS2V5
`
assert.Equal(t, expected, out.String())
assert.Check(t, is.Equal(expected, out.String()))
}

View File

@ -8,7 +8,8 @@ import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/stringid"
"github.com/stretchr/testify/assert"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
)
func TestPluginContext(t *testing.T) {
@ -131,9 +132,9 @@ foobar_bar
testcase.context.Output = out
err := PluginWrite(testcase.context, plugins)
if err != nil {
assert.EqualError(t, err, testcase.expected)
assert.Error(t, err, testcase.expected)
} else {
assert.Equal(t, testcase.expected, out.String())
assert.Check(t, is.Equal(testcase.expected, out.String()))
}
}
}
@ -158,7 +159,7 @@ func TestPluginContextWriteJSON(t *testing.T) {
if err := json.Unmarshal([]byte(line), &m); err != nil {
t.Fatal(err)
}
assert.Equal(t, expectedJSONs[i], m)
assert.Check(t, is.DeepEqual(expectedJSONs[i], m))
}
}
@ -177,6 +178,6 @@ func TestPluginContextWriteJSONField(t *testing.T) {
if err := json.Unmarshal([]byte(line), &s); err != nil {
t.Fatal(err)
}
assert.Equal(t, plugins[i].ID, s)
assert.Check(t, is.Equal(plugins[i].ID, s))
}
}

View File

@ -7,8 +7,9 @@ import (
"testing"
registrytypes "github.com/docker/docker/api/types/registry"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/gotestyourself/gotestyourself/golden"
"github.com/stretchr/testify/assert"
)
func TestSearchContext(t *testing.T) {
@ -154,9 +155,9 @@ result2 5
testcase.context.Output = out
err := SearchWrite(testcase.context, results, false, 0)
if err != nil {
assert.Error(t, err, testcase.expected)
assert.Check(t, is.ErrorContains(err, testcase.expected))
} else {
assert.Equal(t, out.String(), testcase.expected)
assert.Check(t, is.Equal(out.String(), testcase.expected))
}
}
}
@ -191,9 +192,9 @@ result2
testcase.context.Output = out
err := SearchWrite(testcase.context, results, true, 0)
if err != nil {
assert.Error(t, err, testcase.expected)
assert.Check(t, is.ErrorContains(err, testcase.expected))
} else {
assert.Equal(t, out.String(), testcase.expected)
assert.Check(t, is.Equal(out.String(), testcase.expected))
}
}
}
@ -226,9 +227,9 @@ result1
testcase.context.Output = out
err := SearchWrite(testcase.context, results, false, 6)
if err != nil {
assert.Error(t, err, testcase.expected)
assert.Check(t, is.ErrorContains(err, testcase.expected))
} else {
assert.Equal(t, out.String(), testcase.expected)
assert.Check(t, is.Equal(out.String(), testcase.expected))
}
}
}
@ -254,7 +255,7 @@ func TestSearchContextWriteJSON(t *testing.T) {
if err := json.Unmarshal([]byte(line), &m); err != nil {
t.Fatal(err)
}
assert.Equal(t, m, expectedJSONs[i])
assert.Check(t, is.DeepEqual(m, expectedJSONs[i]))
}
}
@ -274,6 +275,6 @@ func TestSearchContextWriteJSONField(t *testing.T) {
if err := json.Unmarshal([]byte(line), &s); err != nil {
t.Fatal(err)
}
assert.Equal(t, s, results[i].Name)
assert.Check(t, is.Equal(s, results[i].Name))
}
}

View File

@ -6,7 +6,8 @@ import (
"time"
"github.com/docker/docker/api/types/swarm"
"github.com/stretchr/testify/assert"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
)
func TestSecretContextFormatWrite(t *testing.T) {
@ -55,9 +56,9 @@ id_rsa
out := bytes.NewBufferString("")
testcase.context.Output = out
if err := SecretWrite(testcase.context, secrets); err != nil {
assert.EqualError(t, err, testcase.expected)
assert.Error(t, err, testcase.expected)
} else {
assert.Equal(t, testcase.expected, out.String())
assert.Check(t, is.Equal(testcase.expected, out.String()))
}
}
}

View File

@ -2,6 +2,7 @@ package formatter
import (
"fmt"
"sort"
"strings"
"time"
@ -520,19 +521,95 @@ func (c *serviceContext) Image() string {
return image
}
type portRange struct {
pStart uint32
pEnd uint32
tStart uint32
tEnd uint32
protocol swarm.PortConfigProtocol
}
func (pr portRange) String() string {
var (
pub string
tgt string
)
if pr.pEnd > pr.pStart {
pub = fmt.Sprintf("%d-%d", pr.pStart, pr.pEnd)
} else {
pub = fmt.Sprintf("%d", pr.pStart)
}
if pr.tEnd > pr.tStart {
tgt = fmt.Sprintf("%d-%d", pr.tStart, pr.tEnd)
} else {
tgt = fmt.Sprintf("%d", pr.tStart)
}
return fmt.Sprintf("*:%s->%s/%s", pub, tgt, pr.protocol)
}
// Ports formats published ports on the ingress network for output.
//
// Where possible, ranges are grouped to produce a compact output:
// - multiple ports mapped to a single port (80->80, 81->80); is formatted as *:80-81->80
// - multiple consecutive ports on both sides; (80->80, 81->81) are formatted as: *:80-81->80-81
//
// The above should not be grouped together, i.e.:
// - 80->80, 81->81, 82->80 should be presented as : *:80-81->80-81, *:82->80
//
// TODO improve:
// - combine non-consecutive ports mapped to a single port (80->80, 81->80, 84->80, 86->80, 87->80); to be printed as *:80-81,84,86-87->80
// - combine tcp and udp mappings if their port-mapping is exactly the same (*:80-81->80-81/tcp+udp instead of *:80-81->80-81/tcp, *:80-81->80-81/udp)
func (c *serviceContext) Ports() string {
if c.service.Endpoint.Ports == nil {
return ""
}
pr := portRange{}
ports := []string{}
for _, pConfig := range c.service.Endpoint.Ports {
if pConfig.PublishMode == swarm.PortConfigPublishModeIngress {
ports = append(ports, fmt.Sprintf("*:%d->%d/%s",
pConfig.PublishedPort,
pConfig.TargetPort,
pConfig.Protocol,
))
sort.Sort(byProtocolAndPublishedPort(c.service.Endpoint.Ports))
for _, p := range c.service.Endpoint.Ports {
if p.PublishMode == swarm.PortConfigPublishModeIngress {
prIsRange := pr.tEnd != pr.tStart
tOverlaps := p.TargetPort <= pr.tEnd
// Start a new port-range if:
// - the protocol is different from the current port-range
// - published or target port are not consecutive to the current port-range
// - the current port-range is a _range_, and the target port overlaps with the current range's target-ports
if p.Protocol != pr.protocol || p.PublishedPort-pr.pEnd > 1 || p.TargetPort-pr.tEnd > 1 || prIsRange && tOverlaps {
// start a new port-range, and print the previous port-range (if any)
if pr.pStart > 0 {
ports = append(ports, pr.String())
}
pr = portRange{
pStart: p.PublishedPort,
pEnd: p.PublishedPort,
tStart: p.TargetPort,
tEnd: p.TargetPort,
protocol: p.Protocol,
}
continue
}
pr.pEnd = p.PublishedPort
pr.tEnd = p.TargetPort
}
}
return strings.Join(ports, ",")
if pr.pStart > 0 {
ports = append(ports, pr.String())
}
return strings.Join(ports, ", ")
}
type byProtocolAndPublishedPort []swarm.PortConfig
func (a byProtocolAndPublishedPort) Len() int { return len(a) }
func (a byProtocolAndPublishedPort) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a byProtocolAndPublishedPort) Less(i, j int) bool {
if a[i].Protocol == a[j].Protocol {
return a[i].PublishedPort < a[j].PublishedPort
}
return a[i].Protocol < a[j].Protocol
}

View File

@ -8,9 +8,9 @@ import (
"testing"
"github.com/docker/docker/api/types/swarm"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/gotestyourself/gotestyourself/golden"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestServiceContextWrite(t *testing.T) {
@ -126,9 +126,9 @@ bar
testcase.context.Output = out
err := ServiceListWrite(testcase.context, services, info)
if err != nil {
assert.EqualError(t, err, testcase.expected)
assert.Error(t, err, testcase.expected)
} else {
assert.Equal(t, testcase.expected, out.String())
assert.Check(t, is.Equal(testcase.expected, out.String()))
}
}
}
@ -192,8 +192,8 @@ func TestServiceContextWriteJSON(t *testing.T) {
msg := fmt.Sprintf("Output: line %d: %s", i, line)
var m map[string]interface{}
err := json.Unmarshal([]byte(line), &m)
require.NoError(t, err, msg)
assert.Equal(t, expectedJSONs[i], m, msg)
assert.NilError(t, err, msg)
assert.Check(t, is.DeepEqual(expectedJSONs[i], m), msg)
}
}
func TestServiceContextWriteJSONField(t *testing.T) {
@ -220,7 +220,140 @@ func TestServiceContextWriteJSONField(t *testing.T) {
msg := fmt.Sprintf("Output: line %d: %s", i, line)
var s string
err := json.Unmarshal([]byte(line), &s)
require.NoError(t, err, msg)
assert.Equal(t, services[i].Spec.Name, s, msg)
assert.NilError(t, err, msg)
assert.Check(t, is.Equal(services[i].Spec.Name, s), msg)
}
}
func TestServiceContext_Ports(t *testing.T) {
c := serviceContext{
service: swarm.Service{
Endpoint: swarm.Endpoint{
Ports: []swarm.PortConfig{
{
Protocol: "tcp",
TargetPort: 80,
PublishedPort: 81,
PublishMode: "ingress",
},
{
Protocol: "tcp",
TargetPort: 80,
PublishedPort: 80,
PublishMode: "ingress",
},
{
Protocol: "tcp",
TargetPort: 95,
PublishedPort: 95,
PublishMode: "ingress",
},
{
Protocol: "tcp",
TargetPort: 90,
PublishedPort: 90,
PublishMode: "ingress",
},
{
Protocol: "tcp",
TargetPort: 91,
PublishedPort: 91,
PublishMode: "ingress",
},
{
Protocol: "tcp",
TargetPort: 92,
PublishedPort: 92,
PublishMode: "ingress",
},
{
Protocol: "tcp",
TargetPort: 93,
PublishedPort: 93,
PublishMode: "ingress",
},
{
Protocol: "tcp",
TargetPort: 94,
PublishedPort: 94,
PublishMode: "ingress",
},
{
Protocol: "udp",
TargetPort: 95,
PublishedPort: 95,
PublishMode: "ingress",
},
{
Protocol: "udp",
TargetPort: 90,
PublishedPort: 90,
PublishMode: "ingress",
},
{
Protocol: "udp",
TargetPort: 96,
PublishedPort: 96,
PublishMode: "ingress",
},
{
Protocol: "udp",
TargetPort: 91,
PublishedPort: 91,
PublishMode: "ingress",
},
{
Protocol: "udp",
TargetPort: 92,
PublishedPort: 92,
PublishMode: "ingress",
},
{
Protocol: "udp",
TargetPort: 93,
PublishedPort: 93,
PublishMode: "ingress",
},
{
Protocol: "udp",
TargetPort: 94,
PublishedPort: 94,
PublishMode: "ingress",
},
{
Protocol: "tcp",
TargetPort: 60,
PublishedPort: 60,
PublishMode: "ingress",
},
{
Protocol: "tcp",
TargetPort: 61,
PublishedPort: 61,
PublishMode: "ingress",
},
{
Protocol: "tcp",
TargetPort: 61,
PublishedPort: 62,
PublishMode: "ingress",
},
{
Protocol: "sctp",
TargetPort: 97,
PublishedPort: 97,
PublishMode: "ingress",
},
{
Protocol: "sctp",
TargetPort: 98,
PublishedPort: 98,
PublishMode: "ingress",
},
},
},
},
}
assert.Check(t, is.Equal("*:97-98->97-98/sctp, *:60-61->60-61/tcp, *:62->61/tcp, *:80-81->80/tcp, *:90-95->90-95/tcp, *:90-96->90-96/udp", c.Ports()))
}

View File

@ -4,7 +4,8 @@ import (
"bytes"
"testing"
"github.com/stretchr/testify/assert"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
)
func TestStackContextWrite(t *testing.T) {
@ -56,9 +57,9 @@ bar
testcase.context.Output = out
err := StackWrite(testcase.context, stacks)
if err != nil {
assert.Error(t, err, testcase.expected)
assert.Check(t, is.ErrorContains(err, testcase.expected))
} else {
assert.Equal(t, out.String(), testcase.expected)
assert.Check(t, is.Equal(out.String(), testcase.expected))
}
}
}

View File

@ -5,7 +5,8 @@ import (
"testing"
"github.com/docker/docker/pkg/stringid"
"github.com/stretchr/testify/assert"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
)
func TestContainerStatsContext(t *testing.T) {
@ -116,9 +117,9 @@ container2 --
te.context.Output = &out
err := ContainerStatsWrite(te.context, stats, "linux", false)
if err != nil {
assert.EqualError(t, err, te.expected)
assert.Error(t, err, te.expected)
} else {
assert.Equal(t, te.expected, out.String())
assert.Check(t, is.Equal(te.expected, out.String()))
}
}
}
@ -182,9 +183,9 @@ container2 -- --
te.context.Output = &out
err := ContainerStatsWrite(te.context, stats, "windows", false)
if err != nil {
assert.EqualError(t, err, te.expected)
assert.Error(t, err, te.expected)
} else {
assert.Equal(t, te.expected, out.String())
assert.Check(t, is.Equal(te.expected, out.String()))
}
}
}
@ -221,7 +222,7 @@ func TestContainerStatsContextWriteWithNoStats(t *testing.T) {
for _, context := range contexts {
ContainerStatsWrite(context.context, []StatsEntry{}, "linux", false)
assert.Equal(t, context.expected, out.String())
assert.Check(t, is.Equal(context.expected, out.String()))
// Clean buffer
out.Reset()
}
@ -259,7 +260,7 @@ func TestContainerStatsContextWriteWithNoStatsWindows(t *testing.T) {
for _, context := range contexts {
ContainerStatsWrite(context.context, []StatsEntry{}, "windows", false)
assert.Equal(t, context.expected, out.String())
assert.Check(t, is.Equal(context.expected, out.String()))
// Clean buffer
out.Reset()
}
@ -293,7 +294,7 @@ func TestContainerStatsContextWriteTrunc(t *testing.T) {
for _, context := range contexts {
ContainerStatsWrite(context.context, []StatsEntry{{ID: "b95a83497c9161c9b444e3d70e1a9dfba0c1840d41720e146a95a08ebf938afc"}}, "linux", context.trunc)
assert.Equal(t, context.expected, out.String())
assert.Check(t, is.Equal(context.expected, out.String()))
// Clean buffer
out.Reset()
}

View File

@ -7,8 +7,9 @@ import (
"testing"
"github.com/docker/docker/api/types/swarm"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/gotestyourself/gotestyourself/golden"
"github.com/stretchr/testify/assert"
)
func TestTaskContextWrite(t *testing.T) {
@ -74,9 +75,9 @@ foobar_bar foo2
testcase.context.Output = out
err := TaskWrite(testcase.context, tasks, names, nodes)
if err != nil {
assert.EqualError(t, err, testcase.expected)
assert.Error(t, err, testcase.expected)
} else {
assert.Equal(t, testcase.expected, out.String())
assert.Check(t, is.Equal(testcase.expected, out.String()))
}
}
}
@ -100,6 +101,6 @@ func TestTaskContextWriteJSONField(t *testing.T) {
if err := json.Unmarshal([]byte(line), &s); err != nil {
t.Fatal(err)
}
assert.Equal(t, tasks[i].ID, s)
assert.Check(t, is.Equal(tasks[i].ID, s))
}
}

View File

@ -5,7 +5,8 @@ import (
"testing"
"github.com/docker/docker/pkg/stringid"
"github.com/stretchr/testify/assert"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
)
func TestTrustTag(t *testing.T) {
@ -126,9 +127,9 @@ tag3 bbbbbbbb
testcase.context.Output = out
err := TrustTagWrite(testcase.context, signedTags)
if err != nil {
assert.EqualError(t, err, testcase.expected)
assert.Error(t, err, testcase.expected)
} else {
assert.Equal(t, testcase.expected, out.String())
assert.Check(t, is.Equal(testcase.expected, out.String()))
}
}
}
@ -152,8 +153,8 @@ func TestTrustTagContextEmptyWrite(t *testing.T) {
out := bytes.NewBufferString("")
emptyCase.context.Output = out
err := TrustTagWrite(emptyCase.context, emptySignedTags)
assert.NoError(t, err)
assert.Equal(t, emptyCase.expected, out.String())
assert.NilError(t, err)
assert.Check(t, is.Equal(emptyCase.expected, out.String()))
}
func TestSignerInfoContextEmptyWrite(t *testing.T) {
@ -171,8 +172,8 @@ func TestSignerInfoContextEmptyWrite(t *testing.T) {
out := bytes.NewBufferString("")
emptyCase.context.Output = out
err := SignerInfoWrite(emptyCase.context, emptySignerInfo)
assert.NoError(t, err)
assert.Equal(t, emptyCase.expected, out.String())
assert.NilError(t, err)
assert.Check(t, is.Equal(emptyCase.expected, out.String()))
}
func TestSignerInfoContextWrite(t *testing.T) {
@ -230,9 +231,9 @@ eve foobarbazquxquux, key31, key32
testcase.context.Output = out
err := SignerInfoWrite(testcase.context, signerInfo)
if err != nil {
assert.EqualError(t, err, testcase.expected)
assert.Error(t, err, testcase.expected)
} else {
assert.Equal(t, testcase.expected, out.String())
assert.Check(t, is.Equal(testcase.expected, out.String()))
}
}
}

View File

@ -9,8 +9,8 @@ import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/stringid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
)
func TestVolumeContext(t *testing.T) {
@ -133,9 +133,9 @@ foobar_bar
testcase.context.Output = out
err := VolumeWrite(testcase.context, volumes)
if err != nil {
assert.EqualError(t, err, testcase.expected)
assert.Error(t, err, testcase.expected)
} else {
assert.Equal(t, testcase.expected, out.String())
assert.Check(t, is.Equal(testcase.expected, out.String()))
}
}
}
@ -158,8 +158,8 @@ func TestVolumeContextWriteJSON(t *testing.T) {
msg := fmt.Sprintf("Output: line %d: %s", i, line)
var m map[string]interface{}
err := json.Unmarshal([]byte(line), &m)
require.NoError(t, err, msg)
assert.Equal(t, expectedJSONs[i], m, msg)
assert.NilError(t, err, msg)
assert.Check(t, is.DeepEqual(expectedJSONs[i], m), msg)
}
}
@ -177,7 +177,7 @@ func TestVolumeContextWriteJSONField(t *testing.T) {
msg := fmt.Sprintf("Output: line %d: %s", i, line)
var s string
err := json.Unmarshal([]byte(line), &s)
require.NoError(t, err, msg)
assert.Equal(t, volumes[i].Name, s, msg)
assert.NilError(t, err, msg)
assert.Check(t, is.Equal(volumes[i].Name, s), msg)
}
}

View File

@ -4,10 +4,11 @@ import (
"testing"
"github.com/docker/docker/api/types/swarm"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
// Import builders to get the builder function as package function
. "github.com/docker/cli/internal/test/builders"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"golang.org/x/net/context"
)
@ -21,7 +22,7 @@ func TestResolveError(t *testing.T) {
idResolver := New(cli, false)
_, err := idResolver.Resolve(context.Background(), struct{}{}, "nodeID")
assert.EqualError(t, err, "unsupported type")
assert.Error(t, err, "unsupported type")
}
func TestResolveWithNoResolveOption(t *testing.T) {
@ -40,9 +41,9 @@ func TestResolveWithNoResolveOption(t *testing.T) {
idResolver := New(cli, true)
id, err := idResolver.Resolve(context.Background(), swarm.Node{}, "nodeID")
assert.NoError(t, err)
assert.Equal(t, "nodeID", id)
assert.False(t, resolved)
assert.NilError(t, err)
assert.Check(t, is.Equal("nodeID", id))
assert.Check(t, !resolved)
}
func TestResolveWithCache(t *testing.T) {
@ -59,11 +60,11 @@ func TestResolveWithCache(t *testing.T) {
ctx := context.Background()
for i := 0; i < 2; i++ {
id, err := idResolver.Resolve(ctx, swarm.Node{}, "nodeID")
assert.NoError(t, err)
assert.Equal(t, "node-foo", id)
assert.NilError(t, err)
assert.Check(t, is.Equal("node-foo", id))
}
assert.Equal(t, 1, inspectCounter)
assert.Check(t, is.Equal(1, inspectCounter))
}
func TestResolveNode(t *testing.T) {
@ -103,8 +104,8 @@ func TestResolveNode(t *testing.T) {
idResolver := New(cli, false)
id, err := idResolver.Resolve(ctx, swarm.Node{}, tc.nodeID)
assert.NoError(t, err)
assert.Equal(t, tc.expectedID, id)
assert.NilError(t, err)
assert.Check(t, is.Equal(tc.expectedID, id))
}
}
@ -138,7 +139,7 @@ func TestResolveService(t *testing.T) {
idResolver := New(cli, false)
id, err := idResolver.Resolve(ctx, swarm.Service{}, tc.serviceID)
assert.NoError(t, err)
assert.Equal(t, tc.expectedID, id)
assert.NilError(t, err)
assert.Check(t, is.Equal(tc.expectedID, id))
}
}

View File

@ -9,8 +9,10 @@ import (
"io"
"io/ioutil"
"os"
"path/filepath"
"regexp"
"runtime"
"strings"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
@ -65,6 +67,7 @@ type buildOptions struct {
imageIDFile string
stream bool
platform string
untrusted bool
}
// dockerfileFromStdin returns true when the user specified that the Dockerfile
@ -135,7 +138,7 @@ func NewBuildCommand(dockerCli command.Cli) *cobra.Command {
flags.StringVar(&options.target, "target", "", "Set the target build stage to build.")
flags.StringVar(&options.imageIDFile, "iidfile", "", "Write the image ID to the file")
command.AddTrustVerificationFlags(flags)
command.AddTrustVerificationFlags(flags, &options.untrusted, dockerCli.ContentTrustEnabled())
command.AddPlatformFlag(flags, &options.platform)
flags.BoolVar(&options.squash, "squash", false, "Squash newly built layers into a single new layer")
@ -206,6 +209,14 @@ func runBuild(dockerCli command.Cli, options buildOptions) error {
buildCtx, relDockerfile, err = build.GetContextFromReader(dockerCli.In(), options.dockerfileName)
case isLocalDir(specifiedContext):
contextDir, relDockerfile, err = build.GetContextFromLocalDir(specifiedContext, options.dockerfileName)
if err == nil && strings.HasPrefix(relDockerfile, ".."+string(filepath.Separator)) {
// Dockerfile is outside of build-context; read the Dockerfile and pass it as dockerfileCtx
dockerfileCtx, err = os.Open(options.dockerfileName)
if err != nil {
return errors.Errorf("unable to open Dockerfile: %v", err)
}
defer dockerfileCtx.Close()
}
case urlutil.IsGitURL(specifiedContext):
tempDir, relDockerfile, err = build.GetContextFromGitURL(specifiedContext, options.dockerfileName)
case urlutil.IsURL(specifiedContext):
@ -253,7 +264,7 @@ func runBuild(dockerCli command.Cli, options buildOptions) error {
}
}
// replace Dockerfile if it was added from stdin and there is archive context
// replace Dockerfile if it was added from stdin or a file outside the build-context, and there is archive context
if dockerfileCtx != nil && buildCtx != nil {
buildCtx, relDockerfile, err = build.AddDockerfileToBuildContext(dockerfileCtx, buildCtx)
if err != nil {
@ -261,7 +272,7 @@ func runBuild(dockerCli command.Cli, options buildOptions) error {
}
}
// if streaming and dockerfile was not from stdin then read from file
// if streaming and Dockerfile was not from stdin then read from file
// to the same reader that is usually stdin
if options.stream && dockerfileCtx == nil {
dockerfileCtx, err = os.Open(relDockerfile)
@ -275,7 +286,7 @@ func runBuild(dockerCli command.Cli, options buildOptions) error {
defer cancel()
var resolvedTags []*resolvedTag
if command.IsTrusted() {
if !options.untrusted {
translator := func(ctx context.Context, ref reference.NamedTagged) (reference.Canonical, error) {
return TrustedReference(ctx, dockerCli, ref, nil)
}
@ -283,10 +294,10 @@ func runBuild(dockerCli command.Cli, options buildOptions) error {
if buildCtx != nil {
// Wrap the tar archive to replace the Dockerfile entry with the rewritten
// Dockerfile which uses trusted pulls.
buildCtx = replaceDockerfileTarWrapper(ctx, buildCtx, relDockerfile, translator, &resolvedTags)
buildCtx = replaceDockerfileForContentTrust(ctx, buildCtx, relDockerfile, translator, &resolvedTags)
} else if dockerfileCtx != nil {
// if there was not archive context still do the possible replacements in Dockerfile
newDockerfile, _, err := rewriteDockerfileFrom(ctx, dockerfileCtx, translator)
newDockerfile, _, err := rewriteDockerfileFromForContentTrust(ctx, dockerfileCtx, translator)
if err != nil {
return err
}
@ -450,7 +461,7 @@ func runBuild(dockerCli command.Cli, options buildOptions) error {
return err
}
}
if command.IsTrusted() {
if !options.untrusted {
// Since the build was successful, now we must tag any of the resolved
// images from the above Dockerfile rewrite.
for _, resolved := range resolvedTags {
@ -489,11 +500,12 @@ type resolvedTag struct {
tagRef reference.NamedTagged
}
// rewriteDockerfileFrom rewrites the given Dockerfile by resolving images in
// rewriteDockerfileFromForContentTrust rewrites the given Dockerfile by resolving images in
// "FROM <image>" instructions to a digest reference. `translator` is a
// function that takes a repository name and tag reference and returns a
// trusted digest reference.
func rewriteDockerfileFrom(ctx context.Context, dockerfile io.Reader, translator translatorFunc) (newDockerfile []byte, resolvedTags []*resolvedTag, err error) {
// This should be called *only* when content trust is enabled
func rewriteDockerfileFromForContentTrust(ctx context.Context, dockerfile io.Reader, translator translatorFunc) (newDockerfile []byte, resolvedTags []*resolvedTag, err error) {
scanner := bufio.NewScanner(dockerfile)
buf := bytes.NewBuffer(nil)
@ -510,7 +522,7 @@ func rewriteDockerfileFrom(ctx context.Context, dockerfile io.Reader, translator
return nil, nil, err
}
ref = reference.TagNameOnly(ref)
if ref, ok := ref.(reference.NamedTagged); ok && command.IsTrusted() {
if ref, ok := ref.(reference.NamedTagged); ok {
trustedRef, err := translator(ctx, ref)
if err != nil {
return nil, nil, err
@ -533,11 +545,10 @@ func rewriteDockerfileFrom(ctx context.Context, dockerfile io.Reader, translator
return buf.Bytes(), resolvedTags, scanner.Err()
}
// replaceDockerfileTarWrapper wraps the given input tar archive stream and
// replaces the entry with the given Dockerfile name with the contents of the
// new Dockerfile. Returns a new tar archive stream with the replaced
// Dockerfile.
func replaceDockerfileTarWrapper(ctx context.Context, inputTarStream io.ReadCloser, dockerfileName string, translator translatorFunc, resolvedTags *[]*resolvedTag) io.ReadCloser {
// replaceDockerfileForContentTrust wraps the given input tar archive stream and
// uses the translator to replace the Dockerfile which uses a trusted reference.
// Returns a new tar archive stream with the replaced Dockerfile.
func replaceDockerfileForContentTrust(ctx context.Context, inputTarStream io.ReadCloser, dockerfileName string, translator translatorFunc, resolvedTags *[]*resolvedTag) io.ReadCloser {
pipeReader, pipeWriter := io.Pipe()
go func() {
tarReader := tar.NewReader(inputTarStream)
@ -564,7 +575,7 @@ func replaceDockerfileTarWrapper(ctx context.Context, inputTarStream io.ReadClos
// generated from a directory on the local filesystem, the
// Dockerfile will only appear once in the archive.
var newDockerfile []byte
newDockerfile, *resolvedTags, err = rewriteDockerfileFrom(ctx, content, translator)
newDockerfile, *resolvedTags, err = rewriteDockerfileFromForContentTrust(ctx, content, translator)
if err != nil {
pipeWriter.CloseWithError(err)
return

View File

@ -167,6 +167,10 @@ func GetContextFromGitURL(gitURL, dockerfileName string) (string, string, error)
return "", "", err
}
relDockerfile, err := getDockerfileRelPath(absContextDir, dockerfileName)
if err == nil && strings.HasPrefix(relDockerfile, ".."+string(filepath.Separator)) {
return "", "", errors.Errorf("the Dockerfile (%s) must be within the build context", dockerfileName)
}
return absContextDir, relDockerfile, err
}
@ -318,10 +322,6 @@ func getDockerfileRelPath(absContextDir, givenDockerfile string) (string, error)
return "", errors.Errorf("unable to get relative Dockerfile path: %v", err)
}
if strings.HasPrefix(relDockerfile, ".."+string(filepath.Separator)) {
return "", errors.Errorf("the Dockerfile (%s) must be within the build context", givenDockerfile)
}
return relDockerfile, nil
}

View File

@ -11,10 +11,9 @@ import (
"strings"
"testing"
"github.com/docker/cli/internal/test/testutil"
"github.com/docker/docker/pkg/archive"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
)
const dockerfileContents = "FROM busybox"
@ -38,7 +37,7 @@ func testValidateContextDirectory(t *testing.T, prepare func(t *testing.T) (stri
defer cleanup()
err := ValidateContextDirectory(contextDir, excludes)
require.NoError(t, err)
assert.NilError(t, err)
}
func TestGetContextFromLocalDirNoDockerfile(t *testing.T) {
@ -46,7 +45,7 @@ func TestGetContextFromLocalDirNoDockerfile(t *testing.T) {
defer cleanup()
_, _, err := GetContextFromLocalDir(contextDir, "")
testutil.ErrorContains(t, err, "Dockerfile")
assert.ErrorContains(t, err, "Dockerfile")
}
func TestGetContextFromLocalDirNotExistingDir(t *testing.T) {
@ -56,7 +55,7 @@ func TestGetContextFromLocalDirNotExistingDir(t *testing.T) {
fakePath := filepath.Join(contextDir, "fake")
_, _, err := GetContextFromLocalDir(fakePath, "")
testutil.ErrorContains(t, err, "fake")
assert.ErrorContains(t, err, "fake")
}
func TestGetContextFromLocalDirNotExistingDockerfile(t *testing.T) {
@ -66,7 +65,7 @@ func TestGetContextFromLocalDirNotExistingDockerfile(t *testing.T) {
fakePath := filepath.Join(contextDir, "fake")
_, _, err := GetContextFromLocalDir(contextDir, fakePath)
testutil.ErrorContains(t, err, "fake")
assert.ErrorContains(t, err, "fake")
}
func TestGetContextFromLocalDirWithNoDirectory(t *testing.T) {
@ -79,10 +78,10 @@ func TestGetContextFromLocalDirWithNoDirectory(t *testing.T) {
defer chdirCleanup()
absContextDir, relDockerfile, err := GetContextFromLocalDir(contextDir, "")
require.NoError(t, err)
assert.NilError(t, err)
assert.Equal(t, contextDir, absContextDir)
assert.Equal(t, DefaultDockerfileName, relDockerfile)
assert.Check(t, is.Equal(contextDir, absContextDir))
assert.Check(t, is.Equal(DefaultDockerfileName, relDockerfile))
}
func TestGetContextFromLocalDirWithDockerfile(t *testing.T) {
@ -92,10 +91,10 @@ func TestGetContextFromLocalDirWithDockerfile(t *testing.T) {
createTestTempFile(t, contextDir, DefaultDockerfileName, dockerfileContents, 0777)
absContextDir, relDockerfile, err := GetContextFromLocalDir(contextDir, "")
require.NoError(t, err)
assert.NilError(t, err)
assert.Equal(t, contextDir, absContextDir)
assert.Equal(t, DefaultDockerfileName, relDockerfile)
assert.Check(t, is.Equal(contextDir, absContextDir))
assert.Check(t, is.Equal(DefaultDockerfileName, relDockerfile))
}
func TestGetContextFromLocalDirLocalFile(t *testing.T) {
@ -130,10 +129,10 @@ func TestGetContextFromLocalDirWithCustomDockerfile(t *testing.T) {
createTestTempFile(t, contextDir, DefaultDockerfileName, dockerfileContents, 0777)
absContextDir, relDockerfile, err := GetContextFromLocalDir(contextDir, DefaultDockerfileName)
require.NoError(t, err)
assert.NilError(t, err)
assert.Equal(t, contextDir, absContextDir)
assert.Equal(t, DefaultDockerfileName, relDockerfile)
assert.Check(t, is.Equal(contextDir, absContextDir))
assert.Check(t, is.Equal(DefaultDockerfileName, relDockerfile))
}
func TestGetContextFromReaderString(t *testing.T) {
@ -161,7 +160,7 @@ func TestGetContextFromReaderString(t *testing.T) {
t.Fatalf("Tar stream too long: %s", err)
}
require.NoError(t, tarArchive.Close())
assert.NilError(t, tarArchive.Close())
if dockerfileContents != contents {
t.Fatalf("Uncompressed tar archive does not equal: %s, got: %s", dockerfileContents, contents)
@ -179,15 +178,15 @@ func TestGetContextFromReaderTar(t *testing.T) {
createTestTempFile(t, contextDir, DefaultDockerfileName, dockerfileContents, 0777)
tarStream, err := archive.Tar(contextDir, archive.Uncompressed)
require.NoError(t, err)
assert.NilError(t, err)
tarArchive, relDockerfile, err := GetContextFromReader(tarStream, DefaultDockerfileName)
require.NoError(t, err)
assert.NilError(t, err)
tarReader := tar.NewReader(tarArchive)
header, err := tarReader.Next()
require.NoError(t, err)
assert.NilError(t, err)
if header.Name != DefaultDockerfileName {
t.Fatalf("Dockerfile name should be: %s, got: %s", DefaultDockerfileName, header.Name)
@ -203,7 +202,7 @@ func TestGetContextFromReaderTar(t *testing.T) {
t.Fatalf("Tar stream too long: %s", err)
}
require.NoError(t, tarArchive.Close())
assert.NilError(t, tarArchive.Close())
if dockerfileContents != contents {
t.Fatalf("Uncompressed tar archive does not equal: %s, got: %s", dockerfileContents, contents)
@ -243,8 +242,8 @@ func TestValidateContextDirectoryWithOneFileExcludes(t *testing.T) {
// When an error occurs, it terminates the test.
func createTestTempDir(t *testing.T, dir, prefix string) (string, func()) {
path, err := ioutil.TempDir(dir, prefix)
require.NoError(t, err)
return path, func() { require.NoError(t, os.RemoveAll(path)) }
assert.NilError(t, err)
return path, func() { assert.NilError(t, os.RemoveAll(path)) }
}
// createTestTempFile creates a temporary file within dir with specific contents and permissions.
@ -252,7 +251,7 @@ func createTestTempDir(t *testing.T, dir, prefix string) (string, func()) {
func createTestTempFile(t *testing.T, dir, filename, contents string, perm os.FileMode) string {
filePath := filepath.Join(dir, filename)
err := ioutil.WriteFile(filePath, []byte(contents), perm)
require.NoError(t, err)
assert.NilError(t, err)
return filePath
}
@ -262,9 +261,9 @@ func createTestTempFile(t *testing.T, dir, filename, contents string, perm os.Fi
// When an error occurs, it terminates the test.
func chdir(t *testing.T, dir string) func() {
workingDirectory, err := os.Getwd()
require.NoError(t, err)
require.NoError(t, os.Chdir(dir))
return func() { require.NoError(t, os.Chdir(workingDirectory)) }
assert.NilError(t, err)
assert.NilError(t, os.Chdir(dir))
return func() { assert.NilError(t, os.Chdir(workingDirectory)) }
}
func TestIsArchive(t *testing.T) {
@ -295,6 +294,6 @@ func TestIsArchive(t *testing.T) {
},
}
for _, testcase := range testcases {
assert.Equal(t, testcase.expected, IsArchive(testcase.header), testcase.doc)
assert.Check(t, is.Equal(testcase.expected, IsArchive(testcase.header)), testcase.doc)
}
}

View File

@ -0,0 +1,55 @@
//+build linux
package image
import (
"bytes"
"io"
"io/ioutil"
"syscall"
"testing"
"github.com/docker/cli/internal/test"
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/archive"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/gotestyourself/gotestyourself/fs"
"golang.org/x/net/context"
)
func TestRunBuildResetsUidAndGidInContext(t *testing.T) {
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.NilError(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()
options.untrusted = true
err := runBuild(cli, options)
assert.NilError(t, err)
files, err := ioutil.ReadDir(dest.Path())
assert.NilError(t, err)
for _, fileInfo := range files {
assert.Check(t, is.Equal(uint32(0), fileInfo.Sys().(*syscall.Stat_t).Uid))
assert.Check(t, is.Equal(uint32(0), fileInfo.Sys().(*syscall.Stat_t).Gid))
}
}

View File

@ -1,65 +1,28 @@
package image
import (
"archive/tar"
"bytes"
"io"
"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/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"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)
assert.NilError(t, err)
defer os.RemoveAll(dest)
var dockerfileName string
@ -67,11 +30,11 @@ func TestRunBuildDockerfileFromStdinWithCompress(t *testing.T) {
buffer := new(bytes.Buffer)
tee := io.TeeReader(context, buffer)
assert.NoError(t, archive.Untar(tee, dest, nil))
assert.NilError(t, archive.Untar(tee, dest, nil))
dockerfileName = options.Dockerfile
header := buffer.Bytes()[:10]
assert.Equal(t, archive.Gzip, archive.DetectCompression(header))
assert.Check(t, is.Equal(archive.Gzip, archive.DetectCompression(header)))
body := new(bytes.Buffer)
return types.ImageBuildResponse{Body: ioutil.NopCloser(body)}, nil
@ -85,7 +48,7 @@ func TestRunBuildDockerfileFromStdinWithCompress(t *testing.T) {
cli.SetIn(command.NewInStream(ioutil.NopCloser(dockerfile)))
dir, err := ioutil.TempDir("", "test-build-compress")
require.NoError(t, err)
assert.NilError(t, err)
defer os.RemoveAll(dir)
ioutil.WriteFile(filepath.Join(dir, "foo"), []byte("some content"), 0644)
@ -94,30 +57,85 @@ func TestRunBuildDockerfileFromStdinWithCompress(t *testing.T) {
options.compress = true
options.dockerfileName = "-"
options.context = dir
options.untrusted = true
err = runBuild(cli, options)
require.NoError(t, err)
assert.NilError(t, err)
files, err := ioutil.ReadDir(dest)
require.NoError(t, err)
assert.NilError(t, err)
actual := []string{}
for _, fileInfo := range files {
actual = append(actual, fileInfo.Name())
}
sort.Strings(actual)
assert.Equal(t, []string{dockerfileName, ".dockerignore", "foo"}, actual)
assert.Check(t, is.DeepEqual([]string{dockerfileName, ".dockerignore", "foo"}, actual))
}
func TestRunBuildDockerfileOutsideContext(t *testing.T) {
dir := fs.NewDir(t, t.Name(),
fs.WithFile("data", "data file"),
)
defer dir.Remove()
// Dockerfile outside of build-context
df := fs.NewFile(t, t.Name(),
fs.WithContent(`
FROM FOOBAR
COPY data /data
`),
)
defer df.Remove()
dest, err := ioutil.TempDir("", t.Name())
assert.NilError(t, err)
defer os.RemoveAll(dest)
var dockerfileName string
fakeImageBuild := func(_ context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error) {
buffer := new(bytes.Buffer)
tee := io.TeeReader(context, buffer)
assert.NilError(t, archive.Untar(tee, dest, nil))
dockerfileName = options.Dockerfile
body := new(bytes.Buffer)
return types.ImageBuildResponse{Body: ioutil.NopCloser(body)}, nil
}
cli := test.NewFakeCli(&fakeClient{imageBuildFunc: fakeImageBuild})
options := newBuildOptions()
options.context = dir.Path()
options.dockerfileName = df.Path()
options.untrusted = true
err = runBuild(cli, options)
assert.NilError(t, err)
files, err := ioutil.ReadDir(dest)
assert.NilError(t, err)
var actual []string
for _, fileInfo := range files {
actual = append(actual, fileInfo.Name())
}
sort.Strings(actual)
assert.Check(t, is.DeepEqual([]string{dockerfileName, ".dockerignore", "data"}, actual))
}
// TestRunBuildFromLocalGitHubDirNonExistingRepo tests that build contexts
// starting with `github.com/` are special-cased, and the build command attempts
// to clone the remote repo.
// TODO: test "context selection" logic directly when runBuild is refactored
// to support testing (ex: docker/cli#294)
func TestRunBuildFromGitHubSpecialCase(t *testing.T) {
cmd := NewBuildCommand(test.NewFakeCli(nil))
cmd.SetArgs([]string{"github.com/docker/no-such-repository"})
// Clone a small repo that exists so git doesn't prompt for credentials
cmd.SetArgs([]string{"github.com/docker/for-win"})
cmd.SetOutput(ioutil.Discard)
err := cmd.Execute()
assert.Error(t, err)
assert.Contains(t, err.Error(), "unable to prepare context: unable to 'git clone'")
assert.ErrorContains(t, err, "unable to prepare context")
assert.ErrorContains(t, err, "docker-build-git")
}
// TestRunBuildFromLocalGitHubDirNonExistingRepo tests that a local directory
@ -125,19 +143,57 @@ func TestRunBuildFromGitHubSpecialCase(t *testing.T) {
// case.
func TestRunBuildFromLocalGitHubDir(t *testing.T) {
tmpDir, err := ioutil.TempDir("", "docker-build-from-local-dir-")
require.NoError(t, err)
assert.NilError(t, err)
defer os.RemoveAll(tmpDir)
buildDir := filepath.Join(tmpDir, "github.com", "docker", "no-such-repository")
err = os.MkdirAll(buildDir, 0777)
require.NoError(t, err)
assert.NilError(t, err)
err = ioutil.WriteFile(filepath.Join(buildDir, "Dockerfile"), []byte("FROM busybox\n"), 0644)
require.NoError(t, err)
assert.NilError(t, err)
client := test.NewFakeCli(&fakeClient{})
cmd := NewBuildCommand(client)
cmd.SetArgs([]string{buildDir})
cmd.SetOutput(ioutil.Discard)
err = cmd.Execute()
require.NoError(t, err)
assert.NilError(t, err)
}
func TestRunBuildWithSymlinkedContext(t *testing.T) {
dockerfile := `
FROM alpine:3.6
RUN echo hello world
`
tmpDir := fs.NewDir(t, t.Name(),
fs.WithDir("context",
fs.WithFile("Dockerfile", dockerfile)),
fs.WithSymlink("context-link", "context"))
defer tmpDir.Remove()
files := []string{}
fakeImageBuild := func(_ context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error) {
tarReader := tar.NewReader(context)
for {
hdr, err := tarReader.Next()
switch err {
case io.EOF:
body := new(bytes.Buffer)
return types.ImageBuildResponse{Body: ioutil.NopCloser(body)}, nil
case nil:
files = append(files, hdr.Name)
default:
return types.ImageBuildResponse{}, err
}
}
}
cli := test.NewFakeCli(&fakeClient{imageBuildFunc: fakeImageBuild})
options := newBuildOptions()
options.context = tmpDir.Join("context-link")
options.untrusted = true
assert.NilError(t, runBuild(cli, options))
assert.DeepEqual(t, files, []string{"Dockerfile"})
}

View File

@ -7,11 +7,10 @@ import (
"time"
"github.com/docker/cli/internal/test"
"github.com/docker/cli/internal/test/testutil"
"github.com/docker/docker/api/types/image"
"github.com/gotestyourself/gotestyourself/assert"
"github.com/gotestyourself/gotestyourself/golden"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
)
func TestNewHistoryCommandErrors(t *testing.T) {
@ -39,7 +38,7 @@ func TestNewHistoryCommandErrors(t *testing.T) {
cmd := NewHistoryCommand(test.NewFakeCli(&fakeClient{imageHistoryFunc: tc.imageHistoryFunc}))
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
testutil.ErrorContains(t, cmd.Execute(), tc.expectedError)
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
}
}
@ -47,7 +46,6 @@ func TestNewHistoryCommandSuccess(t *testing.T) {
testCases := []struct {
name string
args []string
outputRegex string
imageHistoryFunc func(img string) ([]image.HistoryResponseItem, error)
}{
{
@ -64,16 +62,17 @@ func TestNewHistoryCommandSuccess(t *testing.T) {
name: "quiet",
args: []string{"--quiet", "image:tag"},
},
// TODO: This test is failing since the output does not contain an RFC3339 date
//{
// name: "non-human",
// args: []string{"--human=false", "image:tag"},
// outputRegex: "\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}", // RFC3339 date format match
//},
{
name: "non-human-header",
args: []string{"--human=false", "image:tag"},
outputRegex: "CREATED\\sAT",
name: "non-human",
args: []string{"--human=false", "image:tag"},
imageHistoryFunc: func(img string) ([]image.HistoryResponseItem, error) {
return []image.HistoryResponseItem{{
ID: "abcdef",
Created: time.Date(2017, 1, 1, 12, 0, 3, 0, time.UTC).Unix(),
CreatedBy: "rose",
Comment: "new history item!",
}}, nil
},
},
{
name: "quiet-no-trunc",
@ -92,12 +91,8 @@ func TestNewHistoryCommandSuccess(t *testing.T) {
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
err := cmd.Execute()
assert.NoError(t, err)
assert.NilError(t, err)
actual := cli.OutBuffer().String()
if tc.outputRegex == "" {
golden.Assert(t, actual, fmt.Sprintf("history-command-success.%s.golden", tc.name))
} else {
assert.Regexp(t, tc.outputRegex, actual)
}
golden.Assert(t, actual, fmt.Sprintf("history-command-success.%s.golden", tc.name))
}
}

View File

@ -7,10 +7,10 @@ import (
"testing"
"github.com/docker/cli/internal/test"
"github.com/docker/cli/internal/test/testutil"
"github.com/docker/docker/api/types"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
)
func TestNewImportCommandErrors(t *testing.T) {
@ -38,7 +38,7 @@ func TestNewImportCommandErrors(t *testing.T) {
cmd := NewImportCommand(test.NewFakeCli(&fakeClient{imageImportFunc: tc.imageImportFunc}))
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
testutil.ErrorContains(t, cmd.Execute(), tc.expectedError)
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
}
}
@ -46,7 +46,7 @@ func TestNewImportCommandInvalidFile(t *testing.T) {
cmd := NewImportCommand(test.NewFakeCli(&fakeClient{}))
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs([]string{"testdata/import-command-success.unexistent-file"})
testutil.ErrorContains(t, cmd.Execute(), "testdata/import-command-success.unexistent-file")
assert.ErrorContains(t, cmd.Execute(), "testdata/import-command-success.unexistent-file")
}
func TestNewImportCommandSuccess(t *testing.T) {
@ -67,7 +67,7 @@ func TestNewImportCommandSuccess(t *testing.T) {
name: "double",
args: []string{"-", "image:local"},
imageImportFunc: func(source types.ImageImportSource, ref string, options types.ImageImportOptions) (io.ReadCloser, error) {
assert.Equal(t, "image:local", ref)
assert.Check(t, is.Equal("image:local", ref))
return ioutil.NopCloser(strings.NewReader("")), nil
},
},
@ -75,7 +75,7 @@ func TestNewImportCommandSuccess(t *testing.T) {
name: "message",
args: []string{"--message", "test message", "-"},
imageImportFunc: func(source types.ImageImportSource, ref string, options types.ImageImportOptions) (io.ReadCloser, error) {
assert.Equal(t, "test message", options.Message)
assert.Check(t, is.Equal("test message", options.Message))
return ioutil.NopCloser(strings.NewReader("")), nil
},
},
@ -83,7 +83,7 @@ func TestNewImportCommandSuccess(t *testing.T) {
name: "change",
args: []string{"--change", "ENV DEBUG true", "-"},
imageImportFunc: func(source types.ImageImportSource, ref string, options types.ImageImportOptions) (io.ReadCloser, error) {
assert.Equal(t, "ENV DEBUG true", options.Changes[0])
assert.Check(t, is.Equal("ENV DEBUG true", options.Changes[0]))
return ioutil.NopCloser(strings.NewReader("")), nil
},
},
@ -92,6 +92,6 @@ func TestNewImportCommandSuccess(t *testing.T) {
cmd := NewImportCommand(test.NewFakeCli(&fakeClient{imageImportFunc: tc.imageImportFunc}))
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
assert.NoError(t, cmd.Execute())
assert.NilError(t, cmd.Execute())
}
}

View File

@ -6,10 +6,10 @@ import (
"testing"
"github.com/docker/cli/internal/test"
"github.com/docker/cli/internal/test/testutil"
"github.com/docker/docker/api/types"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/gotestyourself/gotestyourself/golden"
"github.com/stretchr/testify/assert"
)
func TestNewInspectCommandErrors(t *testing.T) {
@ -28,7 +28,7 @@ func TestNewInspectCommandErrors(t *testing.T) {
cmd := newInspectCommand(test.NewFakeCli(&fakeClient{}))
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
testutil.ErrorContains(t, cmd.Execute(), tc.expectedError)
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
}
}
@ -46,7 +46,7 @@ func TestNewInspectCommandSuccess(t *testing.T) {
imageCount: 1,
imageInspectFunc: func(image string) (types.ImageInspect, []byte, error) {
imageInspectInvocationCount++
assert.Equal(t, "image", image)
assert.Check(t, is.Equal("image", image))
return types.ImageInspect{}, nil, nil
},
},
@ -66,9 +66,9 @@ func TestNewInspectCommandSuccess(t *testing.T) {
imageInspectFunc: func(image string) (types.ImageInspect, []byte, error) {
imageInspectInvocationCount++
if imageInspectInvocationCount == 1 {
assert.Equal(t, "image1", image)
assert.Check(t, is.Equal("image1", image))
} else {
assert.Equal(t, "image2", image)
assert.Check(t, is.Equal("image2", image))
}
return types.ImageInspect{}, nil, nil
},
@ -81,8 +81,8 @@ func TestNewInspectCommandSuccess(t *testing.T) {
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
err := cmd.Execute()
assert.NoError(t, err)
assert.NilError(t, err)
golden.Assert(t, cli.OutBuffer().String(), fmt.Sprintf("inspect-command-success.%s.golden", tc.name))
assert.Equal(t, imageInspectInvocationCount, tc.imageCount)
assert.Check(t, is.Equal(imageInspectInvocationCount, tc.imageCount))
}
}

View File

@ -7,11 +7,11 @@ import (
"github.com/docker/cli/cli/config/configfile"
"github.com/docker/cli/internal/test"
"github.com/docker/cli/internal/test/testutil"
"github.com/docker/docker/api/types"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/gotestyourself/gotestyourself/golden"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
)
func TestNewImagesCommandErrors(t *testing.T) {
@ -38,7 +38,7 @@ func TestNewImagesCommandErrors(t *testing.T) {
cmd := NewImagesCommand(test.NewFakeCli(&fakeClient{imageListFunc: tc.imageListFunc}))
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
testutil.ErrorContains(t, cmd.Execute(), tc.expectedError)
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
}
}
@ -65,7 +65,7 @@ func TestNewImagesCommandSuccess(t *testing.T) {
name: "match-name",
args: []string{"image"},
imageListFunc: func(options types.ImageListOptions) ([]types.ImageSummary, error) {
assert.Equal(t, "image", options.Filters.Get("reference")[0])
assert.Check(t, is.Equal("image", options.Filters.Get("reference")[0]))
return []types.ImageSummary{{}}, nil
},
},
@ -73,7 +73,7 @@ func TestNewImagesCommandSuccess(t *testing.T) {
name: "filters",
args: []string{"--filter", "name=value"},
imageListFunc: func(options types.ImageListOptions) ([]types.ImageSummary, error) {
assert.Equal(t, "value", options.Filters.Get("name")[0])
assert.Check(t, is.Equal("value", options.Filters.Get("name")[0]))
return []types.ImageSummary{{}}, nil
},
},
@ -85,14 +85,14 @@ func TestNewImagesCommandSuccess(t *testing.T) {
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
err := cmd.Execute()
assert.NoError(t, err)
assert.NilError(t, err)
golden.Assert(t, cli.OutBuffer().String(), fmt.Sprintf("list-command-success.%s.golden", tc.name))
}
}
func TestNewListCommandAlias(t *testing.T) {
cmd := newListCommand(test.NewFakeCli(&fakeClient{}))
assert.True(t, cmd.HasAlias("images"))
assert.True(t, cmd.HasAlias("list"))
assert.False(t, cmd.HasAlias("other"))
assert.Check(t, cmd.HasAlias("images"))
assert.Check(t, cmd.HasAlias("list"))
assert.Check(t, !cmd.HasAlias("other"))
}

View File

@ -8,11 +8,10 @@ import (
"testing"
"github.com/docker/cli/internal/test"
"github.com/docker/cli/internal/test/testutil"
"github.com/docker/docker/api/types"
"github.com/gotestyourself/gotestyourself/assert"
"github.com/gotestyourself/gotestyourself/golden"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
)
func TestNewLoadCommandErrors(t *testing.T) {
@ -47,7 +46,7 @@ func TestNewLoadCommandErrors(t *testing.T) {
cmd := NewLoadCommand(cli)
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
testutil.ErrorContains(t, cmd.Execute(), tc.expectedError)
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
}
}
@ -57,7 +56,7 @@ func TestNewLoadCommandInvalidInput(t *testing.T) {
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs([]string{"--input", "*"})
err := cmd.Execute()
testutil.ErrorContains(t, err, expectedError)
assert.ErrorContains(t, err, expectedError)
}
func TestNewLoadCommandSuccess(t *testing.T) {
@ -96,7 +95,7 @@ func TestNewLoadCommandSuccess(t *testing.T) {
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
err := cmd.Execute()
assert.NoError(t, err)
assert.NilError(t, err)
golden.Assert(t, cli.OutBuffer().String(), fmt.Sprintf("load-command-success.%s.golden", tc.name))
}
}

View File

@ -6,12 +6,12 @@ import (
"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/filters"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/gotestyourself/gotestyourself/golden"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
)
func TestNewPruneCommandErrors(t *testing.T) {
@ -41,7 +41,7 @@ func TestNewPruneCommandErrors(t *testing.T) {
}))
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
testutil.ErrorContains(t, cmd.Execute(), tc.expectedError)
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
}
}
@ -55,7 +55,7 @@ func TestNewPruneCommandSuccess(t *testing.T) {
name: "all",
args: []string{"--all"},
imagesPruneFunc: func(pruneFilter filters.Args) (types.ImagesPruneReport, error) {
assert.Equal(t, "false", pruneFilter.Get("dangling")[0])
assert.Check(t, is.Equal("false", pruneFilter.Get("dangling")[0]))
return types.ImagesPruneReport{}, nil
},
},
@ -63,7 +63,7 @@ func TestNewPruneCommandSuccess(t *testing.T) {
name: "force-deleted",
args: []string{"--force"},
imagesPruneFunc: func(pruneFilter filters.Args) (types.ImagesPruneReport, error) {
assert.Equal(t, "true", pruneFilter.Get("dangling")[0])
assert.Check(t, is.Equal("true", pruneFilter.Get("dangling")[0]))
return types.ImagesPruneReport{
ImagesDeleted: []types.ImageDeleteResponseItem{{Deleted: "image1"}},
SpaceReclaimed: 1,
@ -74,7 +74,7 @@ func TestNewPruneCommandSuccess(t *testing.T) {
name: "force-untagged",
args: []string{"--force"},
imagesPruneFunc: func(pruneFilter filters.Args) (types.ImagesPruneReport, error) {
assert.Equal(t, "true", pruneFilter.Get("dangling")[0])
assert.Check(t, is.Equal("true", pruneFilter.Get("dangling")[0]))
return types.ImagesPruneReport{
ImagesDeleted: []types.ImageDeleteResponseItem{{Untagged: "image1"}},
SpaceReclaimed: 2,
@ -88,7 +88,7 @@ func TestNewPruneCommandSuccess(t *testing.T) {
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
err := cmd.Execute()
assert.NoError(t, err)
assert.NilError(t, err)
golden.Assert(t, cli.OutBuffer().String(), fmt.Sprintf("prune-command-success.%s.golden", tc.name))
}
}

View File

@ -14,9 +14,10 @@ import (
)
type pullOptions struct {
remote string
all bool
platform string
remote string
all bool
platform string
untrusted bool
}
// NewPullCommand creates a new `docker pull` command
@ -38,7 +39,7 @@ func NewPullCommand(dockerCli command.Cli) *cobra.Command {
flags.BoolVarP(&opts.all, "all-tags", "a", false, "Download all tagged images in the repository")
command.AddPlatformFlag(flags, &opts.platform)
command.AddTrustVerificationFlags(flags)
command.AddTrustVerificationFlags(flags, &opts.untrusted, dockerCli.ContentTrustEnabled())
return cmd
}
@ -58,14 +59,14 @@ func runPull(cli command.Cli, opts pullOptions) error {
}
ctx := context.Background()
imgRefAndAuth, err := trust.GetImageReferencesAndAuth(ctx, AuthResolver(cli), distributionRef.String())
imgRefAndAuth, err := trust.GetImageReferencesAndAuth(ctx, nil, AuthResolver(cli), distributionRef.String())
if err != nil {
return err
}
// Check if reference has a digest
_, isCanonical := distributionRef.(reference.Canonical)
if command.IsTrusted() && !isCanonical {
if !opts.untrusted && !isCanonical {
err = trustedPull(ctx, cli, imgRefAndAuth, opts.platform)
} else {
err = imagePullPrivileged(ctx, cli, imgRefAndAuth, opts.all, opts.platform)

View File

@ -8,10 +8,11 @@ import (
"testing"
"github.com/docker/cli/internal/test"
"github.com/docker/cli/internal/test/testutil"
"github.com/docker/cli/internal/test/notary"
"github.com/docker/docker/api/types"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/gotestyourself/gotestyourself/golden"
"github.com/stretchr/testify/assert"
)
func TestNewPullCommandErrors(t *testing.T) {
@ -41,7 +42,7 @@ func TestNewPullCommandErrors(t *testing.T) {
cmd := NewPullCommand(cli)
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
testutil.ErrorContains(t, cmd.Execute(), tc.expectedError)
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
}
}
@ -65,7 +66,7 @@ func TestNewPullCommandSuccess(t *testing.T) {
for _, tc := range testCases {
cli := test.NewFakeCli(&fakeClient{
imagePullFunc: func(ref string, options types.ImagePullOptions) (io.ReadCloser, error) {
assert.Equal(t, tc.expectedTag, ref, tc.name)
assert.Check(t, is.Equal(tc.expectedTag, ref), tc.name)
return ioutil.NopCloser(strings.NewReader("")), nil
},
})
@ -73,7 +74,48 @@ func TestNewPullCommandSuccess(t *testing.T) {
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
err := cmd.Execute()
assert.NoError(t, err)
assert.NilError(t, err)
golden.Assert(t, cli.OutBuffer().String(), fmt.Sprintf("pull-command-success.%s.golden", tc.name))
}
}
func TestNewPullCommandWithContentTrustErrors(t *testing.T) {
testCases := []struct {
name string
args []string
expectedError string
notaryFunc test.NotaryClientFuncType
}{
{
name: "offline-notary-server",
notaryFunc: notary.GetOfflineNotaryRepository,
expectedError: "client is offline",
args: []string{"image:tag"},
},
{
name: "uninitialized-notary-server",
notaryFunc: notary.GetUninitializedNotaryRepository,
expectedError: "remote trust data does not exist",
args: []string{"image:tag"},
},
{
name: "empty-notary-server",
notaryFunc: notary.GetEmptyTargetsNotaryRepository,
expectedError: "No valid trust data for tag",
args: []string{"image:tag"},
},
}
for _, tc := range testCases {
cli := test.NewFakeCli(&fakeClient{
imagePullFunc: func(ref string, options types.ImagePullOptions) (io.ReadCloser, error) {
return ioutil.NopCloser(strings.NewReader("")), fmt.Errorf("shouldn't try to pull image")
},
}, test.EnableContentTrust)
cli.SetNotaryClient(tc.notaryFunc)
cmd := NewPullCommand(cli)
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
err := cmd.Execute()
assert.ErrorContains(t, err, tc.expectedError)
}
}

View File

@ -11,26 +11,34 @@ import (
"github.com/spf13/cobra"
)
type pushOptions struct {
remote string
untrusted bool
}
// NewPushCommand creates a new `docker push` command
func NewPushCommand(dockerCli command.Cli) *cobra.Command {
var opts pushOptions
cmd := &cobra.Command{
Use: "push [OPTIONS] NAME[:TAG]",
Short: "Push an image or a repository to a registry",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return runPush(dockerCli, args[0])
opts.remote = args[0]
return runPush(dockerCli, opts)
},
}
flags := cmd.Flags()
command.AddTrustSigningFlags(flags)
command.AddTrustSigningFlags(flags, &opts.untrusted, dockerCli.ContentTrustEnabled())
return cmd
}
func runPush(dockerCli command.Cli, remote string) error {
ref, err := reference.ParseNormalizedNamed(remote)
func runPush(dockerCli command.Cli, opts pushOptions) error {
ref, err := reference.ParseNormalizedNamed(opts.remote)
if err != nil {
return err
}
@ -47,7 +55,7 @@ func runPush(dockerCli command.Cli, remote string) error {
authConfig := command.ResolveAuthConfig(ctx, dockerCli, repoInfo.Index)
requestPrivilege := command.RegistryAuthenticationPrivilegedFunc(dockerCli, repoInfo.Index, "push")
if command.IsTrusted() {
if !opts.untrusted {
return TrustedPush(ctx, dockerCli, repoInfo, ref, authConfig, requestPrivilege)
}

View File

@ -7,10 +7,9 @@ import (
"testing"
"github.com/docker/cli/internal/test"
"github.com/docker/cli/internal/test/testutil"
"github.com/docker/docker/api/types"
"github.com/gotestyourself/gotestyourself/assert"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
)
func TestNewPushCommandErrors(t *testing.T) {
@ -38,18 +37,13 @@ func TestNewPushCommandErrors(t *testing.T) {
return ioutil.NopCloser(strings.NewReader("")), errors.Errorf("Failed to push")
},
},
{
name: "trust-error",
args: []string{"--disable-content-trust=false", "image:repo"},
expectedError: "you are not authorized to perform this operation: server returned 401.",
},
}
for _, tc := range testCases {
cli := test.NewFakeCli(&fakeClient{imagePushFunc: tc.imagePushFunc})
cmd := NewPushCommand(cli)
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
testutil.ErrorContains(t, cmd.Execute(), tc.expectedError)
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
}
}
@ -72,6 +66,6 @@ func TestNewPushCommandSuccess(t *testing.T) {
cmd := NewPushCommand(cli)
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
assert.NoError(t, cmd.Execute())
assert.NilError(t, cmd.Execute())
}
}

View File

@ -81,7 +81,7 @@ func runRemove(dockerCli command.Cli, opts removeOptions, images []string) error
if !opts.force || fatalErr {
return errors.New(msg)
}
fmt.Fprintf(dockerCli.Err(), msg)
fmt.Fprintln(dockerCli.Err(), msg)
}
return nil
}

View File

@ -6,11 +6,11 @@ import (
"testing"
"github.com/docker/cli/internal/test"
"github.com/docker/cli/internal/test/testutil"
"github.com/docker/docker/api/types"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/gotestyourself/gotestyourself/golden"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
)
type notFound struct {
@ -27,9 +27,9 @@ func (n notFound) NotFound() bool {
func TestNewRemoveCommandAlias(t *testing.T) {
cmd := newRemoveCommand(test.NewFakeCli(&fakeClient{}))
assert.True(t, cmd.HasAlias("rmi"))
assert.True(t, cmd.HasAlias("remove"))
assert.False(t, cmd.HasAlias("other"))
assert.Check(t, cmd.HasAlias("rmi"))
assert.Check(t, cmd.HasAlias("remove"))
assert.Check(t, !cmd.HasAlias("other"))
}
func TestNewRemoveCommandErrors(t *testing.T) {
@ -48,7 +48,7 @@ func TestNewRemoveCommandErrors(t *testing.T) {
args: []string{"-f", "image1"},
expectedError: "error removing image",
imageRemoveFunc: func(image string, options types.ImageRemoveOptions) ([]types.ImageDeleteResponseItem, error) {
assert.Equal(t, "image1", image)
assert.Check(t, is.Equal("image1", image))
return []types.ImageDeleteResponseItem{}, errors.Errorf("error removing image")
},
},
@ -57,8 +57,8 @@ func TestNewRemoveCommandErrors(t *testing.T) {
args: []string{"arg1"},
expectedError: "error removing image",
imageRemoveFunc: func(image string, options types.ImageRemoveOptions) ([]types.ImageDeleteResponseItem, error) {
assert.False(t, options.Force)
assert.True(t, options.PruneChildren)
assert.Check(t, !options.Force)
assert.Check(t, options.PruneChildren)
return []types.ImageDeleteResponseItem{}, errors.Errorf("error removing image")
},
},
@ -70,7 +70,7 @@ func TestNewRemoveCommandErrors(t *testing.T) {
}))
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
testutil.ErrorContains(t, cmd.Execute(), tc.expectedError)
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
})
}
}
@ -86,7 +86,7 @@ func TestNewRemoveCommandSuccess(t *testing.T) {
name: "Image Deleted",
args: []string{"image1"},
imageRemoveFunc: func(image string, options types.ImageRemoveOptions) ([]types.ImageDeleteResponseItem, error) {
assert.Equal(t, "image1", image)
assert.Check(t, is.Equal("image1", image))
return []types.ImageDeleteResponseItem{{Deleted: image}}, nil
},
},
@ -94,18 +94,18 @@ func TestNewRemoveCommandSuccess(t *testing.T) {
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)
assert.Equal(t, true, options.Force)
assert.Check(t, is.Equal("image1", image))
assert.Check(t, is.Equal(true, options.Force))
return []types.ImageDeleteResponseItem{}, notFound{"image1"}
},
expectedStderr: "Error: No such image: image1",
expectedStderr: "Error: No such image: image1\n",
},
{
name: "Image Untagged",
args: []string{"image1"},
imageRemoveFunc: func(image string, options types.ImageRemoveOptions) ([]types.ImageDeleteResponseItem, error) {
assert.Equal(t, "image1", image)
assert.Check(t, is.Equal("image1", image))
return []types.ImageDeleteResponseItem{{Untagged: image}}, nil
},
},
@ -126,8 +126,8 @@ func TestNewRemoveCommandSuccess(t *testing.T) {
cmd := NewRemoveCommand(cli)
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
assert.NoError(t, cmd.Execute())
assert.Equal(t, tc.expectedStderr, cli.ErrBuffer().String())
assert.NilError(t, cmd.Execute())
assert.Check(t, is.Equal(tc.expectedStderr, cli.ErrBuffer().String()))
golden.Assert(t, cli.OutBuffer().String(), fmt.Sprintf("remove-command-success.%s.golden", tc.name))
})
}

View File

@ -8,10 +8,9 @@ import (
"testing"
"github.com/docker/cli/internal/test"
"github.com/docker/cli/internal/test/testutil"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestNewSaveCommandErrors(t *testing.T) {
@ -54,7 +53,7 @@ func TestNewSaveCommandErrors(t *testing.T) {
cmd := NewSaveCommand(cli)
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
testutil.ErrorContains(t, cmd.Execute(), tc.expectedError)
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
}
}
@ -69,8 +68,8 @@ func TestNewSaveCommandSuccess(t *testing.T) {
args: []string{"-o", "save_tmp_file", "arg1"},
isTerminal: true,
imageSaveFunc: func(images []string) (io.ReadCloser, error) {
require.Len(t, images, 1)
assert.Equal(t, "arg1", images[0])
assert.Assert(t, is.Len(images, 1))
assert.Check(t, is.Equal("arg1", images[0]))
return ioutil.NopCloser(strings.NewReader("")), nil
},
deferredFunc: func() {
@ -81,9 +80,9 @@ func TestNewSaveCommandSuccess(t *testing.T) {
args: []string{"arg1", "arg2"},
isTerminal: false,
imageSaveFunc: func(images []string) (io.ReadCloser, error) {
require.Len(t, images, 2)
assert.Equal(t, "arg1", images[0])
assert.Equal(t, "arg2", images[1])
assert.Assert(t, is.Len(images, 2))
assert.Check(t, is.Equal("arg1", images[0]))
assert.Check(t, is.Equal("arg2", images[1]))
return ioutil.NopCloser(strings.NewReader("")), nil
},
},
@ -96,7 +95,7 @@ func TestNewSaveCommandSuccess(t *testing.T) {
}))
cmd.SetOutput(ioutil.Discard)
cmd.SetArgs(tc.args)
assert.NoError(t, cmd.Execute())
assert.NilError(t, cmd.Execute())
if tc.deferredFunc != nil {
tc.deferredFunc()
}

View File

@ -5,8 +5,8 @@ import (
"testing"
"github.com/docker/cli/internal/test"
"github.com/docker/cli/internal/test/testutil"
"github.com/stretchr/testify/assert"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
)
func TestCliNewTagCommandErrors(t *testing.T) {
@ -20,7 +20,7 @@ func TestCliNewTagCommandErrors(t *testing.T) {
cmd := NewTagCommand(test.NewFakeCli(&fakeClient{}))
cmd.SetArgs(args)
cmd.SetOutput(ioutil.Discard)
testutil.ErrorContains(t, cmd.Execute(), expectedError)
assert.ErrorContains(t, cmd.Execute(), expectedError)
}
}
@ -28,14 +28,14 @@ func TestCliNewTagCommand(t *testing.T) {
cmd := NewTagCommand(
test.NewFakeCli(&fakeClient{
imageTagFunc: func(image string, ref string) error {
assert.Equal(t, "image1", image)
assert.Equal(t, "image2", ref)
assert.Check(t, is.Equal("image1", image))
assert.Check(t, is.Equal("image2", ref))
return nil
},
}))
cmd.SetArgs([]string{"image1", "image2"})
cmd.SetOutput(ioutil.Discard)
assert.NoError(t, cmd.Execute())
assert.NilError(t, cmd.Execute())
value, _ := cmd.Flags().GetBool("interspersed")
assert.False(t, value)
assert.Check(t, !value)
}

View File

@ -0,0 +1,2 @@
IMAGE CREATED AT CREATED BY SIZE COMMENT
abcdef 2017-01-01T12:00:03Z rose 0 new history item!

View File

@ -198,7 +198,7 @@ func trustedPull(ctx context.Context, cli command.Cli, imgRefAndAuth trust.Image
if err != nil {
return err
}
updatedImgRefAndAuth, err := trust.GetImageReferencesAndAuth(ctx, AuthResolver(cli), trustedRef.String())
updatedImgRefAndAuth, err := trust.GetImageReferencesAndAuth(ctx, nil, AuthResolver(cli), trustedRef.String())
if err != nil {
return err
}
@ -293,35 +293,24 @@ func imagePullPrivileged(ctx context.Context, cli command.Cli, imgRefAndAuth tru
// TrustedReference returns the canonical trusted reference for an image reference
func TrustedReference(ctx context.Context, cli command.Cli, ref reference.NamedTagged, rs registry.Service) (reference.Canonical, error) {
var (
repoInfo *registry.RepositoryInfo
err error
)
if rs != nil {
repoInfo, err = rs.ResolveRepository(ref)
} else {
repoInfo, err = registry.ParseRepositoryInfo(ref)
}
imgRefAndAuth, err := trust.GetImageReferencesAndAuth(ctx, rs, AuthResolver(cli), ref.String())
if err != nil {
return nil, err
}
// Resolve the Auth config relevant for this server
authConfig := command.ResolveAuthConfig(ctx, cli, repoInfo.Index)
notaryRepo, err := trust.GetNotaryRepository(cli.In(), cli.Out(), command.UserAgent(), repoInfo, &authConfig, "pull")
notaryRepo, err := cli.NotaryClient(imgRefAndAuth, []string{"pull"})
if err != nil {
return nil, errors.Wrap(err, "error establishing connection to trust repository")
}
t, err := notaryRepo.GetTargetByName(ref.Tag(), trust.ReleasesRole, data.CanonicalTargetsRole)
if err != nil {
return nil, trust.NotaryError(repoInfo.Name.Name(), err)
return nil, trust.NotaryError(imgRefAndAuth.RepoInfo().Name.Name(), err)
}
// 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(), client.ErrNoSuchTarget(ref.Tag()))
return nil, trust.NotaryError(imgRefAndAuth.RepoInfo().Name.Name(), client.ErrNoSuchTarget(ref.Tag()))
}
r, err := convertTarget(t.Target)
if err != nil {

View File

@ -8,8 +8,7 @@ import (
"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/gotestyourself/gotestyourself/assert"
"github.com/theupdateframework/notary/client"
"github.com/theupdateframework/notary/passphrase"
"github.com/theupdateframework/notary/trustpinning"
@ -64,12 +63,12 @@ func TestNonOfficialTrustServer(t *testing.T) {
func TestAddTargetToAllSignableRolesError(t *testing.T) {
tmpDir, err := ioutil.TempDir("", "notary-test-")
assert.NoError(t, err)
assert.NilError(t, err)
defer os.RemoveAll(tmpDir)
notaryRepo, err := client.NewFileCachedRepository(tmpDir, "gun", "https://localhost", nil, passphrase.ConstantRetriever("password"), trustpinning.TrustPinConfig{})
require.NoError(t, err)
assert.NilError(t, err)
target := client.Target{}
err = AddTargetToAllSignableRoles(notaryRepo, &target)
assert.EqualError(t, err, "client is offline")
assert.Error(t, err, "client is offline")
}

View File

@ -6,8 +6,8 @@ import (
"testing"
"github.com/docker/cli/templates"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
)
type testElement struct {
@ -243,17 +243,17 @@ func TestTemplateInspectorRawFallbackNumber(t *testing.T) {
}
b := new(bytes.Buffer)
tmpl, err := templates.Parse("{{.Size}} {{.Id}}")
require.NoError(t, err)
assert.NilError(t, err)
i := NewTemplateInspector(b, tmpl)
for _, tc := range testcases {
err = i.Inspect(typedElem, tc.raw)
require.NoError(t, err)
assert.NilError(t, err)
err = i.Flush()
require.NoError(t, err)
assert.NilError(t, err)
assert.Equal(t, tc.exp, b.String())
assert.Check(t, is.Equal(tc.exp, b.String()))
b.Reset()
}
}

View File

@ -0,0 +1,93 @@
package manifest
import (
"fmt"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/cli/manifest/store"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)
type annotateOptions struct {
target string // the target manifest list name (also transaction ID)
image string // the manifest to annotate within the list
variant string // an architecture variant
os string
arch string
osFeatures []string
}
// NewAnnotateCommand creates a new `docker manifest annotate` command
func newAnnotateCommand(dockerCli command.Cli) *cobra.Command {
var opts annotateOptions
cmd := &cobra.Command{
Use: "annotate [OPTIONS] MANIFEST_LIST MANIFEST",
Short: "Add additional information to a local image manifest",
Args: cli.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
opts.target = args[0]
opts.image = args[1]
return runManifestAnnotate(dockerCli, opts)
},
}
flags := cmd.Flags()
flags.StringVar(&opts.os, "os", "", "Set operating system")
flags.StringVar(&opts.arch, "arch", "", "Set architecture")
flags.StringSliceVar(&opts.osFeatures, "os-features", []string{}, "Set operating system feature")
flags.StringVar(&opts.variant, "variant", "", "Set architecture variant")
return cmd
}
func runManifestAnnotate(dockerCli command.Cli, opts annotateOptions) error {
targetRef, err := normalizeReference(opts.target)
if err != nil {
return errors.Wrapf(err, "annotate: error parsing name for manifest list %s", opts.target)
}
imgRef, err := normalizeReference(opts.image)
if err != nil {
return errors.Wrapf(err, "annotate: error parsing name for manifest %s", opts.image)
}
manifestStore := dockerCli.ManifestStore()
imageManifest, err := manifestStore.Get(targetRef, imgRef)
switch {
case store.IsNotFound(err):
return fmt.Errorf("manifest for image %s does not exist in %s", opts.image, opts.target)
case err != nil:
return err
}
// Update the mf
if opts.os != "" {
imageManifest.Platform.OS = opts.os
}
if opts.arch != "" {
imageManifest.Platform.Architecture = opts.arch
}
for _, osFeature := range opts.osFeatures {
imageManifest.Platform.OSFeatures = appendIfUnique(imageManifest.Platform.OSFeatures, osFeature)
}
if opts.variant != "" {
imageManifest.Platform.Variant = opts.variant
}
if !isValidOSArch(imageManifest.Platform.OS, imageManifest.Platform.Architecture) {
return errors.Errorf("manifest entry for image has unsupported os/arch combination: %s/%s", opts.os, opts.arch)
}
return manifestStore.Save(targetRef, imgRef, imageManifest)
}
func appendIfUnique(list []string, str string) []string {
for _, s := range list {
if s == str {
return list
}
}
return append(list, str)
}

View File

@ -0,0 +1,77 @@
package manifest
import (
"io/ioutil"
"testing"
"github.com/docker/cli/internal/test"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/gotestyourself/gotestyourself/golden"
)
func TestManifestAnnotateError(t *testing.T) {
testCases := []struct {
args []string
expectedError string
}{
{
args: []string{"too-few-arguments"},
expectedError: "requires exactly 2 arguments",
},
{
args: []string{"th!si'sa/fa!ke/li$t/name", "example.com/alpine:3.0"},
expectedError: "error parsing name for manifest list",
},
{
args: []string{"example.com/list:v1", "th!si'sa/fa!ke/im@ge/nam32"},
expectedError: "error parsing name for manifest",
},
}
for _, tc := range testCases {
cli := test.NewFakeCli(nil)
cmd := newAnnotateCommand(cli)
cmd.SetArgs(tc.args)
cmd.SetOutput(ioutil.Discard)
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
}
}
func TestManifestAnnotate(t *testing.T) {
store, cleanup := newTempManifestStore(t)
defer cleanup()
cli := test.NewFakeCli(nil)
cli.SetManifestStore(store)
namedRef := ref(t, "alpine:3.0")
imageManifest := fullImageManifest(t, namedRef)
err := store.Save(ref(t, "list:v1"), namedRef, imageManifest)
assert.NilError(t, err)
cmd := newAnnotateCommand(cli)
cmd.SetArgs([]string{"example.com/list:v1", "example.com/fake:0.0"})
cmd.SetOutput(ioutil.Discard)
expectedError := "manifest for image example.com/fake:0.0 does not exist"
assert.ErrorContains(t, cmd.Execute(), expectedError)
cmd.SetArgs([]string{"example.com/list:v1", "example.com/alpine:3.0"})
cmd.Flags().Set("os", "freebsd")
cmd.Flags().Set("arch", "fake")
cmd.Flags().Set("os-features", "feature1")
cmd.Flags().Set("variant", "v7")
expectedError = "manifest entry for image has unsupported os/arch combination"
assert.ErrorContains(t, cmd.Execute(), expectedError)
cmd.Flags().Set("arch", "arm")
assert.NilError(t, cmd.Execute())
cmd = newInspectCommand(cli)
err = cmd.Flags().Set("verbose", "true")
assert.NilError(t, err)
cmd.SetArgs([]string{"example.com/list:v1", "example.com/alpine:3.0"})
assert.NilError(t, cmd.Execute())
actual := cli.OutBuffer()
expected := golden.Get(t, "inspect-annotate.golden")
assert.Check(t, is.Equal(string(expected), actual.String()))
}

View File

@ -0,0 +1,46 @@
package manifest
import (
manifesttypes "github.com/docker/cli/cli/manifest/types"
"github.com/docker/cli/cli/registry/client"
"github.com/docker/distribution"
"github.com/docker/distribution/reference"
"github.com/opencontainers/go-digest"
"golang.org/x/net/context"
)
type fakeRegistryClient struct {
client.RegistryClient
getManifestFunc func(ctx context.Context, ref reference.Named) (manifesttypes.ImageManifest, error)
getManifestListFunc func(ctx context.Context, ref reference.Named) ([]manifesttypes.ImageManifest, error)
mountBlobFunc func(ctx context.Context, source reference.Canonical, target reference.Named) error
putManifestFunc func(ctx context.Context, source reference.Named, mf distribution.Manifest) (digest.Digest, error)
}
func (c *fakeRegistryClient) GetManifest(ctx context.Context, ref reference.Named) (manifesttypes.ImageManifest, error) {
if c.getManifestFunc != nil {
return c.getManifestFunc(ctx, ref)
}
return manifesttypes.ImageManifest{}, nil
}
func (c *fakeRegistryClient) GetManifestList(ctx context.Context, ref reference.Named) ([]manifesttypes.ImageManifest, error) {
if c.getManifestListFunc != nil {
return c.getManifestListFunc(ctx, ref)
}
return nil, nil
}
func (c *fakeRegistryClient) MountBlob(ctx context.Context, source reference.Canonical, target reference.Named) error {
if c.mountBlobFunc != nil {
return c.mountBlobFunc(ctx, source, target)
}
return nil
}
func (c *fakeRegistryClient) PutManifest(ctx context.Context, ref reference.Named, mf distribution.Manifest) (digest.Digest, error) {
if c.putManifestFunc != nil {
return c.putManifestFunc(ctx, ref, mf)
}
return digest.Digest(""), nil
}

View File

@ -0,0 +1,45 @@
package manifest
import (
"fmt"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/spf13/cobra"
)
// NewManifestCommand returns a cobra command for `manifest` subcommands
func NewManifestCommand(dockerCli command.Cli) *cobra.Command {
// use dockerCli as command.Cli
cmd := &cobra.Command{
Use: "manifest COMMAND",
Short: "Manage Docker image manifests and manifest lists",
Long: manifestDescription,
Args: cli.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
fmt.Fprintf(dockerCli.Err(), "\n"+cmd.UsageString())
},
Annotations: map[string]string{"experimentalCLI": ""},
}
cmd.AddCommand(
newCreateListCommand(dockerCli),
newInspectCommand(dockerCli),
newAnnotateCommand(dockerCli),
newPushListCommand(dockerCli),
)
return cmd
}
var manifestDescription = `
The **docker manifest** command has subcommands for managing image manifests and
manifest lists. A manifest list allows you to use one name to refer to the same image
built for multiple architectures.
To see help for a subcommand, use:
docker manifest CMD --help
For full details on using docker manifest lists, see the registry v2 specification.
`

View File

@ -0,0 +1,82 @@
package manifest
import (
"fmt"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/cli/manifest/store"
"github.com/docker/docker/registry"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"golang.org/x/net/context"
)
type createOpts struct {
amend bool
insecure bool
}
func newCreateListCommand(dockerCli command.Cli) *cobra.Command {
opts := createOpts{}
cmd := &cobra.Command{
Use: "create MANIFEST_LIST MANIFEST [MANIFEST...]",
Short: "Create a local manifest list for annotating and pushing to a registry",
Args: cli.RequiresMinArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
return createManifestList(dockerCli, args, opts)
},
}
flags := cmd.Flags()
flags.BoolVar(&opts.insecure, "insecure", false, "allow communication with an insecure registry")
flags.BoolVarP(&opts.amend, "amend", "a", false, "Amend an existing manifest list")
return cmd
}
func createManifestList(dockerCli command.Cli, args []string, opts createOpts) error {
newRef := args[0]
targetRef, err := normalizeReference(newRef)
if err != nil {
return errors.Wrapf(err, "error parsing name for manifest list %s", newRef)
}
_, err = registry.ParseRepositoryInfo(targetRef)
if err != nil {
return errors.Wrapf(err, "error parsing repository name for manifest list %s", newRef)
}
manifestStore := dockerCli.ManifestStore()
_, err = manifestStore.GetList(targetRef)
switch {
case store.IsNotFound(err):
// New manifest list
case err != nil:
return err
case !opts.amend:
return errors.Errorf("refusing to amend an existing manifest list with no --amend flag")
}
ctx := context.Background()
// Now create the local manifest list transaction by looking up the manifest schemas
// for the constituent images:
manifests := args[1:]
for _, manifestRef := range manifests {
namedRef, err := normalizeReference(manifestRef)
if err != nil {
// TODO: wrap error?
return err
}
manifest, err := getManifest(ctx, dockerCli, targetRef, namedRef, opts.insecure)
if err != nil {
return err
}
if err := manifestStore.Save(targetRef, namedRef, manifest); err != nil {
return err
}
}
fmt.Fprintf(dockerCli.Out(), "Created manifest list %s\n", targetRef.String())
return nil
}

View File

@ -0,0 +1,116 @@
package manifest
import (
"io/ioutil"
"testing"
manifesttypes "github.com/docker/cli/cli/manifest/types"
"github.com/docker/cli/internal/test"
"github.com/docker/distribution/reference"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/gotestyourself/gotestyourself/golden"
"github.com/pkg/errors"
"golang.org/x/net/context"
)
func TestManifestCreateErrors(t *testing.T) {
testCases := []struct {
args []string
expectedError string
}{
{
args: []string{"too-few-arguments"},
expectedError: "requires at least 2 arguments",
},
{
args: []string{"th!si'sa/fa!ke/li$t/name", "example.com/alpine:3.0"},
expectedError: "error parsing name for manifest list",
},
}
for _, tc := range testCases {
cli := test.NewFakeCli(nil)
cmd := newCreateListCommand(cli)
cmd.SetArgs(tc.args)
cmd.SetOutput(ioutil.Discard)
assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
}
}
// create a manifest list, then overwrite it, and inspect to see if the old one is still there
func TestManifestCreateAmend(t *testing.T) {
store, cleanup := newTempManifestStore(t)
defer cleanup()
cli := test.NewFakeCli(nil)
cli.SetManifestStore(store)
namedRef := ref(t, "alpine:3.0")
imageManifest := fullImageManifest(t, namedRef)
err := store.Save(ref(t, "list:v1"), namedRef, imageManifest)
assert.NilError(t, err)
namedRef = ref(t, "alpine:3.1")
imageManifest = fullImageManifest(t, namedRef)
err = store.Save(ref(t, "list:v1"), namedRef, imageManifest)
assert.NilError(t, err)
cmd := newCreateListCommand(cli)
cmd.SetArgs([]string{"example.com/list:v1", "example.com/alpine:3.1"})
cmd.Flags().Set("amend", "true")
cmd.SetOutput(ioutil.Discard)
err = cmd.Execute()
assert.NilError(t, err)
// make a new cli to clear the buffers
cli = test.NewFakeCli(nil)
cli.SetManifestStore(store)
inspectCmd := newInspectCommand(cli)
inspectCmd.SetArgs([]string{"example.com/list:v1"})
assert.NilError(t, inspectCmd.Execute())
actual := cli.OutBuffer()
expected := golden.Get(t, "inspect-manifest-list.golden")
assert.Check(t, is.Equal(string(expected), actual.String()))
}
// attempt to overwrite a saved manifest and get refused
func TestManifestCreateRefuseAmend(t *testing.T) {
store, cleanup := newTempManifestStore(t)
defer cleanup()
cli := test.NewFakeCli(nil)
cli.SetManifestStore(store)
namedRef := ref(t, "alpine:3.0")
imageManifest := fullImageManifest(t, namedRef)
err := store.Save(ref(t, "list:v1"), namedRef, imageManifest)
assert.NilError(t, err)
cmd := newCreateListCommand(cli)
cmd.SetArgs([]string{"example.com/list:v1", "example.com/alpine:3.0"})
cmd.SetOutput(ioutil.Discard)
err = cmd.Execute()
assert.Error(t, err, "refusing to amend an existing manifest list with no --amend flag")
}
// attempt to make a manifest list without valid images
func TestManifestCreateNoManifest(t *testing.T) {
store, cleanup := newTempManifestStore(t)
defer cleanup()
cli := test.NewFakeCli(nil)
cli.SetManifestStore(store)
cli.SetRegistryClient(&fakeRegistryClient{
getManifestFunc: func(_ context.Context, ref reference.Named) (manifesttypes.ImageManifest, error) {
return manifesttypes.ImageManifest{}, errors.Errorf("No such image: %v", ref)
},
getManifestListFunc: func(ctx context.Context, ref reference.Named) ([]manifesttypes.ImageManifest, error) {
return nil, errors.Errorf("No such manifest: %s", ref)
},
})
cmd := newCreateListCommand(cli)
cmd.SetArgs([]string{"example.com/list:v1", "example.com/alpine:3.0"})
cmd.SetOutput(ioutil.Discard)
err := cmd.Execute()
assert.Error(t, err, "No such image: example.com/alpine:3.0")
}

View File

@ -0,0 +1,147 @@
package manifest
import (
"bytes"
"encoding/json"
"fmt"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/cli/manifest/types"
"github.com/docker/distribution/manifest/manifestlist"
"github.com/docker/distribution/reference"
"github.com/docker/docker/registry"
"github.com/spf13/cobra"
"golang.org/x/net/context"
)
type inspectOptions struct {
ref string
list string
verbose bool
insecure bool
}
// NewInspectCommand creates a new `docker manifest inspect` command
func newInspectCommand(dockerCli command.Cli) *cobra.Command {
var opts inspectOptions
cmd := &cobra.Command{
Use: "inspect [OPTIONS] [MANIFEST_LIST] MANIFEST",
Short: "Display an image manifest, or manifest list",
Args: cli.RequiresRangeArgs(1, 2),
RunE: func(cmd *cobra.Command, args []string) error {
switch len(args) {
case 1:
opts.ref = args[0]
case 2:
opts.list = args[0]
opts.ref = args[1]
}
return runInspect(dockerCli, opts)
},
}
flags := cmd.Flags()
flags.BoolVar(&opts.insecure, "insecure", false, "allow communication with an insecure registry")
flags.BoolVarP(&opts.verbose, "verbose", "v", false, "Output additional info including layers and platform")
return cmd
}
func runInspect(dockerCli command.Cli, opts inspectOptions) error {
namedRef, err := normalizeReference(opts.ref)
if err != nil {
return err
}
// If list reference is provided, display the local manifest in a list
if opts.list != "" {
listRef, err := normalizeReference(opts.list)
if err != nil {
return err
}
imageManifest, err := dockerCli.ManifestStore().Get(listRef, namedRef)
if err != nil {
return err
}
return printManifest(dockerCli, imageManifest, opts)
}
// Try a local manifest list first
localManifestList, err := dockerCli.ManifestStore().GetList(namedRef)
if err == nil {
return printManifestList(dockerCli, namedRef, localManifestList, opts)
}
// Next try a remote manifest
ctx := context.Background()
registryClient := dockerCli.RegistryClient(opts.insecure)
imageManifest, err := registryClient.GetManifest(ctx, namedRef)
if err == nil {
return printManifest(dockerCli, imageManifest, opts)
}
// Finally try a remote manifest list
manifestList, err := registryClient.GetManifestList(ctx, namedRef)
if err != nil {
return err
}
return printManifestList(dockerCli, namedRef, manifestList, opts)
}
func printManifest(dockerCli command.Cli, manifest types.ImageManifest, opts inspectOptions) error {
buffer := new(bytes.Buffer)
if !opts.verbose {
_, raw, err := manifest.Payload()
if err != nil {
return err
}
if err := json.Indent(buffer, raw, "", "\t"); err != nil {
return err
}
fmt.Fprintln(dockerCli.Out(), buffer.String())
return nil
}
jsonBytes, err := json.MarshalIndent(manifest, "", "\t")
if err != nil {
return err
}
dockerCli.Out().Write(append(jsonBytes, '\n'))
return nil
}
func printManifestList(dockerCli command.Cli, namedRef reference.Named, list []types.ImageManifest, opts inspectOptions) error {
if !opts.verbose {
targetRepo, err := registry.ParseRepositoryInfo(namedRef)
if err != nil {
return err
}
manifests := []manifestlist.ManifestDescriptor{}
// More than one response. This is a manifest list.
for _, img := range list {
mfd, err := buildManifestDescriptor(targetRepo, img)
if err != nil {
return fmt.Errorf("error assembling ManifestDescriptor")
}
manifests = append(manifests, mfd)
}
deserializedML, err := manifestlist.FromDescriptors(manifests)
if err != nil {
return err
}
jsonBytes, err := deserializedML.MarshalJSON()
if err != nil {
return err
}
fmt.Fprintln(dockerCli.Out(), string(jsonBytes))
return nil
}
jsonBytes, err := json.MarshalIndent(list, "", "\t")
if err != nil {
return err
}
dockerCli.Out().Write(append(jsonBytes, '\n'))
return nil
}

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