Commit graph

4637 commits

Author SHA1 Message Date
Tõnis Tiigi
3fe2730ab3 Merge pull request #31535 from aaronlehmann/vendor-swarmkit-7fc7503
Vendor swarmkit d60ccf3
2017-03-08 09:52:28 -08:00
Justin Cormack
ab8a22de36 Merge pull request #31611 from tophj-ibm/skip-plugin-test
skip plugin test on non x86 architectures
2017-03-08 14:00:15 +00:00
Aaron Lehmann
39433318fe Vendor swarmkit d60ccf3
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-03-07 19:09:21 -08:00
Christopher Jones
e3c6cbed22 skip plugin test on non x86 architectures
Because the plugins in dockerhub aren't multi-arch, they will
fail on non x86-64 platforms. Comment this test out like we do with
the others.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2017-03-07 09:28:10 -05:00
allencloud
9d30525a04 make secret update support name and id prefix
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-03-07 16:01:21 +08:00
Tibor Vass
65068ea4c0 Merge pull request #31340 from anusha-ragunathan/plugin_nw_filter
Add network plugin filter test
2017-03-06 15:31:59 -08:00
Anusha Ragunathan
5e0e957061 Add network plugin filter test
Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
2017-03-06 12:05:20 -08:00
Vincent Demeester
b11ba1231e
Update request.* signature to remove the host
99.9% of use case for request call are using daemonHost. This makes it
default and adds a `request.DoOnHost` function to be able to specify
the host for specific, more complex use cases.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-03-06 16:41:33 +01:00
Vincent Demeester
95cb74818a Merge pull request #31450 from thaJeztah/fix-volume-force-remove
do not ignore "volume in use" errors when force-delete
2017-03-06 14:35:46 +01:00
Aaron Lehmann
f9bd8ec8b2 Implement server-side rollback, for daemon versions that support this
Server-side rollback can take advantage of the rollback-specific update
parameters, instead of being treated as a normal update that happens to
go back to a previous version of the spec.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-03-03 16:33:34 -08:00
Alessandro Boch
ef794c3649 Add test for anonymous container w/ net-alias on swarm network
Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-03-03 15:55:06 -08:00
Vincent Demeester
cddb8981ca Merge pull request #31522 from vdemeester/fix-clean-in-env
Ignore no such container in testEnv.Clean
2017-03-03 20:24:58 +01:00
Vincent Demeester
5dd89abdf1
Ignore no such container in testEnv.Clean
When moving the clean function there, this check was not ported and
generated some errors on the CI. `deleteContainer` now fail if any
error but the clean function won't if "no such container" (because of
some races -_-).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-03-03 15:57:27 +01:00
Sebastiaan van Stijn
3a5a1c3f3d Merge pull request #30725 from aaronlehmann/topology
Topology-aware scheduling
2017-03-03 15:01:12 +01:00
Sebastiaan van Stijn
1a412a0470 Merge pull request #31460 from vdemeester/integration-clean-in-env-p1
Move TearDownTest cleaning to environment package
2017-03-02 09:51:46 +01:00
Brian Goff
563eb10202 Merge pull request #31434 from tophj-ibm/skip-more-plugin-tests
[multi-arch] skip more plugin tests on non-x86
2017-03-01 16:01:28 -05:00
Sebastiaan van Stijn
01ed606439 Merge pull request #29775 from AkihiroSuda/integration-cli-on-swarm
[EXPERIMENTAL] Integration Test on Swarm (completes in about 5 minutes, with 10 Swarm nodes)
2017-03-01 21:16:05 +01:00
Vincent Demeester
1858656925
Move TearDownTest cleaning to environment package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-03-01 21:04:11 +01:00
Sebastiaan van Stijn
bb9f19503c Merge pull request #30754 from yongtang/25696-stop-signal
Add `--stop-signal` for `service create` and `service update`
2017-03-01 18:10:57 +01:00
Sebastiaan van Stijn
9d521a4d2f
do not ignore "volume in use" errors when force-delete
When using `docker volume rm -f`, all errors were ignored,
and volumes where Purged, even if they were still in
use by a container.

As a result, repeated calls to `docker volume rm -f`
actually removed the volume.

The `-f` option was implemented to ignore errors
in case a volume was already removed out-of-band
by a volume driver plugin.

This patch changes the remove function to not
ignore "volume in use" errors if `-f` is used.
Other errors are still ignored as before.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-03-01 16:36:43 +01:00
Sebastiaan van Stijn
fabe16ee34 Merge pull request #31412 from vdemeester/integration-request-pass
[test-integration] convert request.SockRequestRaw to appropriate methods
2017-03-01 14:15:50 +01:00
Sebastiaan van Stijn
822abee151 Merge pull request #31124 from vdemeester/volume-unit-tests
Add unit tests to cli/command/volume package
2017-03-01 14:13:47 +01:00
lixiaobing10051267
2276de8704 fix wrong foo to zzz in docker_cli_build_test.go
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
2017-03-01 17:49:54 +08:00
Christopher Jones
362d082b6e
[multi-arch] skip more plugin tests on non-x86
Until the plugins are multi-arch plugins, or built on runtime,
skip these tests like we do with the remainder of the plugin tests.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2017-02-28 16:53:30 -05:00
Doug Davis
c127d9614f Add the mediaType to the error
Without this fix the error the client might see is:
	target is unknown
which wasn't helpful to me when I saw this today. With this fix I
now see:
	MediaType is unknown: 'text/html'
which helped me track down the issue to the registry I was talking to.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2017-02-28 11:36:32 -08:00
Vincent Demeester
f85ee17810
Convert request.SockRequestRaw to appropriate methods
`request.SockRequestRaw` is deprecated, let's use appropriate methods
for those. This is a first pass, `SockRequest` still needs to be removed.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-02-28 17:12:30 +01:00
lixiaobing10051267
5690de3c0e update Reported less Txbytes to RxPackets in docker_api_stats_test.go
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
2017-02-28 19:42:35 +08:00
Akihiro Suda
28797019b3 [EXPERIMENTAL] Integration Test on Swarm
This commit adds contrib/integration-cli-on-swarm/integration-cli-on-swarm.sh,
which enables IT to be running in parallel, using Swarm-mode and Funker.

Please refer to contrib/integration-cli-on-swarm/README.md

The test takes almost 5 to 6 minutes, with 10 n1-standard-4 GCE instances.

  $ ./contrib/integration-cli-on-swarm/integration-cli-on-swarm.sh --push-worker-image example.gcr.io/foo/bar --replicas 30 --shuffle
  2016/12/29 08:32:15 Loaded 1618 tests (30 chunks)
  2016/12/29 08:32:15 Executing 30 chunks in parallel, against "integration-cli-worker"
  2016/12/29 08:32:15 Executing chunk 0 (contains 54 test filters)
  ..
  2016/12/29 08:34:34 Finished chunk 28 [1/30] with 54 test filters in 2m19.098068003s, code=0.
  2016/12/29 08:34:38 Finished chunk 12 [2/30] with 54 test filters in 2m23.088569511s, code=0.
  2016/12/29 08:34:48 Finished chunk 10 [3/30] with 54 test filters in 2m33.880679079s, code=0.
  2016/12/29 08:34:54 Finished chunk 20 [4/30] with 54 test filters in 2m39.973747028s, code=0.
  2016/12/29 08:35:11 Finished chunk 18 [5/30] with 54 test filters in 2m56.28384361s, code=0.
  2016/12/29 08:35:11 Finished chunk 29 [6/30] with 52 test filters in 2m56.54047088s, code=0.
  2016/12/29 08:35:15 Finished chunk 1 [7/30] with 54 test filters in 3m0.285044426s, code=0.
  2016/12/29 08:35:22 Finished chunk 6 [8/30] with 54 test filters in 3m7.211775338s, code=0.
  2016/12/29 08:35:24 Finished chunk 25 [9/30] with 54 test filters in 3m9.938413009s, code=0.
  2016/12/29 08:35:30 Finished chunk 27 [10/30] with 54 test filters in 3m15.219834368s, code=0.
  2016/12/29 08:35:36 Finished chunk 9 [11/30] with 54 test filters in 3m21.615434162s, code=0.
  2016/12/29 08:35:41 Finished chunk 13 [12/30] with 54 test filters in 3m26.576907401s, code=0.
  2016/12/29 08:35:45 Finished chunk 17 [13/30] with 54 test filters in 3m30.290752537s, code=0.
  2016/12/29 08:35:53 Finished chunk 2 [14/30] with 54 test filters in 3m38.148423321s, code=0.
  2016/12/29 08:35:55 Finished chunk 24 [15/30] with 54 test filters in 3m40.09669137s, code=0.
  2016/12/29 08:35:57 Finished chunk 8 [16/30] with 54 test filters in 3m42.299945108s, code=0.
  2016/12/29 08:35:57 Finished chunk 22 [17/30] with 54 test filters in 3m42.946558809s, code=0.
  2016/12/29 08:35:59 Finished chunk 23 [18/30] with 54 test filters in 3m44.232557165s, code=0.
  2016/12/29 08:36:02 Finished chunk 3 [19/30] with 54 test filters in 3m47.112051358s, code=0.
  2016/12/29 08:36:11 Finished chunk 15 [20/30] with 54 test filters in 3m56.340656645s, code=0.
  2016/12/29 08:36:11 Finished chunk 11 [21/30] with 54 test filters in 3m56.882401231s, code=0.
  2016/12/29 08:36:22 Finished chunk 19 [22/30] with 54 test filters in 4m7.551093516s, code=0.
  2016/12/29 08:36:23 Finished chunk 21 [23/30] with 54 test filters in 4m8.221093446s, code=0.
  2016/12/29 08:36:25 Finished chunk 16 [24/30] with 54 test filters in 4m10.450451705s, code=0.
  2016/12/29 08:36:27 Finished chunk 5 [25/30] with 54 test filters in 4m12.162272692s, code=0.
  2016/12/29 08:36:28 Finished chunk 14 [26/30] with 54 test filters in 4m13.977801031s, code=0.
  2016/12/29 08:36:29 Finished chunk 0 [27/30] with 54 test filters in 4m14.34086812s, code=0.
  2016/12/29 08:36:49 Finished chunk 26 [28/30] with 54 test filters in 4m34.437085539s, code=0.
  2016/12/29 08:37:14 Finished chunk 7 [29/30] with 54 test filters in 4m59.22902721s, code=0.
  2016/12/29 08:37:20 Finished chunk 4 [30/30] with 54 test filters in 5m5.103469214s, code=0.
  2016/12/29 08:37:20 Executed 30 chunks in 5m5.104379119s. PASS: 30, FAIL: 0.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-02-28 02:10:09 +00:00
Aaron Lehmann
17288c611a Topology-aware scheduling
This adds support for placement preferences in Swarm services.

- Convert PlacementPreferences between GRPC API and HTTP API
- Add --placement-pref, --placement-pref-add and --placement-pref-rm to CLI
- Add support for placement preferences in service inspect --pretty
- Add integration test

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-02-27 13:29:54 -08:00
Aaron Lehmann
99119fcafa Vendor swarmkit 46bbd41
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-02-27 11:51:00 -08:00
Vincent Demeester
6da111b3bb
Add unit tests to cli/command/volume package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-02-27 18:39:35 +01:00
Sebastiaan van Stijn
a64ea37753 Merge pull request #30383 from TDAbboud/30096-add-host-docker-build
Add --add-host for docker build
2017-02-27 12:42:18 +01:00
lixiaobing10051267
8fff3ea3d6 rectify the function name used by note
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
2017-02-22 16:13:45 +08:00
Lei Jitang
ffc70d2f0c Merge pull request #31211 from lixiaobing10051267/masterAttach
invalide detach keys provided
2017-02-22 11:28:15 +08:00
lixiaobing10051267
660ec32e8f invalide detach keys provided
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
2017-02-22 09:48:18 +08:00
Yong Tang
c2d49ec214 Add --stop-signal for service create and service update
This fix tries to address the issue raised in 25696 where
it was not possible to specify `--stop-signal` for `docker service create`
and `docker service update`, in order to use special signal to stop
the container.

This fix adds `--stop-signal` and update the `StopSignal` in `Config`
through `service create` and `service update`.

Related docs has been updated.

Integration test has been added.

This fix fixes 25696.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-02-21 15:19:45 -08:00
Antonio Murdaca
1cf4b2b8bd
image/cache: fix isValidParent logic
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2017-02-21 19:32:04 +01:00
Tony Abboud
7a962e4577 Add --add-host for docker build
Signed-off-by: Tony Abboud <tdabboud@hotmail.com>
2017-02-20 17:32:28 -05:00
Brian Goff
95a2aed95e Merge pull request #31125 from thaJeztah/fix-TestPullFailsWithAlteredLayer
fix TestPullFailsWithAlteredLayer
2017-02-17 16:24:34 -05:00
Anusha Ragunathan
6dd2a82458 Merge pull request #29984 from jmzwcn/issueNNP
[feature]: add daemon flag to set no_new_priv as default for unprivileged containers
2017-02-17 11:43:43 -08:00
Sebastiaan van Stijn
4077614fb3
fix DockerSchema1RegistrySuite.TestPullFailsWithAlteredLayer
This test was failing if after the busybox image switched to a
single layer.

The test fails because it alters the data of an empty layer and
relies on a side effect of another empty layer not being skipped
on pull to pass.

(The original patch was provided by Tonis Tiigi)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-17 10:34:33 -08:00
Vincent Demeester
d07cd8c321 Merge pull request #29894 from cpuguy83/cleanup_volumedriver_retry_test
Use vol plugin creator instead of inserting spec
2017-02-17 09:46:31 +01:00
Vincent Demeester
c31f73abfd Merge pull request #29001 from darrenstahlmsft/WindowsOnLinux
Block pulling Windows images on non-Windows daemons
2017-02-16 19:57:54 +01:00
Alessandro Boch
91820b6941 Release the network attachment on allocation failure
- otherwise the attachment task will stay in store and
  consume IP addresses and there is no way to remove it.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-02-16 05:21:06 -08:00
Daniel Zhang
d7fda019bb Add daemon flag to set no_new_priv as default for unprivileged containers.
Signed-off-by: Daniel Zhang <jmzwcn@gmail.com>
2017-02-16 19:05:14 +08:00
Alexander Morozov
22472c8be5 Merge pull request #29702 from WeiZhang555/stats-all-format-name-panic
Send "Name" and "ID" when stating stopped containers
2017-02-14 10:48:42 -08:00
Akihiro Suda
eac68dbbbc Merge pull request #30340 from ijrandom/master
Fix #30311: dockerd leaks ExecIds on failed exec -i
2017-02-14 10:13:16 +09:00
Tianon Gravi
52379fa76d Convert script shebangs from "#!/bin/bash" to "#!/usr/bin/env bash"
This is especially important for distributions like NixOS where `/bin/bash` doesn't exist, or for MacOS users who've installed a newer version of Bash than the one that comes with their OS.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2017-02-13 11:01:54 -08:00
Dmitry Shyshkin
3cc0d6bb04 Fix #303111: dockerd leaks ExecIds on failed exec -i
Signed-off-by: Dmitry Shyshkin <dmitry@shyshkin.org.ua>
2017-02-10 21:13:00 +02:00
Daniel Nephin
cbf2f4d281 Use 2 seconds instead of 2000 milliseconds
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-02-10 11:30:07 -05:00
allencloud
69afd30444 split docker_api_swarm_test.go into multiple files
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-02-11 00:18:01 +08:00
John Howard
8eb0af1a0c Windows: Temporarily disable TestBuildLastModified
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-02-09 18:13:20 -08:00
Zhang Wei
eb3a7c2329 Send "Name" and "ID" when stating stopped containers
When `docker stats` stopped containers, client will get empty stats data,
this commit will gurantee client always get "Name" and "ID" field, so
that it can format with `ID` and `Name` fields successfully.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2017-02-09 09:46:59 +08:00
Aaron Lehmann
846b787819 Merge pull request #30453 from yongtang/30242-duplicate-network-name-inspect
Return error in case `docker network inspect` is ambiguous
2017-02-08 09:18:31 -08:00
Yong Tang
abf31ee083 Return error in case docker network inspect is ambiguous
This fix is partially based on comment
https://github.com/docker/docker/issues/30242#issuecomment-273517205

Currently, `docker network inspect` relies on `FindNetwork()` which
does not take into consideration that multiple networks with the same
name might exist.

This fix propose to return `docker network inspect` in a similiar
fashion like other commands:
1. Lookup full ID
2. Lookup full name
3. Lookup partial ID
If multiple networks exist, an error will be returned.

NOTE: this fix is not a complete fix for the issue raised in
https://github.com/docker/docker/issues/30242#issuecomment-273517205
where SwarmKit is unable to update when multiple networks with the same
name exit.
To fix that issue requires multiple places when `FindNetwork()` is called.
Because of the impact of changing `FindNetwork()`, this fix focus on
the issue in `docker network inspect`.

A separate PR will be created to address
https://github.com/docker/docker/issues/30242#issuecomment-273517205

An integration test has been added.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-02-07 18:05:29 -08:00
Akihiro Suda
31f172bdb5 Merge pull request #30790 from vdemeester/pr-30602
Carry #30602 : Bump go-units
2017-02-08 11:04:22 +09:00
Vincent Demeester
254fc83cba Merge pull request #30457 from dmcgowan/distribution-reference-update-2
reference: use distribution reference and remove fork
2017-02-07 22:01:25 +01:00
Vincent Demeester
cb89d658dc
Bump go-units
To include  https://github.com/docker/go-units/pull/23
Fixes a unit test that fails because of it.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-02-07 21:58:56 +01:00
Daniel Nephin
1b4e2b7c87 Merge pull request #29552 from dnephin/fix-build-with-log-driver
Ignore the daemon log config when building images
2017-02-07 15:47:41 -05:00
Derek McGowan
3a1279393f
Use distribution reference
Remove forked reference package. Use normalized named values
everywhere and familiar functions to convert back to familiar
strings for UX and storage compatibility.

Enforce that the source repository in the distribution metadata
is always a normalized string, ignore invalid values which are not.
Update distribution tests to use normalized values.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2017-02-07 11:08:37 -08:00
Yong Tang
9526e5c6ae Fix duplicate mount point for --volumes-from in docker run
This fix tries to fix the issue raised in 21845. The issue with 21845
is that if multiple `--volumes-from` with the same destination has been
specified, then one volume will be overridden by the other. This will mess
up with volumes reference and prevent the overridden volume from
being removed at the end.

Issue 21845 was observed with `docker-compose` though it is possible to
emulate the same behavior with `docker` alone:
```
$ cat Dockerfile
FROM busybox
VOLUME ["/tmp/data"]
$ docker build -t vimage .
$ docker run --name=data1 vimage true
$ docker run --name=data2 vimage true
$ docker run --name=app --volumes-from=data1 --volumes-from=data2 -d busybox top
$ docker rm -f -v $(docker ps -aq)
$ docker volume ls
$ docker volume rm ...
```
NOTE: Second case:
```
$ cat Dockerfile
FROM busybox
VOLUME ["/tmp/data"]
$ docker build -t vimage .
$ docker run --name=data1 vimage true
$ docker run --name=data2 vimage true
$ docker run --name=app --volumes-from=data1 --volumes-from=data2 -v /tmp/data:/tmp/data -d busybox top
$ docker rm -f -v $(docker ps -aq)
$ docker volume ls
$ docker volume rm ...
```
NOTE: Third case: Combination of --volumes-from and `HostConfig.Mounts` (API only)

This fix tries to address the issue by return an error if duplicate
mount points was used with `--volumes-from`.

An integration test has been added.

This fix fixes 21845.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-02-07 08:30:56 -08:00
Vincent Demeester
09114fe9f0 Merge pull request #30197 from yongtang/30178-service-health-check-none
Fix issue where service healthcheck is `{}` in remote API
2017-02-07 17:17:26 +01:00
Brian Goff
1d3f6e4aaf Merge pull request #30690 from aboch/vnd
Vendoring libnetwork @802895f
2017-02-06 13:20:51 -05:00
Sebastiaan van Stijn
fac13e4e07 Merge pull request #28751 from ijc25/wrap-help-output
Wrap CLI --help output to terminal width
2017-02-03 23:04:11 -08:00
Anusha Ragunathan
fa49c076d4 Merge pull request #29414 from cpuguy83/plugin_upgrade
Add docker plugin upgrade
2017-02-03 15:27:48 -08:00
Brian Goff
e8307b868d Make propagated mount persist outside rootfs
This persists the "propagated mount" for plugins outside the main
rootfs. This enables `docker plugin upgrade` to not remove potentially
important data during upgrade rather than forcing plugin authors to hard
code a host path to persist data to.

Also migrates old plugins that have a propagated mount which is in the
rootfs on daemon startup.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-02-03 16:22:58 -05:00
Brian Goff
03c6949739 Add docker plugin upgrade
This allows a plugin to be upgraded without requiring to
uninstall/reinstall a plugin.
Since plugin resources (e.g. volumes) are tied to a plugin ID, this is
important to ensure resources aren't lost.

The plugin must be disabled while upgrading (errors out if enabled).
This does not add any convenience flags for automatically
disabling/re-enabling the plugin during before/after upgrade.

Since an upgrade may change requested permissions, the user is required
to accept permissions just like `docker plugin install`.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-02-03 16:21:12 -05:00
Ian Campbell
a4f71ccff6 Wrap output of docker cli --help
This should go some way to unblocking a solution to #18797, #18385 etc by
removing the current rather restrictive constraints on help text length.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-02-03 11:05:49 +00:00
Victor Vieux
c3b660b112 Merge pull request #30654 from Microsoft/jjh/unifyworkdir
Windows: Unify workdir handling
2017-02-03 00:37:54 -08:00
Alessandro Boch
1e98350ab4 Revert "Fix IT case for network name validation"
This reverts commit 9cebccfb95.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-02-02 15:38:12 -08:00
John Howard
f42033ba94 Windows: Unify workdir handling
Signed-off-by: John Howard <jhoward@microsoft.com>

Working directory processing was handled differently for Hyper-V and Windows-Server containers, as annotated in the builder documentation (updated in this PR). For Hyper-V containers, the working directory set by WORKDIR was not created. This PR makes Hyper-V containers work the same as Windows Server containers (and the same as Linux).

Example (only applies to Hyper-V containers, so not reproducible under CI environment)
Dockerfile:
FROM microsoft/nanoserver
WORKDIR c:\installer
ENV GOROOT=c:\installer
ADD go.exe .
RUN go --help
Running on Windows Server 2016, using docker master without this change, but with daemon set to --exec-opt isolation=hyperv as it would be for Client operating systems.
PS E:\go\src\github.com\docker\docker> dockerd -g c:\control --exec-opt isolation=hyperv
time="2017-02-01T15:48:09.657286100-08:00" level=info msg="Windows default isolation mode: hyperv"
time="2017-02-01T15:48:09.662720900-08:00" level=info msg="[graphdriver] using prior storage driver: windowsfilter"
time="2017-02-01T15:48:10.011588000-08:00" level=info msg="Graph migration to content-addressability took 0.00 seconds"
time="2017-02-01T15:48:10.016655800-08:00" level=info msg="Loading containers: start."
time="2017-02-01T15:48:10.460820000-08:00" level=info msg="Loading containers: done."
time="2017-02-01T15:48:10.509859600-08:00" level=info msg="Daemon has completed initialization"
time="2017-02-01T15:48:10.509859600-08:00" level=info msg="Docker daemon" commit=3c64061 graphdriver=windowsfilter version=1.14.0-dev
First with no explicit isolation:
PS E:\docker\build\unifyworkdir> docker build --no-cache .
Sending build context to Docker daemon  10.1 MB
Step 1/5 : FROM microsoft/nanoserver
 ---> 89b8556cb9ca
Step 2/5 : WORKDIR c:\installer
 ---> 7e0f41d08204
Removing intermediate container 236c7802042a
Step 3/5 : ENV GOROOT c:\installer
 ---> Running in 8ea5237183c1
 ---> 394b70435261
Removing intermediate container 8ea5237183c1
Step 4/5 : ADD go.exe .
 ---> e47401a1745c
Removing intermediate container 88dcc28e74b1
Step 5/5 : RUN go --help
 ---> Running in efe90e1b6b8b
container efe90e1b6b8b76586abc5c1dc0e2797b75adc26517c48733d90651e767c8463b encountered an error during CreateProcess: failure in a Windows system call: The directory name is invalid. (0x10b) extra info: {"ApplicationName":"","CommandLine":"cmd /S /C go --help","User":"","WorkingDirectory":"C:\\installer","Environment":{"GOROOT":"c:\\installer"},"EmulateConsole":false,"CreateStdInPipe":true,"CreateStdOutPipe":true,"CreateStdErrPipe":true,"ConsoleSize":[0,0]}
PS E:\docker\build\unifyworkdir>
Then forcing process isolation:
PS E:\docker\build\unifyworkdir> docker build --isolation=process --no-cache .
Sending build context to Docker daemon  10.1 MB
Step 1/5 : FROM microsoft/nanoserver
 ---> 89b8556cb9ca
Step 2/5 : WORKDIR c:\installer
 ---> 350c955980c8
Removing intermediate container 8339c1e9250c
Step 3/5 : ENV GOROOT c:\installer
 ---> Running in bde511c5e3e0
 ---> b8820063b5b6
Removing intermediate container bde511c5e3e0
Step 4/5 : ADD go.exe .
 ---> e4ac32f8902b
Removing intermediate container d586e8492eda
Step 5/5 : RUN go --help
 ---> Running in 9e1aa235af5f
Cannot mkdir: C:\installer is not a directory
PS E:\docker\build\unifyworkdir>
Now compare the same results after this PR. Again, first with no explicit isolation (defaulting to Hyper-V containers as that's what the daemon it set to) - note it now succeeds 😄
PS E:\docker\build\unifyworkdir> docker build --no-cache .
Sending build context to Docker daemon  10.1 MB
Step 1/5 : FROM microsoft/nanoserver
 ---> 89b8556cb9ca
Step 2/5 : WORKDIR c:\installer
 ---> 4f319f301c69
Removing intermediate container 61b9c0b1ff6f
Step 3/5 : ENV GOROOT c:\installer
 ---> Running in c464a1d612d8
 ---> 96a26ab9a7b5
Removing intermediate container c464a1d612d8
Step 4/5 : ADD go.exe .
 ---> 0290d61faf57
Removing intermediate container dc5a085fffe3
Step 5/5 : RUN go --help
 ---> Running in 60bd56042ff8
Go is a tool for managing Go source code.

Usage:

        go command [arguments]

The commands are:

        build       compile packages and dependencies
        clean       remove object files
        doc         show documentation for package or symbol
        env         print Go environment information
        fix         run go tool fix on packages
        fmt         run gofmt on package sources
        generate    generate Go files by processing source
        get         download and install packages and dependencies
        install     compile and install packages and dependencies
        list        list packages
        run         compile and run Go program
        test        test packages
        tool        run specified go tool
        version     print Go version
        vet         run go tool vet on packages

Use "go help [command]" for more information about a command.

Additional help topics:

        c           calling between Go and C
        buildmode   description of build modes
        filetype    file types
        gopath      GOPATH environment variable
        environment environment variables
        importpath  import path syntax
        packages    description of package lists
        testflag    description of testing flags
        testfunc    description of testing functions

Use "go help [topic]" for more information about that topic.

The command 'cmd /S /C go --help' returned a non-zero code: 2
And the same with forcing process isolation. Also works 😄
PS E:\docker\build\unifyworkdir> docker build --isolation=process --no-cache .
Sending build context to Docker daemon  10.1 MB
Step 1/5 : FROM microsoft/nanoserver
 ---> 89b8556cb9ca
Step 2/5 : WORKDIR c:\installer
 ---> f423b9cc3e78
Removing intermediate container 41330c88893d
Step 3/5 : ENV GOROOT c:\installer
 ---> Running in 0b99a2d7bf19
 ---> e051144bf8ec
Removing intermediate container 0b99a2d7bf19
Step 4/5 : ADD go.exe .
 ---> 7072e32b7c37
Removing intermediate container a7a97aa37fd1
Step 5/5 : RUN go --help
 ---> Running in 7097438a54e5
Go is a tool for managing Go source code.

Usage:

        go command [arguments]

The commands are:

        build       compile packages and dependencies
        clean       remove object files
        doc         show documentation for package or symbol
        env         print Go environment information
        fix         run go tool fix on packages
        fmt         run gofmt on package sources
        generate    generate Go files by processing source
        get         download and install packages and dependencies
        install     compile and install packages and dependencies
        list        list packages
        run         compile and run Go program
        test        test packages
        tool        run specified go tool
        version     print Go version
        vet         run go tool vet on packages

Use "go help [command]" for more information about a command.

Additional help topics:

        c           calling between Go and C
        buildmode   description of build modes
        filetype    file types
        gopath      GOPATH environment variable
        environment environment variables
        importpath  import path syntax
        packages    description of package lists
        testflag    description of testing flags
        testfunc    description of testing functions

Use "go help [topic]" for more information about that topic.

The command 'cmd /S /C go --help' returned a non-zero code: 2
PS E:\docker\build\unifyworkdir>
2017-02-02 11:25:07 -08:00
Darren Stahl
d55304065b Block Windows images on Linux
Signed-off-by: Darren Stahl <darst@microsoft.com>
2017-02-02 11:07:30 -08:00
John Howard
ffbe4b6ff1 Windows: Test for run as local system
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-02-01 18:37:44 -08:00
Brian Goff
bb0a532fc2 Merge pull request #30203 from allencloud/validate-healthcheck-params-in-daemon-side
validate healthcheck params in daemon side
2017-02-01 21:19:30 -05:00
Daniel Nephin
dd1d35c269 Add missing build tag for stack tests.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-02-01 13:25:37 -05:00
Vincent Demeester
354bd4aadd Merge pull request #29692 from yongtang/29492-daemon-shm-size
Add daemon option `--default-shm-size`
2017-02-01 16:56:10 +01:00
Vincent Demeester
4c1b40b9d4 Merge pull request #28627 from yongtang/28624-docker-plugin-ls
Add `--filter enabled=true` for `docker plugin ls`
2017-02-01 16:52:00 +01:00
Vincent Demeester
1b6a15eedc Merge pull request #27557 from yongtang/27178-ps-filter-publish-expose
Add `publish` and `expose` filter for `docker ps --filter`
2017-02-01 16:32:28 +01:00
Vincent Demeester
27f90acd61 Merge pull request #22563 from mlaventure/cgroup-devices
Allow adding rules to cgroup devices.allow on container create/run
2017-02-01 16:29:34 +01:00
Vincent Demeester
e66717e9f8 Merge pull request #30537 from DiSiqueira/asserting_error
Underscoring an unused var in tests
2017-02-01 16:08:20 +01:00
DiSiqueira
4bd1895241 I found out this err var isn't being used, so underscoring it to preserve resources
Signed-off-by: DiSiqueira <dieg0@live.com>
2017-01-31 19:48:15 -02:00
Alexander Morozov
1d2f5de49a Merge pull request #30162 from yongtang/29972-service-read-only
Add `--read-only` for `service create` and `service update`
2017-01-31 13:20:00 -08:00
Alexander Morozov
cdc79c54ec Merge pull request #28968 from darrenstahlmsft/TestEventsLimit
Limit TestEventsLimit to 4 concurrent containers on Windows
2017-01-30 15:09:54 -08:00
Yong Tang
499a0dd43e Add --read-only for service create and service update
This fix tries to address the issue raised in 29972 where
it was not possible to specify `--read-only` for `docker service create`
and `docker service update`, in order to have the container's root file
system to be read only.

This fix adds `--read-only` and update the `ReadonlyRootfs` in `HostConfig`
through `service create` and `service update`.

Related docs has been updated.

Integration test has been added.

This fix fixes 29972.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-01-30 12:47:26 -08:00
Darren Stahl
2ec808ec08 Limit TestEventsLimit to 4 concurrent containers on Windows
Signed-off-by: Darren Stahl <darst@microsoft.com>
2017-01-30 11:04:52 -08:00
Alexander Morozov
61198b5ea3 Merge pull request #30548 from yongtang/vendor-swarmkit
Update SwarmKit to 78ae345f449ac69aa741c762df7e5f0020f70275
2017-01-30 09:41:08 -08:00
Daniel Nephin
80b642ff88 Ignore the daemon log config when building images.
Logs created by build containers should be handled by the daemon, not by logging drivers.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-01-30 10:59:19 -05:00
Vincent Demeester
ecbb0e62f6 Remove most of the runCommandWithOutput from integration tests
There is 5 calls left, that use StdinPipe that is not yet supported by
icmd.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-30 10:54:06 +01:00
Yong Tang
2cc2d059de Update TestSwarmNetworkPlugin test
This commit updates TestSwarmNetworkPlugin, similiar to
changes in https://github.com/docker/docker/pull/30332

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-01-29 10:57:58 -08:00
allencloud
e399c558e6 validate healthcheck params in daemon side
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-01-29 13:35:32 +08:00
Yong Tang
8feb5c5a48 Fix issue where service healthcheck is {} in remote API
This fix tries to address the issue raised in 30178 where
service healthcheck is `{}` in remote API will result in
dns resolve failue.

The reason was that when service healthcheck is `{}`,
service binding was not done.

This fix fixes the issue.

An integration test has been added.

This fix fixes 30178.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-01-27 15:43:44 -08:00
Yong Tang
743943f636 Add publish and expose filter for docker ps --filter
This fix tries to address the enhancement proposal raised in
27178 for filtering based on published or exposed ports of
`docker ps --filter`.

In this fix, two filter options, `publish` and `expose` have
been added to take either `<port>[/<protocol>]` or `<from>-<to>[/<protocol>]`
and filtering on containers.

An integration test has been added to cover the changes.

This fix fixes 27178.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-01-27 13:25:32 -08:00
Yong Tang
d1982862ca Update opts.MemBytes to disable default, and move docker run/create/build to use opts.MemBytes
This fix made several updates:
1. Update opts.MemBytes so that default value will not show up.
   The reason is that in case a default value is decided by daemon,
   instead of client, we actually want to not show default value.
2. Move `docker run/create/build` to use opts.MemBytes for `--shm-size`
   This is to bring consistency between daemon and docker run
3. docs updates.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-01-27 12:17:06 -08:00
Yong Tang
db575ef626 Add daemon option --default-shm-size
This fix fixes issue raised in 29492 where it was not
possible to specify a default `--default-shm-size` in daemon
configuration for each `docker run``.

The flag `--default-shm-size` which is reloadable, has been
added to the daemon configuation.
Related docs has been updated.

This fix fixes 29492.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-01-27 12:17:06 -08:00
Yong Tang
fa358a8757 Move secret name or ID prefix resolving from client to daemon
This fix is a follow up for comment:
https://github.com/docker/docker/pull/28896#issuecomment-265392703

Currently secret name or ID prefix resolving is done at the client
side, which means different behavior of API and CMD.

This fix moves the resolving from client to daemon, with exactly the
same rule:
- Full ID
- Full Name
- Partial ID (prefix)

All existing tests should pass.

This fix is related to #288896, #28884 and may be related to #29125.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-01-27 10:40:05 -08:00
Yong Tang
99d91ada97 Add capability filter to docker plugin ls
This fix adds `--filter capability=[volumedriver|authz]` to `docker plugin ls`.

The related docs has been updated.

An integration test has been added.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-01-27 07:32:22 -08:00
Tibor Vass
43544cf2b4 Merge pull request #30157 from aboch/att
Remove attachable network on swarm leave
2017-01-26 17:03:23 -08:00
Victor Vieux
5706d8206b Merge pull request #30144 from dnephin/add-secrets-to-stack-deploy
Add secrets to stack deploy
2017-01-26 14:54:04 -08:00
Yong Tang
a66e0dc349 Add --filter enabled=true for docker plugin ls
This fix adds `--filter enabled=true` to `docker plugin ls`,
as was specified in 28624.

The related API and docs has been updated.

An integration test has been added.

This fix fixes 28624.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-01-26 13:16:11 -08:00
Alessandro Boch
3cedca5d53 Remove attachable network on swarm leave
- When the node leaves the cluster, if any user run
  container(s) is connected to the swarm network,
  then daemon needs to detach the container(s) and
  remove the network.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-01-26 11:16:07 -08:00
Alexander Morozov
a69c4129e0 Merge pull request #28409 from dnephin/swagger-gen-more
Generate more types from the swagger spec
2017-01-26 10:35:34 -08:00
Daniel Nephin
f0a5531c46 Remove secrets as part of stack remove.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-01-26 11:33:15 -05:00
Daniel Nephin
b3427e43ed Test and fix external secrets in stack deploy.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-01-26 11:33:15 -05:00
Daniel Nephin
6ec84ef76d Add integration test for stack deploy with secrets.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-01-26 11:33:15 -05:00
Kenfe-Mickael Laventure
1756af6faf Allow adding rules to cgroup devices.allow on container create/run
This introduce a new `--device-cgroup-rule` flag that allow a user to
add one or more entry to the container cgroup device `devices.allow`

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-01-26 07:20:45 -08:00
Yong Tang
05a831a775 Fix incorrect Scope in network ls/inspect with duplicate network names
This fix tries to address the issue raised in 30242 where the `Scope`
field always changed to `swarm` in the ouput of `docker network ls/inspect`
when duplicate networks name exist.

The reason for the issue was that `buildNetworkResource()` use network name
(which may not be unique) to check for the scope.

This fix fixes the issue by always use network ID in `buildNetworkResource()`.

A test has been added. The test fails before the fix and passes after the fix.

This fix fixes 30242.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-01-25 09:39:55 -08:00
Aaron Lehmann
e9c0de0de6 Merge pull request #30043 from dmcgowan/distribution-reference-update-1
Distribution reference update
2017-01-24 20:38:20 -08:00
Sebastiaan van Stijn
d4cd4b2164 Merge pull request #30182 from AkihiroSuda/validate-tmpfs
validate mount path for tmpfs
2017-01-25 03:08:17 +01:00
Victor Vieux
42d25de1b7 Merge pull request #30291 from yongtang/30279-ps-format
Fix failure in `docker ps --format` when `.Label` has args
2017-01-24 17:55:52 -08:00
Sebastiaan van Stijn
9b2dabbf18 Merge pull request #30227 from thaJeztah/fix-ineffectual-assignments
fix some ineffectual assignments (and minor fixes)
2017-01-25 02:49:57 +01:00
Sebastiaan van Stijn
089e1c1c5b Minor GoDoc fixup in integration-cli
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-01-24 18:03:30 +01:00
Sebastiaan van Stijn
ba0afd70e8 fix some ineffectual assignments
to make goreportcard a bit happier
https://goreportcard.com/report/github.com/docker/docker

also found that `TestCpToErrDstParentNotExists()` was
partially broken, because a `runDockerCp()` was inadvertently
removed in f26a31e80c

`TestDaemonRestartSaveContainerExitCode()` didn't verify
the actual _Error_ message, so added that to the test,
and updated the test to take into account that the
"experimental" CI enables `--init` on containers.

`TestVolumeCLICreateOptionConflict()` only checked
for an error to occur, but didn't validate if the
error was due to conflicting options.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-01-24 11:16:19 +01:00
Yanqiang Miao
cc9ed0a31b Improve the error print of image inspect
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2017-01-24 11:07:20 +08:00
Yong Tang
2cd4ba1e56 Fix failure in docker ps --format when .Label has args
This fix tries to fix the issue in 30279 where  `docker ps --format`
fails if `.Label` has args. For example:
```
docker ps --format '{{.ID}}\t{{.Names}}\t{{.Label "some.label"}}'
```

The reason for the failure is that during the preprocessing phase
to detect the existance of `.Size`, the `listOptionsProcessor`
does not has a method of `Label(name string) string`.

This results in the failure of
```
template: :1:24: executing "" at <.Label>: Label is not a method but has arguments
```

This fix fixes the issue by adding needed method of `Label(name string) string`.

This fix fixes 30279.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-01-23 09:31:48 -08:00
Yong Tang
1c0d37fa7f Add --format flag for docker plugin ls
This fix tries to address the enhancement discussed in 28735 to add
`--format` for the output of `docker plugin ls`.

This fix
1. Add `--format` and `--quiet` flags to `docker plugin ls`
2. Convert the current implementation to use `formatter`, consistent with
   other docker list commands.
3. Add `pluginsFormat` for config.json.

Related docs has been updated.

Several unit tests have been added to cover the changes.

This fix is related to 28708 and 28735.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-01-20 15:59:44 -08:00
Vincent Demeester
e47c46c713
Run TestBuildCopyWilcardInName only on linux daemon and unix client
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-20 16:10:28 +01:00
Akihiro Suda
4a8799dc0a validate mount path for tmpfs
There was no validation for `docker run --tmpfs foo`.

In this PR, only two obvious rules are implemented:
 - path must be absolute
 - path must not be "/"
We should add more rules carefully.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-01-20 06:01:48 +00:00
Derek McGowan
0421f5173d
Remove use of forked reference package for cli
Use resolving to repo info as the split point between the
legitimate reference package and forked reference package.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2017-01-19 16:04:50 -08:00
Sebastiaan van Stijn
de0328560b Merge pull request #30165 from xulike666/fix-typo-6/36
[combined] fix typo
2017-01-19 17:21:22 +01:00
Aaron.L.Xu
40af569164 fix typo
fix typo I found AMAP in integration-cli/*

fix typo mentioned by Allencloud

Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>
2017-01-19 15:52:28 +08:00
Sebastiaan van Stijn
e1c5e72902 Merge pull request #30185 from vdemeester/integration-build-cmd-cleanup-take2
[test-integration] Clean more build utils
2017-01-18 15:12:03 +01:00
Tõnis Tiigi
56b951fbe5 Merge pull request #30219 from tonistiigi/test-port-leak
Switch TestSwarmPublishDuplicatePorts to different ports
2017-01-17 17:16:14 -08:00
Tonis Tiigi
24cd5444f9 Switch TestSwarmPublishDuplicatePorts to different ports
There is an issue with the ports leaking to other tests.
This is a workaround until the actual problem is addressed.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-01-17 10:54:22 -08:00
Justin Cormack
7e3a596a63 Block obsolete socket families in the default seccomp profile
Linux supports many obsolete address families, which are usually available in
common distro kernels, but they are less likely to be properly audited and
may have security issues

This blocks all socket families in the socket (and socketcall where applicable) syscall
except
- AF_UNIX - Unix domain sockets
- AF_INET - IPv4
- AF_INET6 - IPv6
- AF_NETLINK - Netlink sockets for communicating with the ekrnel
- AF_PACKET - raw sockets, which are only allowed with CAP_NET_RAW

All other socket families are blocked, including Appletalk (native, not
over IP), IPX (remember that!), VSOCK and HVSOCK, which should not generally
be used in containers, etc.

Note that users can of course provide a profile per container or in the daemon
config if they have unusual use cases that require these.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-01-17 17:50:44 +00:00
Vincent Demeester
c10f6ef43f
Clean more build utils in integration cli
- Remove deprecated buildImage* functions
- Rename buildImageNew to buildImage
- Use *check.C in fakeContext* setup and in getIdByName

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-17 15:42:38 +01:00
Vincent Demeester
4fdfcb36cd Merge pull request #30138 from vdemeester/integration-use-testenv
[test-integration] Use testEnv methods and remove most of the global variables
2017-01-17 14:31:49 +01:00
Vincent Demeester
c8016e669f
Use testEnv methods and remove most of the global variables
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-17 12:39:08 +01:00
Sebastiaan van Stijn
950792dc6d add integration test for FQDN hostname
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-01-17 11:01:59 +01:00
Akihiro Suda
dcf1264f1c Merge pull request #30058 from vdemeester/integration-build-cmd-clean
[test-integration] clean docker_cli_build_test.go
2017-01-16 18:16:49 +09:00
Vincent Demeester
ead8ce2431 Merge pull request #30151 from tonistiigi/fix-defunct
Avoid defunct registry/notary processes during tests
2017-01-16 08:55:16 +01:00
Vincent Demeester
c778f4b964
Refactor docker_cli_build_test.go
Use `testutil/cmd` for `buildCommand`.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-15 16:48:08 +01:00
Brian Goff
24c4226dc7 Merge pull request #29831 from vdemeester/integration-small-cleanups
[test-integration] Small cleanups on integration cli
2017-01-14 16:43:39 -05:00
Brian Goff
7d24cc7710 Merge pull request #29856 from Microsoft/jjh/warntoout
Windows to Linux build warning to stdout
2017-01-14 16:37:31 -05:00
Tonis Tiigi
09dbce5f5a Avoid defunct registry/notary processes during tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-01-13 17:45:14 -08:00
Sebastiaan van Stijn
0b09d6bfa7 Merge pull request #30061 from yongtang/30027-docker-images-v1.12
Fix `Size` in `docker images` for v1.12 client to v1.13 daemon
2017-01-13 02:11:48 +01:00
Brian Goff
597843e790 Merge pull request #30039 from ripcurld0/specify_line_no_dockerfile_err
Specify in which line the Dockerfile parser failed
2017-01-12 19:48:45 -05:00
Yong Tang
d9451f1c8c Add test for image size for v1.12 and v1.13 clients against v1.13 daemon
This test checks to make sure both v1.12 and v1.13 client against v1.13 daemon get correct `Size` after the fix.

This test is related to 30027.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-01-12 08:12:39 -08:00
Vincent Demeester
9af5d7c340
Small cleanups on integration cli
- Join a few tests in one when it makes sense (reduce the number of
  container run and thus the overall time of the suites)
- Remove some duplication on several tests
- Remove some unused methods

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-12 16:57:59 +01:00
Boaz Shuster
8f282cdea5 Specify in which line the Dockerfile parser failed
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2017-01-12 17:45:45 +02:00
Brian Goff
bf71db7a12 Merge pull request #30010 from thaJeztah/master-revert-27146
Revert "Require continuation char to be last char in a line"
2017-01-12 09:17:08 -05:00
Sebastiaan van Stijn
af5323f958 Merge pull request #30077 from tonistiigi/fix-test-leaks
Fix leaked connections in integration tests
2017-01-12 11:35:02 +01:00
Tibor Vass
640a5c1a38 Merge pull request #30079 from tonistiigi/debug-trusttest
Print daemon stacktrace when trust test times out
2017-01-11 17:06:33 -08:00
Tonis Tiigi
e533685d13 Print daemon stacktrace when trust test times out
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-01-11 15:14:36 -08:00
Tonis Tiigi
1e98fb5ad9 Fix leaked connections in integration tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-01-11 14:48:48 -08:00
Sebastiaan van Stijn
de54284bd7 Merge pull request #29891 from sanimej/libnvendor
vendorin libnetwork @f9fa6e0
2017-01-11 19:55:00 +01:00
Santhosh Manohar
d5e8d8e1cf Handle IPv6 enabling correctly in the tests
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2017-01-10 16:34:23 -08:00
Yong Tang
0f30c64444 Allow swarm init with --availability=drain
This fix adds a new flag `--availability` to `swarm join`.

Related documentation has been updated.

An integration test has been added.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-01-10 16:31:51 -08:00
Yong Tang
a8e7e37aa8 Allow swarm join with --availability=drain
This fix tries to address the issue raised in 24596 where it was not
possible to join as manager only (`--availability=drain`).

This fix adds a new flag `--availability` to `swarm join`.

Related documentation has been updated.

An integration test has been added.

NOTE: Additional pull request for swarmkit and engine-api will
be created separately.

This fix fixes 24596.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-01-10 16:31:51 -08:00
Vincent Demeester
82dfa6563f Merge pull request #29787 from yongtang/29730-multiple-published-port
Fix issues of multiple published ports mapping to the same target port
2017-01-10 18:49:16 +01:00
Sebastiaan van Stijn
e5058ff15c Merge pull request #29947 from vdemeester/integration-some-runCommandWithOutput-clean
[test-integration] clean some runCommandWithOutput
2017-01-10 15:56:42 +01:00
Yong Tang
cb59bd0c51 Fix issues of multiple published ports mapping to the same target port
This fix tries to address the issue raised in docker/docker-29730
where a service with multiple published ports mapping to the same target
port (e.g., `--publish 5000:80 --publish 5001:80`) can't be allocated.

The reason for the issue is that, `getPortConfigKey` is used for both
allocated ports and configured (may or may not be allocated) ports.
However, `getPortConfigKey` will not take into consideration the
`PublishedPort` field, which actually could be different for different
allocated ports.

This fix saves a map of `portKey:portNum:portState`,  instead of currently
used `portKey:portState` so that multiple published ports could be processed.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-01-10 00:46:18 -08:00
Sebastiaan van Stijn
c67550414b
Revert "Require continuation char to be last char in a line"
This reverts commit 105bc63295,
which (although correct), resulted in a backward incompatible
change.

We can re-implement this in future, after this changes goes
through a deprecation cycle

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-01-10 00:41:03 +01:00
Sebastiaan van Stijn
38f766ae0e Merge pull request #29143 from vdemeester/node-cli-unit-tests
Add some unit tests to the node and swarm cli code
2017-01-09 20:52:23 +01:00
Tibor Vass
3e298f46a2 Merge pull request #29955 from vieux/improve_secret_Create
remove -f on secret create and unify usage with other commands
2017-01-09 10:22:39 -08:00
Vincent Demeester
f151c297eb
Add some unit tests to the node and swarm cli code
Start work on adding unit tests to our cli code in order to have to
write less costly integration test.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-09 18:30:15 +01:00
Sebastiaan van Stijn
f1fdbeca2a Merge pull request #29226 from yongtang/28535-prune-until-follow-up
Add `--filter until=<timestamp>` for `docker container/image prune`
2017-01-09 17:58:01 +01:00
Sebastiaan van Stijn
d4791c7b64 Merge pull request #29795 from vdemeester/integration-request-package
[test-integration] Add a new request package in integration-cli
2017-01-09 14:51:40 +01:00
Vincent Demeester
e8e4546bc3 Merge pull request #29874 from allencloud/fix-29872-volume-ls-filter
fix volume ls filter driver
2017-01-09 13:06:17 +01:00
Vincent Demeester
f96180a0a8 Merge pull request #29931 from tonistiigi/test-swarm-errors
Add test for swarm error handling
2017-01-09 11:26:09 +01:00
Vincent Demeester
303b1d200a
Update trustedCmd to be compatible with testutil/cmd
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-09 11:07:05 +01:00
Stephen J Day
7a85579917
*: use opencontainers/go-digest package
The `digest` data type, used throughout docker for image verification
and identity, has been broken out into `opencontainers/go-digest`. This
PR updates the dependencies and moves uses over to the new type.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-01-06 18:48:41 -08:00
Victor Vieux
db6652ca71 remove -f on secret create and unify usage with other commands
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-06 14:07:48 -08:00
Tonis Tiigi
e160860054 Fix workdir cache invalidation
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-01-06 12:10:59 -08:00
Sebastiaan van Stijn
b7c2531779 Merge pull request #29899 from Microsoft/jjh/testbuildworkdirimagecmd
Windows: Enable TestBuildWorkdirImageCmd
2017-01-06 17:15:22 +01:00
Akihiro Suda
bf8cdb9172 Merge pull request #29929 from aaronlehmann/secret-test-fix
Fix TestSecretCreateWithLabels nondeterminism
2017-01-06 13:47:08 +09:00
Tonis Tiigi
d377b074fd Add test for swarm error handling
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-01-05 15:46:07 -08:00
Aaron Lehmann
45833ce54d Fix TestSecretCreateWithLabels nondeterminism
This test checks for the substring "foo" in the "secret ls" output. This
is a valid base36 substring and can sometimes show up by chance:

    docker_cli_secret_create_test.go:86:
        c.Assert(out, checker.Not(checker.Contains), name)
    ... obtained string = "" +
    ...     "ID                          NAME                        CREATED UPDATED\n" +
    ...     "ob8y4t4feuz8pn5h6vla9oxoz   stefoo7e268ozqfupi9s4se9q   Less than a second ago   Less than a second ago\n"
    ... substring string = "foo"

Change the secret name to test_secret, matching other tests. Underscores
can't appear in base36 so this name is safe to grep for.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-01-05 15:22:51 -08:00
Tonis Tiigi
f4798b98fc Set plugins used in tests back to original names
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-01-05 13:55:43 -08:00
Tibor Vass
40afb853d7 Merge pull request #29845 from vdemeester/fix-the-fix-facepalming-myself
[test-integration] Should check for output, not error in deleteContainer
2017-01-05 13:26:39 -08:00
Vincent Demeester
87e3fcfe1e
Clean some runCommandWithOutput accross integration-cli code
There is still ways to go

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-05 17:44:31 +01:00
John Howard
528a5fd2ba Windows: Enable TestBuildWorkdirImageCmd
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-01-04 15:33:40 -08:00
Yong Tang
58738cdee3 Add --filter until=<timestamp> for docker container/image prune
This fix is a follow up for comment
https://github.com/docker/docker/pull/28535#issuecomment-263215225

This fix provides `--filter until=<timestamp>` for `docker container/image prune`.

This fix adds `--filter until=<timestamp>` to `docker container/image prune`
so that it is possible to specify a timestamp and prune those containers/images
that are earlier than the timestamp.

Related docs has been updated

Several integration tests have been added to cover changes.

This fix fixes #28497.

This fix is related to #28535.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-01-04 14:16:42 -08:00
Tonis Tiigi
89f034093a Add test TestRestartPolicyWithLiveRestore
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-01-04 14:12:49 -08:00
Brian Goff
4bd4d18e11 Use vol plugin creator instead of inserting spec
This makes the test a bit more robust to change and is a bit cleaner.
As implemented before this commit, we have two named plugins pointing to
the same http service. If the daemon makes any unexpected calls to the
plugin (e.g. during startup) we'll get more counts on the event counter
than expected since the daemon sees 2 plugins.

Found this while working on #29877 which broke this test originally (but
is no longer using V1 plugins, so is this is no longer broken there) and
took some time to debug what was going on.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-01-04 15:51:49 -05:00
allencloud
0fdab49610 fix volume ls filter driver
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-01-04 23:29:12 +08:00
Vincent Demeester
03c17ab66a Merge pull request #29861 from Microsoft/jjh/tidywinkv
Tidy kernel version in tests
2017-01-04 15:48:20 +01:00
Vincent Demeester
b029d3dee3
Should check for output, not error in deleteContainer
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-04 11:15:36 +01:00
allencloud
5b9348c553 support registry mirror config reload
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-01-04 11:04:00 +08:00
Tibor Vass
48ed4f0639 Merge pull request #29733 from cpuguy83/fix_v1plugin_deadlock
Fix race/deadlock in v1 plugin handlers
2017-01-03 17:02:15 -08:00
John Howard
d45c652e83 Windows to Linux build warning to stdout
Signed-off-by: John Howard <jhoward@microsoft.com>

When building a Dockerfile from a Windows client on a Linux daemon, a
"security warning" is printed
on stderr. Having this warning printed on stderr makes it difficult to
distinguish a failed build from one that's succeeding, and the only way to
suppress the warning is through the -q option, which also suppresses every
output. This change prints the warning on stdout, instead of stderr, to
resolve this situation.
2017-01-03 14:07:50 -08:00
John Howard
b06692b1a9 Tidy kernel version in tests
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-01-03 12:47:25 -08:00
Victor Vieux
2ef6d80454 Merge pull request #29556 from mavenugo/refcount
Fixing a couple of network plugin life-cycle mgmt issues
2017-01-03 11:13:22 -08:00
Daniel Nephin
b462c93edb Generate ImageHistory from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-01-03 11:47:44 -05:00
Vincent Demeester
18265591c2 Merge pull request #25234 from yongtang/25228-service-ps-multiple-ID
Support multiple service IDs on "docker service ps"
2017-01-03 12:40:24 +01:00
Vincent Demeester
d69d4799a3
Add a new request package in integration-cli
The goal is to remove function from `docker_utils.go` and setup
simple, one-responsability package that can be well tested ; and to
ease writing request.

This moves all the calls to `sockRequest` (and similar methods) to
their counterpart in the `request` package.

This introduce `request.Do` to write easier request (with functional
argument to easily augment the request) with some pre-defined function
for the most used http method (i.e. `request.Get`, `request.Post` and
`request.Delete`).

Few of the `sockRequest` call have been moved to `request.Do` (and
`Get`, etc.) to showcase the usage of the package. There is still a
whole lot to do.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-03 11:49:30 +01:00
Vincent Demeester
de709ebfd8 Merge pull request #29827 from vdemeester/integration-fixes-for-userns
Updates some integration tests to fix userns builds
2017-01-03 11:47:39 +01:00
Sebastiaan van Stijn
275d68ab39 Merge pull request #29828 from vdemeester/integration-deleteContainer-ignore-notfound
Do not fail in `TearDown` if container not found when removing
2017-01-03 11:35:07 +01:00
Vincent Demeester
2fd995bc99 Merge pull request #29773 from forever043/fix_TestDaemonStartWithoutColors
test: Fix "--raw-logs=true" option test in TestDaemonStartWithoutColors
2017-01-03 09:29:19 +01:00
Vincent Demeester
636d6ee57c
Do not fail in TearDown if container not found when removing
If the container is not found when removing, it means it's already not
there anymore, so it's safe to ignore. This should reduce a bit some
`TearDown` flakyness..

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-02 22:14:24 +01:00
Vincent Demeester
bc19388fb2
Updates some integration tests to fix userns builds
- `TestRunMountReadOnlyDevShm` and `TestRunHostnameInHostMode` needs
  `NotUserNamespace` requirement as these are known limitation of
  userns.
- `TestBuildWorkdirCmd` should use a preload image (`busybox`) instead
  of one that require network access.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-02 19:13:26 +01:00
Sebastiaan van Stijn
ed689c48b0 Merge pull request #29799 from vdemeester/integration-registry-package
[test-integration] Add a registry package with registry v1/v2 code
2017-01-02 15:37:09 +01:00
Vincent Demeester
4300e5e881
Add a registry package with registry v1/v2 code
This extract what was in registry_test.go and
registry_mock_test.go. This also move `RegistryHosting`
requirement to `registry.Hosting`

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-02 11:03:53 +01:00
Madhu Venugopal
0510afc883 Properly cleanup plugin states which might impact other tests
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-12-30 12:28:22 -08:00
Madhu Venugopal
fc2c0e623d Handle Plugin reference count during network create and delete
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-12-30 12:28:22 -08:00
Vincent Demeester
33968e6c7d
Remove pkg/integration and move it to testutil or integration-cli
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-30 18:26:34 +01:00
majiuyue 00385406
c9e0d923ae test: Fix "--raw-logs=true" option test in TestDaemonStartWithoutColors
Because "tty" is closed in s.d.Stop() for "--raw-logs=false" test,
we need to open another pair of pty before test "--raw-logs=true"
option.

This patch fix #29772.

Signed-off-by: Jiuyue Ma <majiuyue@huawei.com>
2016-12-30 17:26:01 +08:00
Sebastiaan van Stijn
36ed7d58bb Merge pull request #29721 from coolljt0725/follow_29365
Follow up #29365, fix fail to remove container after restart
2016-12-30 00:13:13 +01:00
Sebastiaan van Stijn
a247bf0e99 Merge pull request #29661 from vdemeester/integration-cli-test-environment
[integration-test] Introduce an environment package
2016-12-29 22:12:42 +01:00
Brian Goff
11b11e1559 Merge pull request #29769 from duglin/FixWinTest
Fix flaky windows TestRestartRunningContainer test
2016-12-29 15:48:43 -05:00
Doug Davis
bae22d167c Fix flaky windows TestRestartRunningContainer test
I was seeing this for windowsRS1 testing:
17:20:36 ----------------------------------------------------------------------
17:20:36 FAIL: docker_cli_restart_test.go:31: DockerSuite.TestRestartRunningContainer
17:20:36
17:20:36 docker_cli_restart_test.go:39:
17:20:36     c.Assert(out, checker.Equals, "foobar\n")
17:20:36 ... obtained string = ""
17:20:36 ... expected string = "foobar\n"
17:20:36
17:20:59
17:20:59 ----------------------------------------------------------------------

and I think its because there's a delay between the time the container is
started and the 'echo' is actually run. This gives it up to 10 seconds
to do the 'echo' before giving up.

/cc @jhowardmsft

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-12-29 08:13:43 -08:00