Commit graph

3926 commits

Author SHA1 Message Date
Aaron Lehmann
2cc5bd33ee Replace secrets with join tokens
Implement the proposal from
https://github.com/docker/docker/issues/24430#issuecomment-233100121

Removes acceptance policy and secret in favor of an automatically
generated join token that combines the secret, CA hash, and
manager/worker role into a single opaque string.

Adds a docker swarm join-token subcommand to inspect and rotate the
tokens.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-07-21 15:23:03 -07:00
Sebastiaan van Stijn
bdf4d9c1cd Merge pull request #24884 from Microsoft/jjh/TestBuildWorkdirWindowsPath
Windows: TestBuildWorkdirWindowsPath hard code fix
2016-07-21 11:42:26 +02:00
John Howard
ceed93a874 Windows: TestBuildWorkdirWindowsPath hard code fix
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-07-20 21:23:38 -07:00
Tõnis Tiigi
ea59668046 Merge pull request #24563 from dperny/test-leader-election
Added leader election test
2016-07-20 16:02:09 -07:00
Sebastiaan van Stijn
4b7a83dbce Merge pull request #24853 from Microsoft/jjh/nanoserver
Windows: Allow nanoserver image for CLI
2016-07-20 22:50:08 +02:00
Sebastiaan van Stijn
7d84c71500 Merge pull request #24620 from yongtang/24270-service-list-filter
Allow partial name match for service ls --filter, node ls --filter, node tasks --filter
2016-07-20 21:25:06 +02:00
John Howard
624e6cdbf3 Windows: Allow nanoserver image for CLI
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-07-20 09:59:52 -07:00
Sebastiaan van Stijn
2a78789ad1 Merge pull request #24266 from allencloud/add_cmd_docker_stack_services_STACKNAME
add command `docker stack services STACKNAME`
2016-07-20 18:38:08 +02:00
Yong Tang
e734fa58ea Allow partial name match for node ls, and node tasks
This fix is an extension to last commit to expand the partial
filter to node and task searches.

Additional integration tests have been added to cover the changes.

This fix fixes 24270.
This fix fixes 24112.

Note: A separate pull request will be opened on swarmkit.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-07-20 08:16:10 -07:00
Brian Goff
a9b392014f Merge pull request #24653 from dongluochen/testrollingupdate
Add integration test for rolling update
2016-07-19 16:51:40 -04:00
Vincent Demeester
f2afd1a906 Merge pull request #24049 from tophj-ibm/remove-lingering-volume-from-tests
DockerExternalVolumeSuite: add daemon to test
2016-07-19 22:39:39 +02:00
Dong Chen
d327765a62 Test rolling update.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
2016-07-19 12:09:30 -07:00
Drew Erny
3489e76513 Added leader election test
Signed-off-by: Drew Erny <drew.erny@docker.com>
2016-07-19 11:29:27 -07:00
Arnaud Porterie
ffba13f435 Merge pull request #24648 from mlaventure/fix-kill-test
Fix TestDaemonRestartWithKilledRunningContainer failures on RHEL systems
2016-07-19 18:24:34 +00:00
Kenfe-Mickael Laventure
64483c3bda Do not rely on "live" event anymore
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-07-19 08:24:39 -07:00
Doron Podoleanu
6bec735c91 Use const http status code instead of just numbers see #24783
Signed-off-by: Doron Podoleanu <doronp@il.ibm.com>
2016-07-19 10:40:20 +03:00
allencloud
4b21b411ec add command docker stack services STACKNAME
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-19 14:21:58 +08:00
Brian Goff
f49fdb9d0b Merge pull request #24755 from thaJeztah/fix-error-message
update "image delete" error to match actual behavior
2016-07-18 22:47:55 -04:00
Yong Tang
1d600ebcb5 Allow partial name match for service ls --filter
This fix tries to address the issue raised in 24270 where it was
not possible to have a partial name match when list services
with name filter.

This fix updates swarmkit and allows prefix search when name is
provided as the filter for listing services.

An additional integration test is added to cover the changes.

This fix fixes 24270.

Note: A separate pull request will be opened on swarmkit.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-07-18 17:53:08 -07:00
Sebastiaan van Stijn
340964db1c Merge pull request #24692 from anusha-ragunathan/plugins-ux
Print plugin name on successful install, enable and disable.
2016-07-19 01:09:35 +02:00
Arnaud Porterie
6fc46474fb Merge pull request #24701 from dperny/test-leader-proxy
Added test for leader proxying
2016-07-18 22:15:16 +00:00
Sebastiaan van Stijn
f0988dd395
update "image delete" error to match actual behavior
The error message;

    unable to delete .... (must be forced) - image is referenced in one or more repositories

Looks to be incorrect

Given the following images:

    docker images | grep 2d36b1c0ea40
    registry                           2                                     2d36b1c0ea40        7 weeks ago         171.2 MB
    registry                           2.4.1                                 2d36b1c0ea40        7 weeks ago         171.2 MB

Removing the image by *id* fails:

    docker rmi 2d36b1c0ea40
    Error response from daemon: conflict: unable to delete 2d36b1c0ea40 (must be forced) - image is referenced in one or more repositories

However, after untagging one image:

    docker rmi registry:2
    Untagged: registry:2

Removing the image works:

    docker rmi 2d36b1c0ea40
    Untagged: registry:2.4.1
    Deleted: sha256:2d36b1c0ea40159adc8b36f7563f1d7a6d443384fe2611e8b393c1cb3ae2e6ad
    Deleted: sha256:7abfddbf4e61927307b6646010845eeb7513ecc6541f33ea6103b2493e36aa4e
    Deleted: sha256:f512d7699dbb2994fe15d30ee1d404e57b58c3c310617b4471db649680b4cfa0
    Deleted: sha256:7291e34714908270aeda93f1dc681485f9734d41314e2fdc6c11f32ffa782a21
    Deleted: sha256:548f6562929484f3d78267e4b1e31dcfeb9f303059668888b4423ce5501c7fbc
    Deleted: sha256:afe56b46629e6d8e0bfc36fed13395a7cfa2bd83b58bb489976ef13553eff20b
    Deleted: sha256:cf0c3bd5d6a0a14ebf96cc7d3df79a37774a70f3086273e09da71a86fe74fec2
    Deleted: sha256:c5fdaf8b055f544d0211043e687905315c3a0b71c1c08df07e473dd0a30e43c8

    docker images | grep 2d36b1c0ea40
    <empty>

This changes the error message to reflect that behavior

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-07-18 23:17:55 +02:00
Drew Erny
d305aa48dd Added test for leader proxying
Signed-off-by: Drew Erny <drew.erny@docker.com>
2016-07-18 13:18:02 -07:00
Anusha Ragunathan
6dca1e6d3f Print plugin name on successful install, enable and disable.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-07-18 09:47:12 -07:00
Arnaud Porterie
ba6adc5f46 Merge pull request #24646 from anusha-ragunathan/use-volume-plugins
Remove use of exec-root in plugins due to socket pathname limits.
2016-07-18 16:28:22 +00:00
allencloud
e5bed17574 update comparison log in container config
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-16 11:26:19 +08:00
Anusha Ragunathan
21ecd5a93d Remove use of exec-root in plugins due to socket pathname limits.
Unix sockets are limited to 108 bytes. As a result, we need to be
careful in not using exec-root as the parent directory for pluginID
(which is already 64 bytes), since it can result in socket path names
longer than 108 bytes. Use /tmp instead. Before this change, setting:
- dockerd --exec-root=/go/src/github.com/do passes
- dockerd --exec-root=/go/src/github.com/doc fails
After this change, there's no failure.

Also, write a volume plugins test to verify that the plugins socket
responds.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-07-15 09:17:29 -07:00
Tonis Tiigi
f5fb3c69fd Fix panic in stats test
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-07-14 17:30:57 -07:00
Daniel Nephin
4c6faa4340 Change the add/update flags to include 'add'
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-07-13 16:06:25 -04:00
Daniel Nephin
dc33fc1ff4 Add remove flags for service update
with unit tests

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-07-13 16:06:25 -04:00
Tibor Vass
778b38cbf1 Merge pull request #23324 from icecrime/add_run_network
Add run network
2016-07-12 14:59:48 -07:00
Tõnis Tiigi
08a2fd7e2e Merge pull request #24465 from LK4D4/restart_cluster_test
integration-cli: add test for restarting entire swarm cluster
2016-07-12 13:12:33 -07:00
Arnaud Porterie (icecrime)
c0c7d5e715
Rename --net to --network
Add a `--network` flag which replaces `--net` without deprecating it
yet. The `--net` flag remains hidden and supported.

Add a `--network-alias` flag which replaces `--net-alias` without deprecating
it yet. The `--net-alias` flag remains hidden and supported.

Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>
2016-07-12 13:01:35 -07:00
Arnaud Porterie
79432b4367 Merge pull request #24528 from rsippl/24526-empty-services-list
Return an empty services list if no services are running
2016-07-12 18:31:28 +00:00
Ralf Sippl
65e72133a1 Add API test for empty services list
Signed-off-by: Ralf Sippl <ralf.sippl@gmail.com>
2016-07-12 17:31:44 +02:00
Sebastiaan van Stijn
110b2aecda Merge pull request #24504 from hqhq/soften_update_kmem
Soften limitation of update kernel memory
2016-07-12 13:58:17 +02:00
Vincent Demeester
1685b605a8 Merge pull request #24464 from tonistiigi/waitandassert
Use waitAndAssert to test node state changes
2016-07-12 10:05:55 +02:00
Brian Goff
b91e2dd994 Merge pull request #24229 from anusha-ragunathan/shutdown-plugins
Shutdown plugins during daemon shutdown.
2016-07-11 22:14:50 -04:00
Qiang Huang
08c7075c40 Soften limitation of update kernel memory
Kernel memory is not allowed to be updated if container is
running, it's not actually a precise kernel limitation.

Before kernel version 4.6, kernel memory will not be accounted
until kernel memory limit is set, if a container created with
kernel memory initialized, kernel memory is accounted as soon
as process created in container, so kernel memory limit update
is allowed afterward. If kernel memory is not initialized,
kernel memory consumed by processes in container will not be
accounted, so we can't update the limit because the account
will be wrong.

So update kernel memory of a running container with kernel memory
initialized is allowed, we should soften the limitation by docker.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-07-12 08:07:24 +08:00
Tibor Vass
880484992c Merge pull request #24501 from hqhq/remove_exec_driver
Remove execution driver
2016-07-11 16:54:36 -07:00
Alexander Morozov
ae4137ae3c integration-cli: add test for restarting entire swarm cluster
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-07-11 14:48:57 -07:00
Anusha Ragunathan
863ab9ab13 Shutdown plugins during daemon shutdown.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-07-11 14:21:27 -07:00
Vincent Demeester
46649755f8 Merge pull request #24051 from allencloud/return-err-when-stack-name-nonexist
output some details when stack name does not exist
2016-07-11 20:43:09 +02:00
Tonis Tiigi
f02ec39e99 Use waitAndAssert to test node state changes
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-07-11 10:01:14 -07:00
allencloud
416613f2e5 return err when stack name does not exist
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-12 00:59:30 +08:00
Qiang Huang
1fb1136fec Remove execution driver
We use containerd and there is no execution driver anymore.

Addresses: https://github.com/docker/docker/issues/24461

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-07-11 14:52:27 +08:00
Antonio Murdaca
9fadb8fd6a integration-cli: fix --net=none tests
Example:

21:28:01 [d68573521] waiting for daemon to start
21:28:01 [d68573521] daemon started
21:28:01 docker_api_swarm_test.go:163:
21:28:01     c.Assert(d1.Init(map[string]bool{"worker": true}, ""),
checker.IsNil)
21:28:01 ... value *errors.errorString =
&errors.errorString{s:"initializing swarm: invalid statuscode 500,
\"{\\\"message\\\":\\\"could not determine local IP address: dial udp
8.8.8.8:53: connect: network is unreachable\\\"}\\n\"} ("initializing
swarm: invalid statuscode 500, \"{\\\"message\\\":\\\"could not
determine local IP address: dial udp 8.8.8.8:53: connect: network is
unreachable\\\"}\\n\"")
21:28:01
21:28:01 [d68573521] exiting daemon"}

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-07-10 15:56:02 +02:00
Tonis Tiigi
a3f1577365 Add more complicated demotion testcases
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-07-08 13:33:40 -07:00
Sebastiaan van Stijn
db435560b3 Merge pull request #24389 from Microsoft/jjh/silentsecurity
Windows: No security warning on quiet
2016-07-08 11:06:33 -07:00
Tibor Vass
07dd69df8d Merge pull request #23312 from justincormack/proxy
Make the docker proxy a standalone binary not a re-exec
2016-07-07 17:14:40 -07:00
John Howard
a9b3c1d720 Windows: No security warning on quiet
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-07-07 16:00:08 -07:00
Justin Cormack
6dfba780cc Fix test case for docker_api_swarm_test.go
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-07-07 21:01:55 +01:00
Tõnis Tiigi
db67db98d8 Merge pull request #24349 from aaronlehmann/swarm-secrets-by-default
Generate a swarm joining secret if none is specified
2016-07-07 11:43:08 -07:00
Sebastiaan van Stijn
6167a9ab16 Merge pull request #22868 from Microsoft/jjh/dockerfilecmd
Windows: CMD not honouring arg escaping
2016-07-07 09:21:26 -07:00
Vincent Demeester
656c66dd50 Merge pull request #24383 from anusha-ragunathan/not-plugin
Detect non-plugin content during install and error out.
2016-07-07 11:18:27 +02:00
Brian Goff
56f3422468 Use newer default values for mounts CLI
In the API:
`Writable` changed to `ReadOnly`
`Populate` changed to `NoCopy`

Corresponding CLI options updated to:
`volume-writable` changed to `volume-readonly`
`volume-populate` changed to `volume-nocopy`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-07-06 22:34:39 -04:00
Anusha Ragunathan
d32df6d934 Detect non-plugin content during install and error out.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-07-06 18:49:39 -07:00
Aaron Lehmann
7342e42fce Generate a swarm joining secret if none is specified
The current behavior of `docker swarm init` is to set up a swarm that
has no secret for joining, and does not require manual acceptance for
workers. Since workers may sometimes receive sensitive data such as pull
credentials, it makes sense to harden the defaults.

This change makes `docker swarm init` generate a random secret if none
is provided, and print it to the terminal. This secret will be needed to
join workers or managers to the swarm. In addition to improving access
control to the cluster, this setup removes an avenue for
denial-of-service attacks, since the secret is necessary to even create
an entry in the node list.

`docker swarm init --secret ""` will set up a swarm without a secret,
matching the old behavior. `docker swarm update --secret ""` removes the
automatically generated secret after `docker swarm init`.

Closes #23785

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-07-06 13:04:50 -07:00
Alexander Morozov
6f052edcc0 Merge pull request #24133 from cpuguy83/hacky_swarm_integration_tests
Implement service integration tests
2016-07-06 11:49:27 -07:00
Antonio Murdaca
a0c8970df1 integration-cli: ensure digest is the same after cross-repo push
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-07-06 13:12:42 +02:00
Brian Goff
e5ec575b32 Implement service integration tests
This is done in a hacky way as currently there is no better way.
Uses known implementation details about how tasks are scheduled to be
able to operate on the underlying container.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-07-05 21:39:42 -04:00
Arnaud Porterie
ee0283c97a Merge pull request #23996 from dmcgowan/always-store-image-digest-update
[carry 23503]  Always store the image digest when pulling and pushing an image.
2016-07-05 16:18:20 +00:00
Antonio Murdaca
98fa9ef7d3 Merge pull request #24300 from coolljt0725/arm64_test
Add NoArm64 testRequires and skip Schema1RegistrySuite on arm64
2016-07-05 12:13:30 +02:00
Lei Jitang
8c179348c3 Add fchmod and fchmodat to TestRunSeccompProfileDenyChmod
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-07-04 11:06:48 +00:00
Lei Jitang
9c1566a1df Add NoArm64 testRequires and skip Schema1RegistrySuite on arm64
schema1 manifests is not working on ARM64, we should skip integration-cli
tests for schema1 manifests on ARM64.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-07-04 10:09:46 +00:00
Otto Kekäläinen
644a7426cc Fix spelling in comments, strings and documentation
Signed-off-by: Otto Kekäläinen <otto@seravo.fi>
2016-07-03 20:58:11 +03:00
Tõnis Tiigi
a0d068e7c6 Merge pull request #24060 from Microsoft/jjh/skipruncidfilecleanupifemptyrs1
Windows: Skip RunCidFileCleanupIfEmpty on RS1
2016-06-30 16:36:41 -07:00
Tõnis Tiigi
9828960ade Merge pull request #24056 from Microsoft/jjh/skiptestbuildemptycmdrs1
Windows: Skip TestBuildEmptyCmd on RS1
2016-06-30 16:34:55 -07:00
Derek McGowan
8906f8307c Treat digest only images as dangling
Add test for dangling digest images

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-06-30 11:32:49 -07:00
Yong Tang
4bc91ceeb7 Use HOSTNAME in the output of docker node ls
This fix tries to address an issue raised in #24090 where
the title field of `docker node ls` use NAME instead of
HOSTNAME. Yet the content of this field is actually
hostname.

The fix makes needed changes for the output of
`docker node ls`.

An additional test has been added to cover the change in
this fix.

This fix fixes #24090.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-29 19:54:16 -07:00
Alexander Morozov
9162011680 Merge pull request #23789 from tonistiigi/swarm-integration-tests
Update swarm integration tests and shutdown synchronization
2016-06-29 14:09:57 -07:00
Vincent Demeester
2f9d20288c Merge pull request #24050 from ncoolz/issue-cluster-store-config
Fix check code for --cluster-store and --cluster-advertise in config_…
2016-06-29 19:15:23 +02:00
Anusha Ragunathan
6d36431e23 Fix daemon tests.
Fix two test issues:
- pidof is not available in PATH on some Jenkins systems (rhel, centos)
  Use kill -0 instead.
- Cleanup after plugin test. This is a stop gap fix. The right way to
  fix this, is to shutdown the plugin on daemon shutdown path (except
  for the live-restore case). This will be done in a follow up PR.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-06-28 15:29:49 -07:00
Wonjun Kim
d71789828f Add integration tests for swarm incompatible
Signed-off-by: Wonjun Kim <wonjun.kim@navercorp.com>
2016-06-29 06:21:02 +09:00
John Howard
20424fccdd Windows: Skip RunCidFileCleanupIfEmpty on RS1
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-06-28 13:04:42 -07:00
John Howard
45da127442 Windows: Skip TestBuildEmptyCmd on RS1
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-06-28 12:22:16 -07:00
Christopher Jones
88ea43d2aa
DockerExternalVolumeSuite: add daemon to test
Part of #23998. Adds a daemon to this test, so that the
volume that's created is added to this test daemon's vol store
instead of the main test daemons.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2016-06-28 13:52:48 -04:00
Yong Tang
3f6e3a0885 Fix docker rename with linked containers
This fix tries to address issue raised in #23973 where the
`docker rename` does not update namedIndex and linkIndex,
thus resulting in failures when the linked containers are
referenced later on.

This fix updates the namedIndex and linkIndex during the
`docker rename` and fixes the issue.

An integration test has been added to cover the changes
in this fix.

This fix fixes #23973.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-27 19:58:05 -07:00
Michael Crosby
48eba0bfe6 Merge pull request #23677 from anusha-ragunathan/mv_test_stable
Move daemon restart tests from experimental to stable.
2016-06-27 13:07:55 -07:00
Michael Crosby
91fa49071d Merge pull request #23775 from mlaventure/change-stock-runtime-alias
Use "runc" as alias for the default runtime
2016-06-27 11:55:46 -07:00
Derek McGowan
33984f256b Always store the image digest when pulling and pushing an image.
Always attempt to add digest even when tag already exists.
Ensure digest does not currently exist.
When image id is mismatched, output an error log.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-06-27 10:09:57 -07:00
Vincent Demeester
1cfd37f432 Merge pull request #23801 from inercia/fix_docker_cli_by_digest
Make sure some integration tests check for the right return code
2016-06-27 15:37:59 +02:00
Alvaro Saurin
b5f51e5281 Change the comments in TestPullFailsWithAlteredLayer and TestPullFailsWithAlteredLayer
Signed-off-by: Alvaro Saurin <alvaro.saurin@gmail.com>
2016-06-27 11:06:32 +02:00
Tonis Tiigi
caaf92f7b4 Disable iptables in swarm test daemons
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-24 15:47:37 -07:00
Tonis Tiigi
1acb8ef825 Add test for force-new-cluster
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-24 13:57:11 -07:00
Tonis Tiigi
22b34d6449 Switch node management tests to api types
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-24 11:51:43 -07:00
Vincent Demeester
88d1ee6c11 Merge pull request #23360 from sainath14/rename_error
docker rename fix to address the issue of renaming with the same name
2016-06-24 19:54:09 +02:00
Vincent Demeester
23696e8265 Merge pull request #23921 from tonistiigi/test-timeouts
Increase test timeouts for node state changes
2016-06-24 19:21:56 +02:00
Brian Goff
f6326d3076 Merge pull request #23802 from inercia/fix_docker_cli_run_test
Make sure we compare string with the same capitalization
2016-06-24 10:27:29 -04:00
Tonis Tiigi
2e5da44341 Increase test timeouts for node state changes
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-23 17:30:42 -07:00
Tõnis Tiigi
487931902c Merge pull request #23790 from tonistiigi/skip-pull
Skip always pulling images on integration tests
2016-06-23 11:47:33 -07:00
Anusha Ragunathan
006d58d7e6 Add plugin restore tests.
Also live restore is stable now. So move experimental tests out to stable.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-06-22 19:04:26 -07:00
Kenfe-Mickael Laventure
69af7d0d13 Use "docker-runc" as alias for the default runtime
This also moves the variable holding the default runtime name from the
engine-api repository into docker repository

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-06-22 11:59:26 -07:00
Alexander Morozov
df6630f6a3 Merge pull request #23832 from tonistiigi/unify-swarm-init-update
Unify swarm init and update options
2016-06-22 11:56:07 -07:00
Sven Dowideit
e76e52b38b Merge pull request #23738 from psiclops/typos
Fix misspell typos
2016-06-22 11:56:13 +10:00
Tonis Tiigi
fb3eb1c27e Unify swarm init and update options
Add api side validation and defaults for init and
join requests.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-21 16:34:32 -07:00
Alexander Morozov
7b2b4eb40c Merge pull request #23700 from Microsoft/jjh/fixrotestcases
Windows: Fix RO test cases
2016-06-21 09:01:43 -07:00
Alvaro Saurin
41cc7c4d9d Make sure we are trying to unmount a mounted /etc/resolv.conf
Signed-off-by: Alvaro Saurin <alvaro.saurin@gmail.com>
2016-06-21 10:38:45 +02:00
Alvaro Saurin
ded347e744 Make sure we compare strings with the same capitalization
Signed-off-by: Alvaro Saurin <alvaro.saurin@gmail.com>
2016-06-21 10:35:50 +02:00
Tonis Tiigi
e2226223e6 Skip always pulling images on integration tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-20 17:45:29 -07:00
John Howard
03816ad5b5 Windows: Fix RO test cases
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-06-20 10:15:20 -07:00
Alexander Morozov
7d7d8fa752 Merge pull request #23449 from HackToday/improveunit
Improve the TestEventsContainerWithMultiNetwork UT
2016-06-20 09:38:22 -07:00
Alexander Morozov
1475557341 Merge pull request #23649 from dmcgowan/image-delete-last-repo-ref
Update rmi logic for canonical references
2016-06-20 09:35:16 -07:00
Vincent Demeester
4cc70c921f Merge pull request #23723 from tonistiigi/incomplete-restore
Don’t try to restore swarm from incomplete state
2016-06-19 19:56:39 +02:00
nick
7135afa79b Fix misspell typos
Signed-off-by: nick <nicholasrusso@icloud.com>
2016-06-19 09:53:31 -07:00
Vincent Demeester
ce72bf8028 Merge pull request #23720 from yongtang/23716-renaming-started-container
Fix `docker start` error with renamed container
2016-06-19 13:56:13 +02:00
Tonis Tiigi
ded1d9af38 Don’t try to restore swarm from incomplete state
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-18 19:43:47 -07:00
Yong Tang
6e86733b47 Fix docker start error with renamed container
This fix tries to fix the issue raised in #23716 where `docker start`
causes an error of `No such container:` if the container has been
renamed before `docker start` returns.

The issue is that `docker start` use container name passed at the
beginning to check for exit code at the end of the `docker start`.

This fix addresses the issue by always use container's `ID` to get
the information during `docker start`.

Additional integration tests have been added to cover this fix.

This fix fixes #23716.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-18 16:43:30 -07:00
Dmitri Shuralyov
8cf4133f37 integration-cli: Change "Dns" to "DNS".
This fixes a minor lint/style issue, improves consistency.

According to Go style, which this project follows, acronyms should have
a consistent case. Source: https://github.com/golang/go/wiki/CodeReviewComments#initialisms

See https://github.com/docker/docker/pull/11310#discussion_r67394302.

Signed-off-by: Dmitri Shuralyov <shurcooL@gmail.com>
2016-06-18 16:32:27 -07:00
Arnaud Porterie (icecrime)
1f8ab93b44
Change docker service update semantics
Change `docker service update` to replace attributes of the target
service rather than augment them. One particular occurrence where the
previous behavior proved problematic is when trying to update a port
mapping: the merge semantics provided no way of removing published
ports, but strictly of adding more.

The utility merge* functions where renamed accordingly to update*.

Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>
2016-06-17 17:09:40 -07:00
Derek McGowan
5cff374b14 Add tests for rmi
Add integration test for removing by image id with tag and digest reference to the same repository.
Add integration test to ensure only tag to other repository remains after deleting tag with accompanying digest reference.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-06-17 10:15:56 -07:00
Tibor Vass
4b70d4561e plugins: install should not automatically accept all permissions
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-06-17 10:03:30 -07:00
Anusha Ragunathan
22e781e8e3 Add disable flag for plugin Install.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-06-17 07:48:43 -07:00
Arnaud Porterie
f52c807650 Merge pull request #23651 from tonistiigi/cert-expiry
Add cert-expiry to swarm update
2016-06-17 02:50:58 +00:00
Tonis Tiigi
a933ac3c27 Add integration test for parsing swarm update options
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-16 19:50:01 -07:00
Arnaud Porterie
f4de3f314e Merge pull request #23644 from tonistiigi/fix-leave-delete
Fix removing containers on leaving from pending state
2016-06-17 01:40:45 +00:00
Arnaud Porterie
0ef720eded Merge pull request #23643 from tonistiigi/membership
Return membership status on join without timeout
2016-06-17 01:40:06 +00:00
Arnaud Porterie
16a6987a00 Merge pull request #23549 from dmcgowan/reference-ui-updates
Do not show empty tags for digest references in output
2016-06-17 00:47:49 +00:00
Tonis Tiigi
826f6f0703 Fix removing containers on leaving from pending state
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-16 16:08:15 -07:00
Tonis Tiigi
1973cee0cd Return membership status on join without timeout
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-16 15:27:08 -07:00
Tibor Vass
6b4e2ad90b Merge pull request #23520 from yongtang/23500-docker-info-security
Add security info to `docker info`
2016-06-16 15:15:33 -07:00
Tõnis Tiigi
6577031787 Merge pull request #23606 from vieux/fix_secrets
fix docker swarm init/update --secret
2016-06-16 14:24:35 -07:00
Tonis Tiigi
aed7667bee Add api tests for secret update
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-16 13:21:55 -07:00
Thomas Leonard
18a59bb869 Remove out-of-date health test
The test was waiting for the container to exit after failing its
healthcheck. However, we no longer automatically terminate containers,
so this waited instead for the container to time-out by itself.

Signed-off-by: Thomas Leonard <thomas.leonard@docker.com>
2016-06-16 13:09:57 +01:00
Vincent Demeester
6253c29494 Merge pull request #23583 from anusha-ragunathan/accept-perms
Add accept-permissions flag for install.
2016-06-16 12:44:37 +02:00
Arnaud Porterie
e3ad63f7e4 Merge pull request #23582 from tophj-ibm/fix-typo-in-daemon-test
Fix daemon test typo
2016-06-16 05:22:50 +00:00
Arnaud Porterie
17bf13b1b2 Merge pull request #23558 from mlaventure/fix-arm-test-for-multiple-runtimes
Fix TestRunWithRuntime* on arm
2016-06-16 04:09:15 +00:00
Victor Vieux
085895342c fix docker swarm init/update --secret
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-06-15 17:05:10 -07:00
John Howard
d05d0211bc Windows: CMD not honouring arg escaping
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-06-15 16:46:32 -07:00
Anusha Ragunathan
a2d48c9e4e Add basic integration tests for plugins.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-06-15 15:19:19 -07:00
Christopher Jones
51c0c6212d
Fix test typo
Changes daemn to daemon

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2016-06-15 13:45:25 -04:00
Tonis Tiigi
22f827abab Fix hanging integration tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-15 10:19:45 -07:00
Arnaud Porterie
480d7b310b Merge pull request #23301 from runcom/tmpfs-trump
daemon: allow tmpfs to trump over VOLUME(s)
2016-06-15 17:11:00 +00:00
Antonio Murdaca
756f6cef4a daemon: allow tmpfs to trump over VOLUME(s)
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-06-15 16:01:51 +02:00
Vincent Demeester
e08aed59df Merge pull request #23322 from tkopczynski/20784-builder-dockerfile-symlink
Reimplement integration test for symlink Dockerfile as a unit test
2016-06-15 10:52:49 +02:00
Derek McGowan
79eada3814 Do not show empty tags for digest references in output
When a repository has a tag and digests, show tag for each digest value.
Do not duplicate rows for the same image name with both tag and digest.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-06-14 22:44:49 -07:00
Arnaud Porterie
91197953d0 Merge pull request #23524 from aboch/restore
Daemon to support network restore
2016-06-15 02:33:16 +00:00
Arnaud Porterie
574f7d2149 Merge pull request #23551 from tonistiigi/update-swarmkit
Update swarmkit to 25572005f
2016-06-15 02:25:31 +00:00
Kenfe-Mickael Laventure
bd6317031b Fix TestRunWithRuntime* on arm
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-06-14 18:59:22 -07:00
Michael Crosby
cd03a68d31 Merge pull request #23530 from crosbymichael/exp-tests
Kill containers after restart tests
2016-06-14 17:43:52 -07:00
Brian Goff
6ed921dc38 Merge pull request #23446 from tiborvass/plugins-experimental
Plugins: experimental support for new plugin management
2016-06-14 20:32:14 -04:00
Tonis Tiigi
b38408fd02 Update drain test
With the rolling update there can be a possibility
that the container count matches the update has
completely finished yet.

The actual bug for the flakiness was fixed with the
swarmkit update.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-14 17:25:17 -07:00
Lei Jitang
7d0689a8d3 Add test case for network restore
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-06-14 16:45:30 -07:00
Michael Crosby
e07d78d247 Kill containers after restart tests
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-06-14 16:17:36 -07:00
Michael Crosby
c97fdbe3c5 Merge pull request #23415 from aboch/ll
Allow user to specify container's link-local addresses
2016-06-14 15:47:54 -07:00
Alessandro Boch
1c4efb6aa0 Allow user to specify container's link-local addresses
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-06-14 14:28:33 -07:00
Tibor Vass
f37117045c plugins: experimental support for new plugin management
This patch introduces a new experimental engine-level plugin management
with a new API and command line. Plugins can be distributed via a Docker
registry, and their lifecycle is managed by the engine.
This makes plugins a first-class construct.

For more background, have a look at issue #20363.

Documentation is in a separate commit. If you want to understand how the
new plugin system works, you can start by reading the documentation.

Note: backwards compatibility with existing plugins is maintained,
albeit they won't benefit from the advantages of the new system.

Signed-off-by: Tibor Vass <tibor@docker.com>
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-06-14 14:20:27 -07:00
Brian Goff
9c52b11e2a TestCleanupMountsAfterGracefulShutdown wait for daemon exit
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-06-14 17:14:53 -04:00
Tomasz Kopczynski
830584b011 Reimplement integration test for symlink Dockerfile as a unit test
Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
2016-06-14 23:07:19 +02:00
Yong Tang
eee20b564f Add security info to docker info
The security infomation has already been added to `GET /info` in #21172.
However, it is not part of the output of `docker info` yet.

This fix adds the security information to `docker info`.

Additional tests has been added to cover changes.

This fix fixes #23500. This fix is related to #20909, #21172.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-14 12:23:45 -07:00
Michael Crosby
6381ed14d1 Merge pull request #22983 from mlaventure/multiple-runtimes
Add support for multiple runtimes
2016-06-14 11:59:34 -07:00
Tonis Tiigi
32f18616c7 Temporarily skip flaky part of the drain test
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-14 10:20:40 -07:00
Kenfe-Mickael Laventure
77efe6dffc Skip TestRunResolvconfUpdate as it is unstable
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-06-14 07:47:31 -07:00
Kenfe-Mickael Laventure
1f266d40f3 Fix race in DockerExternalGraphdriverSuite.TestExternalGraphDriver
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-06-14 07:47:31 -07:00
Kenfe-Mickael Laventure
7b2e5216b8 Add support for multiples runtimes
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-06-14 07:47:31 -07:00
Tibor Vass
a1e319e847 Merge pull request #23361 from docker/swarm
Add dependency to docker/swarmkit
2016-06-14 00:55:55 -07:00
Vincent Demeester
7d988a7aa6 Merge pull request #23093 from tkopczynski/20784-builder-dockerfile-outside-context
Builder integration tests for Dockerfile outside context as a unit test
2016-06-14 08:44:24 +02:00
Daniel Nephin
12a00e6017 Add Swarm management CLI commands
As described in our ROADMAP.md, introduce new Swarm management commands
to call to the corresponding API endpoints.

This PR is fully backward compatible (joining a Swarm is an optional
feature of the Engine, and existing commands are not impacted).

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-13 22:17:15 -07:00
Tonis Tiigi
0d88d5b64b Swarm integration tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-06-13 22:16:18 -07:00
Michael Crosby
3020081e94 Merge pull request #23213 from crosbymichael/restore-option
Add --live-restore flag
2016-06-13 20:57:19 -07:00
Michael Crosby
d705dab1b1 Add --live-restore flag
This flags enables full support of daemonless containers in docker.  It
ensures that docker does not stop containers on shutdown or restore and
properly reconnects to the container when restarted.

This is not the default because of backwards compat but should be the
desired outcome for people running containers in prod.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-06-13 19:16:26 -07:00
Vincent Demeester
5338ae7133 Merge pull request #23425 from runcom/authz-race
pkg: authorization: lock when lazy loading
2016-06-13 23:20:37 +02:00
Antonio Murdaca
d1b7e8373b authz: cleanups
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-06-12 17:23:19 +02:00
Vincent Demeester
4dafd107ad Merge pull request #22777 from WeiZhang555/wait-restarting
Bug fix: `docker run -i --restart always` hangs
2016-06-12 13:01:20 +02:00
Yong Tang
d917723331 Fix incorrect usage of logrus when formatting string is present
This fix tries to fix logrus formatting by adding `f` to the end of
`logrus.[Error|Warn|Debug|Fatal|Panic|Info](` when formatting string
is present but the function `logrus.[Error|Warn|Debug|Fatal|Panic|Info](`
is used (incorrectly).

This fix is related to #23459, and is a follow up of #23461.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-11 15:37:36 -07:00
Kai Qiang Wu(Kennan)
e0de1718ee Improve the UT
As the #23387 comment, the temp fix for UT need to be improved
to make it test the expected behavior. So let's add it.

Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2016-06-11 07:00:31 +00:00
Vincent Demeester
51f0def774 Merge pull request #23400 from runcom/fix-digest-test
integration-cli: use distribution/reference.DigestRegexp
2016-06-10 11:56:14 +02:00
Antonio Murdaca
0bc88d5b0a integration-cli: use distribution/reference.DigestRegexp
from a docker push output digest.DigestRegexp.FindString(output) does
not retrive the sha256: prefixed digest but just a string - in many
cases it's the registry host. The checks in the code are completely
wrong then. Fix this by using the DigestRegexp from the
distribution/reference package which correctly retrieves the digest
from the output.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-06-09 11:11:08 +02:00
Jess Frazelle
982c5f199f
fix default tmpfs size to prevent breakage
Signed-off-by: Jess Frazelle <me@jessfraz.com>
2016-06-09 00:58:06 -07:00
Sainath Grandhi
3e8c16ef6d docker rename fix to address the issue of renaming with the same name issue #23319
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
2016-06-08 15:32:40 -07:00
Sebastiaan van Stijn
7d22eb072c
fix TestEventsContainerWithMultiNetwork
the order in which disconnect takes place is undetermined,
so don't check for the full name

this test was passing due to a previous bug, that
always returned the same network-name.

this bug was recently fixed in 148bcda329
(pull request 23375), exposing this test to be
flaky.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-06-08 23:09:20 +02:00
Alexander Morozov
3b08711bb7 Merge pull request #23343 from vdemeester/migrate-build-to-cobra
Use spf13/cobra for docker build
2016-06-08 11:59:48 -07:00
Michael Crosby
393e97e435 Merge pull request #23002 from Microsoft/jjh/readonly
Windows: Support RO volumes 14350+
2016-06-08 11:18:48 -07:00
Brian Goff
9db33b7646 Merge pull request #23377 from vdemeester/carry-pr-23007
Carry #23007 :  Say something useful during docker load
2016-06-08 13:42:22 -04:00
Vincent Demeester
148bcda329 Merge pull request #23375 from HackToday/fixnetworkmap
Fix wrong map usage
2016-06-08 18:19:08 +02:00
Doug Davis
6986a3220f Say something useful during docker load
During a `docker load` there are times when nothing is printed
to the screen, leaving the user with no idea whether something happened.
When something *is* printed, often its just something like:
```
1834950e52ce: Loading layer 1.311 MB/1.311 MB
5f70bf18a086: Loading layer 1.024 kB/1.024 kB
```
which isn't necessarily the same as the image IDs.

This PR will either show:
- all of the tags for the image, or
- all of the image IDs if there are no tags

Sample output:
```
$ docker load -i busybox.tar
Loaded image: busybox:latest

$ docker load -i a.tar
Loaded image ID: sha256:47bcc53f74dc94b1920f0b34f6036096526296767650f223433fe65c35f149eb
```

IOW, show the human-friendly stuff first and then only if there are no tags
default back to the image IDs, so they have something to work with.

For me this this is needed because I have lots of images and after a
recent `docker load` I had no idea what image I just imported and had a
hard time figuring it out.  This should fix that by telling the user
which images they just imported.

I'll add tests once there's agreement that we want this change.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-06-08 17:17:05 +02:00
Kai Qiang Wu(Kennan)
1cac7e6cbd Fix wrong map usage
As map reference, if all networks use same, it could cause strange
results.
Closes: #23304
Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2016-06-08 14:36:47 +00:00
Ben Firshman
322e2a7d05 Return remote API errors as JSON
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
2016-06-07 18:45:27 -07:00
John Howard
8d174a43ba Windows: Support RO volumes 14350+
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-06-07 14:55:36 -07:00
Brian Goff
ce96ce9e05 Merge pull request #23311 from WeiZhang555/cobra-rm
Migrate rm command to cobra
2016-06-07 17:05:21 -04:00
Alexander Morozov
8cd6977f98 Merge pull request #23338 from vdemeester/23253-fix-create-run
Fix create command flags
2016-06-07 10:46:45 -07:00
Vincent Demeester
60f447b655
Migrate docker build to cobra
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-07 18:15:44 +02:00
Sebastiaan van Stijn
7c46ba02e6
add support for filtering by network ID
This adds support for filtering by network ID, to be
consistent with other filter options.

Note that only *full* matches are returned; this is
consistent with other filters (e.g. volume), that
also return full matches only.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-06-07 16:50:31 +02:00
Sainath Grandhi
912af1ae8f Adding network filter to docker ps command
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
2016-06-07 16:43:11 +02:00
Zhang Wei
7702f39fe8 Migrate rm command to cobra
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-06-07 22:19:16 +08:00
Sebastiaan van Stijn
085f41b6a5
Fix TestRenameInvalidName
Change the test back to what it was before
e83dad090a

And added an extra test-case to check the
output if an incorrect number of arguments
is passed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-06-07 15:42:48 +02:00
Vincent Demeester
aa00520fc8
Fix create command flags
Any command that expects extra flags after positional args needs to set flags.SetInterspersed(false).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-07 14:11:11 +02:00
Sebastiaan van Stijn
f061f556f2 Merge pull request #23269 from vdemeester/migrate-import-to-cobra
Use spf13/cobra for docker import
2016-06-07 13:07:30 +02:00
Vincent Demeester
148d2b8e4a Merge pull request #22149 from vdemeester/deprecated-copy-endpoint
Deprecate /containers/(id or name)/copy endpoint
2016-06-07 12:50:04 +02:00
Sebastiaan van Stijn
eb6b5a6448 Merge pull request #23172 from michael-holzheu/PR-s390x-seccomp
Enable seccomp for s390x and ppc: s390x part
2016-06-07 12:04:13 +02:00
Vincent Demeester
f9021838b6 Merge pull request #23226 from HackToday/fixnetinspectId
Fix the network inspect id
2016-06-07 10:02:17 +02:00
Vincent Demeester
e83dad090a Merge pull request #23290 from yongtang/23211-spf13-cobra-rename
Use spf13/cobra for docker rename
2016-06-07 08:28:27 +02:00
Brian Goff
ab821f9f9b Merge pull request #23274 from WeiZhang555/cobra-attach
Move attach command to cobra
2016-06-06 21:16:45 -04:00
Yong Tang
70f7ccb304 Use spf13/cobra for docker rename
This fix is part of the effort to convert commands to spf13/cobra #23211.

Thif fix coverted command `docker rename` to use spf13/cobra

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-06 12:39:11 -07:00
Alexander Morozov
4f1c5772a8 Merge pull request #23217 from clnperez/speedup-pushfail-tests
test trusted push: use a nonexistant hostname
2016-06-06 10:12:42 -07:00
Kai Qiang Wu(Kennan)
864e362aa0 Fix the network inspect id
This fixes #22231

Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2016-06-06 15:26:07 +00:00
Zhang Wei
eceb8625a9 Move attach command to cobra.
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-06-06 22:28:57 +08:00
Michael Holzheu
bf2a577c13 Enable seccomp for s390x
To implement seccomp for s390x the following changes are required:

1) seccomp_default: Add s390 compat mode

   On s390x (64 bit) we can run s390 (32 bit) programs in 32 bit
   compat mode. Therefore add this information to arches().

2) seccomp_default: Use correct flags parameter for sys_clone on s390x

   On s390x the second parameter for the clone system call is the flags
   parameter. On all other architectures it is the first one.

   See kernel code kernel/fork.c:

   #elif defined(CONFIG_CLONE_BACKWARDS2)
   SYSCALL_DEFINE5(clone, unsigned long, newsp, unsigned long, clone_flags,
                   int __user *, parent_tidptr,

   So fix the docker default seccomp rule and check for the second
   parameter on s390/s390x.

3) seccomp_default: Add s390 specific syscalls

  For s390 we currently have three additional system calls that should
  be added to the seccomp whitelist:

  - Other architectures can read/write unprivileged from/to PCI MMIO memory.
    On s390 the instructions are privileged and therefore we need system
    calls for that purpose:

    * s390_pci_mmio_write()
    * s390_pci_mmio_read()

  - Runtime instrumentation:

    * s390_runtime_instr()

4) test_integration: Do not run seccomp default profile test on s390x

   The generated profile that we check in is for amd64 and i386
   architectures and does not work correctly on s390x.

   See also: 75385dc216 ("Do not run the seccomp tests that use
   default.json on non x86 architectures")

5) Dockerfile.s390x: Add "seccomp" to DOCKER_BUILDTAGS

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
2016-06-06 08:13:22 -04:00
Vincent Demeester
7878705dcc
Fix TestDiffEmptyArgClientError O:)
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-06 13:58:29 +02:00
Vincent Demeester
4bd202b00f
Migrate network command to cobra
- Migrates network command and subcommands (connect, create, disconnect,
  inspect, list and remove) to spf13/cobra
- Create a RequiredExactArgs helper function for command that require an
  exact number of arguments.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-06 10:28:52 +02:00
Vincent Demeester
28dde09cdf Merge pull request #22077 from cpuguy83/remote_volplugin_caps
Add support for volume scopes
2016-06-06 10:15:43 +02:00
Vincent Demeester
2becfab55f Merge pull request #23283 from yongtang/23211-spf13-cobra-diff
Use spf13/cobra for docker diff
2016-06-06 09:05:18 +02:00
Zhang Wei
c498d4700d Bug fix: docker run -i --restart always hangs.
e.g.
```
$ docker run -i --restart always busybox sh
pwd
/
exit 11

<...hang...>
```

This is because Attach(daemon side) and Run(client side) both hangs on
WaitStop, if container is restarted too quickly, wait won't have chance
to get exit signal.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-06-06 10:16:07 +08:00
Alexander Morozov
e94be2f639 Merge pull request #23242 from vdemeester/migrate-rmi-to-cobra
Use spf13/cobra for docker rmi
2016-06-05 15:29:01 -07:00
Yong Tang
5899afae52 Use spf13/cobra for docker diff
This fix is part of the effort to convert commands to spf13/cobra #23211.

Thif fix coverted command `docker diff` to use spf13/cobra

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-05 15:13:55 -07:00
Sebastiaan van Stijn
951702a567 Merge pull request #23280 from icecrime/remove_num_commands_test
Remove unnecessary check for number of commands
2016-06-05 23:25:48 +02:00
Vincent Demeester
60e48bd6bd
Use spf13/cobra for docker rmi
Moves image command rmi to `api/client/image/remove.go` and use cobra :)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-05 22:40:35 +02:00
Brian Goff
1a1083ae75 Merge pull request #23247 from thaJeztah/carry-22033-docker-ps-format-output
[Carry 22033] Add a check for size field in custom format string
2016-06-05 16:39:22 -04:00
Brian Goff
2f40b1b281 Add support for volume scopes
This is similar to network scopes where a volume can either be `local`
or `global`. A `global` volume is one that exists across the entire
cluster where as a `local` volume exists on a single engine.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-06-05 15:37:15 -04:00
Arnaud Porterie (icecrime)
dd7e59a40a
Remove unnecessary check for number of commands
Testing for the number of commands in `help` output doesn't seem to
contribute much to the quality of the project, and adds additional
burden for the developer to update.

Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>
2016-06-05 11:44:50 -07:00
Vincent Demeester
df1dd1322d Merge pull request #22489 from Microsoft/jjh/shell
Builder shell configuration
2016-06-05 17:43:12 +02:00
Tomasz Kopczynski
fb175bb367 Reimplementing builder tests for Dockerfile outside context as a unit test
Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
2016-06-05 08:39:06 +02:00
Sebastiaan van Stijn
6b4a46f282 Merge pull request #23253 from vdemeester/carry-pr-23159
Carry #23159 : Use spf13/cobra for `docker run` and `docker create`
2016-06-04 18:55:23 +02:00
Vincent Demeester
e975dadaa0 Merge pull request #23254 from thaJeztah/prepare-for-go-1.7
Bump engine-api 772250a752e34cacaeef7c92b8e0ddf43450b629, prepare for go 1.7
2016-06-04 16:07:27 +02:00
Sebastiaan van Stijn
496adadcec
Update TestHttpsInfoRogueCert for Go 1.7
The error message changed from

  remote error: bad certificate

To

  remote error: tls: bad certificate

In Go 1.7, so just checking for "bad certificate"
to make this test work on both Go 1.6 and 1.7

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-06-04 14:17:24 +02:00
Sebastiaan van Stijn
843720257b Merge pull request #23248 from Microsoft/jjh/flakeytest
Windows: Turn off TestBuildDockerignoreComment
2016-06-04 14:07:52 +02:00
Daniel Nephin
5ab2434225 Convert 'docker create' to use cobra and pflag
Return the correct status code on flag parsins errors.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-06-04 13:57:30 +02:00
Brian Goff
521f79bf0e Merge pull request #23241 from vdemeester/migrate-search-to-cobra
Use spf13/cobra for docker search
2016-06-03 22:07:08 -04:00
John Howard
b18ae8c9cc Builder default shell
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-06-03 13:54:31 -07:00
Sebastiaan van Stijn
2d40e36af8 Merge pull request #23234 from yongtang/23221-utf8-bom
Skip UTF-8 BOM bytes from Dockerfile and .dockerignore if exist
2016-06-03 22:28:48 +02:00
John Howard
d75aaa2ca0 Windows: Turn off TestBuildDockerignoreComment
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-06-03 13:23:35 -07:00
Paulo Ribeiro
55cdb6dcd0
Add a check for size field in custom format string
This fix addresses an issue where including the `{{.Size}}` format
field in conjunction with `docker ps --format`, without the `--size`
flag, would not correctly display the size of containers.

This is done by doing a check on the custom format string, and setting
the size flag on the options struct if the field is found. This struct
gets passed to the engine API which then generates the correct query.

An integration test is included which runs `docker ps --format "table
{{.Size}}"` without `--size`, and checks that the returned output is
not `0 B`.

Fixes #21991

As suggested by @cpuguy83, a parser is implemented to process the format
string as a template, and then traverses the template tree to determine
if `.Size` was called.

This was then reworked by making use of template execution with a
pre-processor struct that will set the `--size` option if the template
calls for the field.

The pre-processor now also sets a boolean in the context passed to the
writer. There is an integration test for this that calls `docker ps
--size --format "{{.Size}}"` and then checks that `size: {{.Size}}` is
not appended, as it would with previous behavior.

Finally, a change was made to the formatter to not automatically
add a `{{.Size}}` if a custom format is provided.

Signed-off-by: Paulo Ribeiro <paigr.io@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-06-03 21:59:10 +02:00
Vincent Demeester
a11ef10631
Use spf13/cobra for docker search
- Move image command search to `api/client/image/search.go`
- Use cobra :)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-03 19:50:01 +02:00
Vincent Demeester
428328908d
Deprecate /containers/(id or name)/copy endpoint
This endpoint has been deprecated since 1.8. Return an error starting
from this API version (1.24) in order to make sure it's not used for the
next API version and so that we can remove it some times later.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-03 19:38:03 +02:00
Alexander Morozov
c80a2f2937 Merge pull request #22898 from WeiZhang555/add-detach-event
Add detach event
2016-06-03 09:49:48 -07:00
Yong Tang
ea86320fcc Skip UTF-8 BOM bytes from Dockerignore if exist
This fix tries to address issues related to #23221 where Dockerignore
may consists of UTF-8 BOM. This likely happens when Notepad
tries to save a file as UTF-8 in Windows.

This fix skips the UTF-8 BOM bytes from the beginning of the
Dockerignore if exists.

Additional tests has been added to cover the changes in this fix.

This fix is related to #23221 (UTF-8 BOM in Dockerfile).

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-03 07:26:36 -07:00
Christy Perez
431e7b6573 trusted push test: Use a nonexistant hostname
Before, the TCP handshake had to time out (approx 30s) before
this test completed. If you use a hostname that doesn't resolve,
then it fails faster.

Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
2016-06-03 08:41:58 -05:00
Yong Tang
678c80f925 Skip UTF-8 BOM bytes from Dockerfile if exists
This fix tries to address issues in #23221 where Dockerfile
may consists of UTF-8 BOM. This likely happens when Notepad
tries to save a file as UTF-8 in Windows.

This fix skips the UTF-8 BOM bytes from the beginning of the
Dockerfile if exists.

Additional tests has been added to cover the changes in this
fix.

This fix fixes #23221.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-03 06:16:50 -07:00
Sebastiaan van Stijn
020a86b3d9 Merge pull request #23107 from yongtang/23055-docker-search-limit
Add `--limit` option to `docker search`
2016-06-03 14:25:42 +02:00
Zhang Wei
83ad006d47 Add detach event
If we attach to a running container and stream is closed afterwards, we
can never be sure if the container is stopped or detached. Adding a new
type of `detach` event can explicitly notify client that container is
detached, so client will know that there's no need to wait for its exit
code and it can move forward to next step now.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-06-03 11:59:11 +08:00
Yong Tang
92f10fe228 Add --limit option to docker search
This fix tries to address the issue raised in #23055.
Currently `docker search` result caps at 25 and there is
no way to allow getting more results (if exist).

This fix adds the flag `--limit` so that it is possible
to return more results from the `docker search`.

Related documentation has been updated.

Additional tests have been added to cover the changes.

This fix fixes #23055.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-02 19:12:20 -07:00
Yong Tang
8913dace34 Add support for comment in .dockerignore
This fix tries to address the issue raised in #20083 where
comment is not supported in `.dockerignore`.

This fix updated the processing of `.dockerignore` so that any
lines starting with `#` are ignored, which is similiar to the
behavior of `.gitignore`.

Related documentation has been updated.

Additional tests have been added to cover the changes.

This fix fixes #20083.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-02 19:06:52 -07:00
Sven Dowideit
98c245c9e6 Merge pull request #23193 from allencloud/fix-typos
use grep to find all a/an typos
2016-06-02 18:45:08 -07:00
Thomas Leonard
b6c7becbfe
Add support for user-defined healthchecks
This PR adds support for user-defined health-check probes for Docker
containers. It adds a `HEALTHCHECK` instruction to the Dockerfile syntax plus
some corresponding "docker run" options. It can be used with a restart policy
to automatically restart a container if the check fails.

The `HEALTHCHECK` instruction has two forms:

* `HEALTHCHECK [OPTIONS] CMD command` (check container health by running a command inside the container)
* `HEALTHCHECK NONE` (disable any healthcheck inherited from the base image)

The `HEALTHCHECK` instruction tells Docker how to test a container to check that
it is still working. This can detect cases such as a web server that is stuck in
an infinite loop and unable to handle new connections, even though the server
process is still running.

When a container has a healthcheck specified, it has a _health status_ in
addition to its normal status. This status is initially `starting`. Whenever a
health check passes, it becomes `healthy` (whatever state it was previously in).
After a certain number of consecutive failures, it becomes `unhealthy`.

The options that can appear before `CMD` are:

* `--interval=DURATION` (default: `30s`)
* `--timeout=DURATION` (default: `30s`)
* `--retries=N` (default: `1`)

The health check will first run **interval** seconds after the container is
started, and then again **interval** seconds after each previous check completes.

If a single run of the check takes longer than **timeout** seconds then the check
is considered to have failed.

It takes **retries** consecutive failures of the health check for the container
to be considered `unhealthy`.

There can only be one `HEALTHCHECK` instruction in a Dockerfile. If you list
more than one then only the last `HEALTHCHECK` will take effect.

The command after the `CMD` keyword can be either a shell command (e.g. `HEALTHCHECK
CMD /bin/check-running`) or an _exec_ array (as with other Dockerfile commands;
see e.g. `ENTRYPOINT` for details).

The command's exit status indicates the health status of the container.
The possible values are:

- 0: success - the container is healthy and ready for use
- 1: unhealthy - the container is not working correctly
- 2: starting - the container is not ready for use yet, but is working correctly

If the probe returns 2 ("starting") when the container has already moved out of the
"starting" state then it is treated as "unhealthy" instead.

For example, to check every five minutes or so that a web-server is able to
serve the site's main page within three seconds:

    HEALTHCHECK --interval=5m --timeout=3s \
      CMD curl -f http://localhost/ || exit 1

To help debug failing probes, any output text (UTF-8 encoded) that the command writes
on stdout or stderr will be stored in the health status and can be queried with
`docker inspect`. Such output should be kept short (only the first 4096 bytes
are stored currently).

When the health status of a container changes, a `health_status` event is
generated with the new status. The health status is also displayed in the
`docker ps` output.

Signed-off-by: Thomas Leonard <thomas.leonard@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-06-02 23:58:34 +02:00
Vincent Demeester
eb9274844e Merge pull request #23140 from Microsoft/HcsshimRevendor
Revendor hcsshim
2016-06-02 22:09:19 +02:00
allencloud
c1be45fa38 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-06-02 17:17:22 +08:00
Alexander Morozov
28676fc04b Merge pull request #22769 from dnephin/integrate_cobra
Use spf13/cobra for the cli
2016-06-01 14:18:23 -07:00
Yong Tang
4455ec14b8 Remove deprecated -f flag on docker tag
The -f flag on docker tag has been deprecated in docker 1.10 and
is expected to be removed in docker 1.12.

This fix removed the -f flag on docker tag and also updated
deprecated.md.

NOTE: A separate pull request for engine-api has been opened to
cover the related changes.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-01 09:44:25 -07:00
Shijiang Wei
0a8386c8be remove deprecated feature of passing HostConfig at API container start
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2016-06-01 22:25:17 +08:00
Daniel Nephin
fc5a4514fb Use Args in cobra.Command to validate args.
Also re-use context.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-05-31 15:43:16 -07:00
Darren Stahl
d96e36cbbf Revendor hcsshim
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-05-31 14:42:01 -07:00
Daniel Nephin
667dcb0e8e Update usage and help to (almost) match the existing docker behaviour
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-05-31 14:41:37 -07:00
Vincent Demeester
edcc9577bf Merge pull request #22103 from coolljt0725/fix_22093
Fix docker create with duplicate volume failed to remove
2016-05-30 15:57:13 +02:00
Shijiang Wei
f80bfdf85c make the error message in TestRunSeccompDefaultProfile more precise
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2016-05-28 09:06:25 +08:00
Justin Cormack
cfca3255a8 Split the Seccomp tests into two
The Seccomp tests ran 11 tests in parallel and this appears to be
hitting some sort of bug on CI. Splitting into two tests means that
I can no longer repeoduce the failure on the slow laptop where I could
reproduce the failures before.

Obviously this does not fix the underlying issue, which I will
continue to investigate, but not having the tests failing a lot
before the freeze for 1.12 would be rather helpful.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-05-27 15:38:29 -07:00
Sebastiaan van Stijn
4441a6c4c6 Merge pull request #22716 from jmzwcn/issue22466-patches
Embedded DNS problem after renaming container. Step2:change in docker…
2016-05-27 23:27:42 +02:00
Arnaud Porterie
fd7ec4b9e5 Merge pull request #22912 from duglin/FixImportTest
Fix docker import test
2016-05-27 14:03:44 -07:00
Brian Goff
ec3ccde18b Merge pull request #22438 from yongtang/22420-inconsistent-tmpfs-behavior
Inconsistent --tmpfs behavior
2016-05-27 15:54:37 -04:00
Alexander Morozov
01409bf069 Merge pull request #22376 from vdemeester/use-dockerd-in-integration-cli
Use dockerd instead of docker daemon in integration-cli
2016-05-27 10:09:43 -07:00
Vincent Demeester
24d2ee8c48 Merge pull request #22984 from Microsoft/jjh/ttymessage
Better error on attach no tty
2016-05-27 16:57:36 +02:00
Yong Tang
397a6fefad Inconsistent --tmpfs behavior
This fix tries to address the issue raised in #22420. When
`--tmpfs` is specified with `/tmp`, the default value is
`rw,nosuid,nodev,noexec,relatime,size=65536k`. When `--tmpfs`
is specified with `/tmp:rw`, then the value changed to
`rw,nosuid,nodev,noexec,relatime`.

The reason for such an inconsistency is because docker tries
to add `size=65536k` option only when user provides no option.

This fix tries to address this issue by always pre-progating
`size=65536k` along with `rw,nosuid,nodev,noexec,relatime`.
If user provides a different value (e.g., `size=8192k`), it
will override the `size=65536k` anyway since the combined
options will be parsed and merged to remove any duplicates.

Additional test cases have been added to cover the changes
in this fix.

This fix fixes #22420.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-26 19:28:18 -07:00
Arnaud Porterie
8e924153e2 Merge pull request #22268 from Microsoft/jjh/continuationescape
Support platform semantic file paths through ESCAPE
2016-05-26 10:00:56 -07:00
Vincent Demeester
f87053b9c3
Use dockerd instead of docker daemon in integration-cli
Updating `integration-cli/daemon.go` to use `dockerd` instead of `docker
daemon` to start up the daemon.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-05-26 13:14:35 +02:00
Daniel Zhang
be072a8954 Embedded DNS problem after renaming container. Step2:change in docker/daemon side and add integration test
Signed-off-by: Daniel Zhang <jmzwcn@gmail.com>
2016-05-26 12:59:44 +08:00
Alessandro Boch
f198dfd856 Update port info on network connect/disconnect
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-25 17:02:50 -07:00
John Howard
f7541b00b0 Better error on attach no tty
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-05-25 13:32:48 -07:00
Sebastiaan van Stijn
0fe4417a3b Merge pull request #22908 from vdemeester/7967-since-before-image-filters
Add before and since filter to images
2016-05-25 20:15:23 +02:00
David Calavera
60abc96acf Merge pull request #22943 from vdemeester/21769-fix-detach-keys
Fix escape-keys by preserving input if invalid
2016-05-25 09:53:53 -07:00
Vincent Demeester
004ce6b571 Merge pull request #22916 from duglin/FixNetTest
Fix flaky TestApiStatsNetworkStats test
2016-05-25 18:51:47 +02:00
Sebastiaan van Stijn
8c70ab803c Merge pull request #22953 from Microsoft/jjh/TestRunWorkingDirectory
Windows: Fix TestRunWorkingDirectory
2016-05-25 17:54:39 +02:00
Sebastiaan van Stijn
4d376e9cc2 Merge pull request #22960 from justincormack/seccompdefnotarm
Do not run the seccomp tests that use default.json on non x86 architectures
2016-05-25 17:20:16 +02:00
Vincent Demeester
750e16f57c
Add before and since filter to images
Add support for two now filter on the `images` command : `before` and
`since`. They work the same as the one on the `ps` command but for
images.

        $ docker images --filter before=myimage
        # display all images older than myimage
        $ docker images --filter since=myimage
        # display all images younger than myimage

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-05-25 13:49:10 +02:00
Vincent Demeester
2a4b4a8133 Merge pull request #22962 from normalfaults/b
fixed spelling error in windows.go
2016-05-25 12:21:08 +02:00
Sebastiaan van Stijn
cd159fba85 Merge pull request #22952 from tophj-ibm/multiarch_daemon_test_fix
Multi-arch: fix TestBuildOnDisabledBridgeNetworkDaemon
2016-05-25 10:19:41 +02:00
Yong Tang
90bd41a74d The option --add-host and --net=host should not be mutually exclusive.
This fix tries to address the issue raised in #21976 and allows
the options of `--add-host` and `--net=host` to work at the same time.

The documentation has been updated and additional tests have been
added to cover this change.

This fix fixes #21976.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-24 18:49:11 -07:00
Nirmal Mehta
59bb86a964 Merge branch 'master' into b 2016-05-24 21:43:45 -04:00
Nirmal Mehta
f91acbaee4 fixed spelling error in docker cli run test
Signed-off-by: Nirmal Mehta <nirmalkmehta@gmail.com>
2016-05-24 21:43:22 -04:00
Justin Cormack
75385dc216 Do not run the seccomp tests that use default.json on non x86 architectures
The generated profile that we check in is for amd64 and i386 architectures
and does not work correctly on arm as it is missing required syscalls,
and also specifies the architectures that are supported. It works on
ppc64le at the moment but better to skip the test as it is likely to
break in future.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-05-24 17:47:30 -07:00
Yong Tang
23821fe586 The option --dns, --dns-search, --dns-opt and --net=host should not be mutually exclusive.
This fix tries to address the issue raised in #21976 and allows
the options of `--dns`, `--dns-search`, `--dns-opt` and `--net=host`
to work at the same time.

The documentation has been updated and additional tests have been
added to cover this change.

This fix fixes #21976.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-24 16:03:26 -07:00
John Howard
257494bd0a Windows: Fix TestRunWorkingDirectory
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-05-24 15:13:06 -07:00
Christopher Jones
7832e2ae82 Multi-arch: fix TestBuildOnDisabledBridgeNetworkDaemon
Fixes the test by loading in the architecture specific busybox
image when the test daemon starts.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2016-05-24 16:33:49 -04:00
Alexander Morozov
38217d4353 Merge pull request #22932 from chenchun/fix_build
Fix building image  error if bridge network is disabled
2016-05-24 10:33:34 -07:00
Vincent Demeester
0fb6190243
Fix escape-keys by preserving input if invalid
Currently, using a custom detach key with an invalid sequence, eats a
part of the sequence, making it weird and difficult to enter some key
sequence.

This fixes by keeping the input read when trying to see if it's the key
sequence or not, and "writing" then is the key sequence is not the right
one, preserving the initial input.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-05-24 17:14:48 +02:00
Vincent Demeester
d76d38c7d0 Merge pull request #22590 from yongtang/22463-docker-daemon-events
Emit events for docker daemon
2016-05-24 11:05:39 +02:00
Chun Chen
a8d013495c Fix building image error if bridge network is disabled
Signed-off-by: Chun Chen <ramichen@tencent.com>
2016-05-24 16:20:26 +08:00
Alexander Morozov
d7dfe9103b Merge pull request #22541 from crosbymichael/graph-restore
Implement graph driver restore on reboot
2016-05-23 22:57:23 -07:00
Yong Tang
62014aaf9a Add filter for events emitted by docker daemon
This fix tries to cover the issue raised in #22463 by adding
filter for events emitted by docker daemon so that user could
utilize filter to receive events of interest.

Documentations have been updated for this fix.

Additional tests have been added to cover the changes in this fix.

This fix fixes #22463.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-23 19:00:47 -07:00
Yong Tang
382c152a73 Emit events for docker daemon
This fix tries to cover the issue raised in #22463 by emitting
events for docker daemon so that user could be notified by
scenarios like config reload, etc.

This fix adds the `daemon reload`, and events for docker daemon.

Additional tests have been added to cover the changes in this fix.

This fix fixes #22463.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-23 19:00:47 -07:00
Doug Davis
94d0571304 Fix flaky TestApiStatsNetworkStats test
It appears that on some systems apparmor gets in the way of libc.so.6
shared library being loaded - which means the ping fails.

To get around this if we run ping under `/lib64/ld-linux-x86-64.so.2`
then it works.  So we only do this for linux and only if the first attempt
fails. If this 2nd attempt fails then we'll show the original error to
the user for debugging.

Also s/Output/CombinedOutput/ to help debugging in the future. It didn't
show the real error msg.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-05-23 19:00:19 -07:00
Justin Cormack
3598f2e331 Fix error channel size in seccomp test
This was not changed when the additional tests were added.
It may be the reason for occasional test failures.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-05-23 18:14:55 -07:00
Michael Crosby
31e903b0e1 Remove restart test
This test is not applicable anymore now that containers are not stopped
when the daemon is restored.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-05-23 15:57:23 -07:00
Doug Davis
ac043c7db6 Fix docker import tests
For me when I run the test I see:
```
Downloading from http://nourl/bad
Importing    283 B
Untar re-exec error: exit status 1: output: unexpected EOF
```
and nothing about "dial tcp" so it appears that the output is
system dependent and therefore we can't really check it. I think
checking for non-zero exit code is sufficient so I'm removing this
string check.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-05-23 15:34:40 -07:00
Tomasz Kopczynski
cf2611f323 Reimplementing more builder integration tests as unit tests
Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
2016-05-22 01:00:57 +02:00
John Howard
e8e3dd32c5 Support platform file paths through escape
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-05-20 20:29:59 -07:00
Fabrizio Soppelsa
e009ebdf4c
Add a --filter option to docker search
The filtering is made server-side, and the following filters are
supported:

* is-official (boolean)
* is-automated (boolean)
* has-stars (integer)

Signed-off-by: Fabrizio Soppelsa <fsoppelsa@mirantis.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-05-20 13:41:28 +02:00
Sebastiaan van Stijn
0e9009bae3 Merge pull request #22554 from justincormack/seccap
Align default seccomp profile with selected capabilities
2016-05-20 12:58:28 +02:00
Nirmal Mehta
f66f5d4bdc fixed spelling error in cli pull local test
Signed-off-by: Nirmal Mehta <nirmalkmehta@gmail.com>
2016-05-19 17:52:42 -05:00
Vincent Demeester
ebeb5a0422 Merge pull request #22481 from mrunalp/pid_container
Add support for --pid=container:<id>
2016-05-19 19:00:40 +02:00
Sebastiaan van Stijn
aac6008800
fix typo in variable
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-05-18 15:26:16 +02:00
Vincent Demeester
cbc404a083 Merge pull request #22785 from runcom/fix-flaky-network
TestPsGroupPortRange: allocate less ports
2016-05-18 11:08:10 +02:00
Mrunal Patel
fb43ef649b Add support for --pid=container:<id>
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2016-05-17 13:49:05 -04:00
Antonio Murdaca
bdb354f19b TestPsGroupPortRange: allocate less ports
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-05-17 12:23:37 +02:00
Alessandro Boch
6eb2b903a3 Docker changes for libnetwork vendoring b66c038
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-16 15:04:01 -07:00
Sebastiaan van Stijn
9de21de453 Merge pull request #22462 from Microsoft/jjh/22181unittests
Windows: Reduce CLI time, move some to unit tests
2016-05-13 00:27:29 +02:00
Alexander Morozov
95872b65fb Merge pull request #22636 from sean-jc/fix-oom-killer-tests
Add the swapMemorySupport requirement to OOM tests
2016-05-12 14:41:55 -07:00
Arnaud Porterie
e9117578a7 Merge pull request #22445 from yongtang/20936-22443-concurrent-connection
Docker pull/push with max concurrency limits.
2016-05-12 08:51:28 -07:00
Vincent Demeester
84a6818b11 Merge pull request #22622 from tkopczynski/20784-builder-intg2unit-tests
Reimplement some builder integration tests as unit tests
2016-05-12 10:29:39 +02:00
Yong Tang
7368e41c07 Docker pull/push with max concurrency limits.
This fix tries to address issues raised in #20936 and #22443
where `docker pull` or `docker push` fails because of the
concurrent connection failing.
Currently, the number of maximum concurrent connections is
controlled by `maxDownloadConcurrency` and `maxUploadConcurrency`
which are hardcoded to 3 and 5 respectively. Therefore, in
situations where network connections don't support multiple
downloads/uploads, failures may encounter for `docker push`
or `docker pull`.

This fix tries changes `maxDownloadConcurrency` and
`maxUploadConcurrency` to adjustable by passing
`--max-concurrent-uploads` and `--max-concurrent-downloads` to
`docker daemon` command.

The documentation related to docker daemon has been updated.

Additional test case have been added to cover the changes in this fix.

This fix fixes #20936. This fix fixes #22443.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-11 19:44:54 -07:00
Tomasz Kopczynski
18eeb39985 Reimplementing builder integration tests as unit tests
Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
2016-05-11 22:13:39 +02:00
Justin Cormack
a01c4dc8f8 Align default seccomp profile with selected capabilities
Currently the default seccomp profile is fixed. This changes it
so that it varies depending on the Linux capabilities selected with
the --cap-add and --cap-drop options. Without this, if a user adds
privileges, eg to allow ptrace with --cap-add sys_ptrace then still
cannot actually use ptrace as it is still blocked by seccomp, so
they will probably disable seccomp or use --privileged. With this
change the syscalls that are needed for the capability are also
allowed by the seccomp profile based on the selected capabilities.

While this patch makes it easier to do things with for example
cap_sys_admin enabled, as it will now allow creating new namespaces
and use of mount, it still allows less than --cap-add cap_sys_admin
--security-opt seccomp:unconfined would have previously. It is not
recommended that users run containers with cap_sys_admin as this does
give full access to the host machine.

It also cleans up some architecture specific system calls to be
only selected when needed.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-05-11 09:30:23 +01:00
Alexander Morozov
af60a9e599 Merge pull request #22511 from crosbymichael/update-runc-containerd
Update runc and containerd deps
2016-05-10 15:06:23 -07:00
Sean Christopherson
adabb51311 Add the swapMemorySupport requirement to OOM tests
Add the swapMemorySupport requirement to all tests related to the OOM killer.  The --memory option has the subtle side effect of defaulting --memory-swap to double the value of --memory.  The OOM killer doesn't kick in until the container exhausts memory+swap, and so without the memory swap cgroup the tests will timeout due to swap being effectively unlimited.

Document the default behavior of --memory-swap in the docker run man page.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
2016-05-10 11:28:00 -07:00
Justin Terry
47ef6d7969 Adds a correct error string for network validation
Fixes the negative networking test to include the new error string
from recent Windows builds.

Signed-off-by: Justin Terry <juterry@microsoft.com>
2016-05-09 16:37:14 -07:00
Michael Crosby
6889c3276c Fix containerd proto for connection
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-05-09 15:17:10 -07:00
Brian Goff
c5e3644f03 Merge pull request #22562 from tonistiigi/fix-loopback-release
Clean loopbacks in TestDaemonNoSpaceLeftOnDeviceError
2016-05-09 13:28:08 -04:00
Alexander Morozov
fad0305ee3 Merge pull request #22574 from yongtang/05072016-remove-deprecated-trust-env
Remove deprecated Docker Content Trust ENV passphrase variables
2016-05-09 10:10:27 -07:00
Doug Davis
0687d76ab1 Err was never being returned
Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-05-08 05:51:59 -07:00
Yong Tang
1f0d5aba50 Remove deprecated Docker Content Trust ENV passphrase variables
Since 1.9, Docker Content Trust Offline key has been renamed to
Root key and the Tagging key has been renamed to Repository key.
The corresponding environment variables
`DOCKER_CONTENT_TRUST_OFFLINE_PASSPHRASE`
`DOCKER_CONTENT_TRUST_TAGGING_PASSPHRASE`
have also been deprecated and renamed to
`DOCKER_CONTENT_TRUST_ROOT_PASSPHRASE`
`DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE`

This fix removed the deprecated ENV passphrase variables for
1.12 and updated the docs.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-07 14:25:28 -07:00
Vincent Demeester
08ec3606f1 Merge pull request #21889 from cpuguy83/logscmd_add_attrs
Add support for reading logs extra attrs
2016-05-07 20:26:33 +02:00
Lei Jitang
5e5e1d7ada Fix docker create with duplicate volume failed to remove
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-05-06 22:48:02 -04:00
Brian Goff
bd9d14a07b Add support for reading logs extra attrs
The jsonlog logger currently allows specifying envs and labels that
should be propagated to the log message, however there has been no way
to read that back.

This adds a new API option to enable inserting these attrs back to the
log reader.

With timestamps, this looks like so:
```
92016-04-08T15:28:09.835913720Z foo=bar,hello=world hello
```

The extra attrs are comma separated before the log message but after
timestamps.

Without timestaps it looks like so:
```
foo=bar,hello=world hello
```

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-05-06 20:42:20 -04:00
Tonis Tiigi
47c353eb46 Clean loopbacks in TestDaemonNoSpaceLeftOnDeviceError
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-05-06 14:19:27 -07:00
John Howard
faab71701f Windows: Reduce CLI time, move some to unit tests
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-05-06 12:26:08 -07:00
Vincent Demeester
f65f4dc761 Merge pull request #22501 from michael-holzheu/22477-TestApiStatsContainerGetMemoryLimit-add-mem-cgroup-test
TestApiStatsContainerGetMemoryLimit: Add cgroup memory test
2016-05-06 09:12:27 +02:00
Brian Goff
e9bef66021 Merge pull request #21961 from yongtang/21956-docker-inspect-log-default-options
Docker inspect gave default log options even when the option is emtpy.
2016-05-05 21:02:39 -04:00
Vincent Demeester
bb125650c9 Merge pull request #21015 from cpuguy83/add_opaque_mount_id
When calling volume driver Mount, send opaque ID
2016-05-05 18:00:15 +02:00
Brian Goff
0d3d8d6416 Merge pull request #22505 from runcom/authz-load-import
integration-cli: test load/import with authz plugins
2016-05-05 11:37:20 -04:00
Vincent Demeester
378a8e7175 Merge pull request #22508 from Microsoft/jjh/arg
Windows: Support ARG in builder
2016-05-05 09:09:55 +02:00
John Howard
6b5c83bf18 Windows: Support ARG in builder
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-05-04 14:32:23 -07:00
Alexander Morozov
e4a4570369 Merge pull request #22475 from Microsoft/jjh/twoconcurrentcontainers
Reduce time for TestRunTwoConcurrentContainers
2016-05-04 12:38:13 -07:00
Michael Holzheu
8ba8189ee6 TestApiStatsContainerGetMemoryLimit: Add cgroup memory test
Currently on kernels booted without the "cgroup_enable=memory" kernel
parameter the testcase TestApiStatsContainerGetMemoryLimit fails with:

FAIL: docker_api_stats_test.go:231: TestApiStatsContainerGetMemoryLimit.pN52_github_com_docker_docker_integration_cli.DockerSuite

docker_api_stats_test.go:256:
    c.Assert(fmt.Sprintf("%d", v.MemoryStats.Limit), checker.Equals, fmt.Sprintf("%d", info.MemTotal))
... obtained string = "0"
... expected string = "33759145984"

Fix this and skip the testcase if the kernel does not support cgroup memory
limit. In that case the output would be:

SKIP: docker_api_stats_test.go:231:
TestApiStatsContainerGetMemoryLimit.pN52_github_com_docker_docker_integration_cli.DockerSuite
(Test requires an environment that supports cgroup memory limit.)

ChangeLog:
----------
v4: Move TestApiStatsContainerGetMemoryLimit to docker_api_stats_unix_test.go
v3: Use existing "memoryLimitSupport" from requirements_unix.go
v2: Move check to requirements.go

Fixes #22477

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
2016-05-04 20:46:41 +02:00
Antonio Murdaca
9613acbe5c integration-cli: test load/import with authz plugins
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-05-04 18:45:22 +02:00
John Howard
481cc6716f RunSleepingContainer consistency
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-05-03 11:39:29 -07:00
John Howard
94f1e574b6 Reduce time for TestRunTwoConcurrentContainers
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-05-03 10:55:20 -07:00
Yong Tang
4b5404f15e Docker inspect gave default log options even when the option is emtpy.
This fix tries to addess the issue in #21956 where `docker inspect`
will overwrite the log config options with default option even when
the `--log-driver` is not empty and `--log-opt` is empty. In this
situation, `docker inspect` and `docker run` is different.

With the introduction of #21153, the `HostConfig` will always have
the correct log-driver and log-opt values.

However, the previous processing of `docker inspect` was not updated
after the change in #21153. This results in the incorrect behavior.

This fix addresses this issue by updating `docker inspect` to conform
to #21153 so the the behavior of `docker inspect` and `docker run` is
consistent.

A integration test has been added to cover this fix.

This fix fixes #21956. This fix is related to #21153.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-02 21:14:42 -07:00
Tonis Tiigi
641c1808e1 Move implicit pull test to use local registry
Using hub only works for amd64 platforms.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-05-02 18:14:13 -07:00
Brian Goff
75e63c942e Merge pull request #21153 from mountkin/log-validator
inherit the daemon log options when creating containers
2016-05-02 16:12:43 -04:00
Aaron Lehmann
2f6e3b0ba0 Merge pull request #22448 from twistlock/authorization_error_code
Fix authorization issue - when request is denied return forbbiden exist code (403).
2016-05-02 11:04:19 -07:00
Liron Levin
526abc00b1 Fix authorization issue - when request is denied return forbbiden exist code (403).
- Return 403 (forbidden) when request is denied in authorization flows
(including integration test)
- Fix #22428
- Close #22431

Signed-off-by: Liron Levin <liron@twistlock.com>
2016-05-02 19:14:48 +03:00
Shijiang Wei
1790980ec6 inherit the daemon log options when creating containers
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2016-05-02 23:04:04 +08:00
Vincent Demeester
54ebe42de9
Fix #22240 do not pull all the tags implicitely
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-05-01 14:46:04 +02:00
Sebastiaan van Stijn
23e418b6c9
Add "driver" filter for network ls
This add a new filter to 'docker network ls'
to allow filtering by driver-name.

Contrary to "ID" and "name" filters, this
filter only supports an *exact* match.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-04-29 16:22:26 +02:00
Brian Goff
2b6bc294fc When calling volume driver Mount, send opaque ID
This generates an ID string for calls to Mount/Unmount, allowing drivers
to differentiate between two callers of `Mount` and `Unmount`.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-04-29 09:37:02 -04:00
Sebastiaan van Stijn
bf7307558e Merge pull request #22269 from coolljt0725/skip
Skip TestBuildNotVerboseFailure if no network
2016-04-28 11:19:56 +02:00
Vincent Demeester
78eb8a5fb9 Merge pull request #21641 from yongtang/21595-discrepancy-on-hostname-validation
API/CLI discrepancy on hostname validation (#21595).
2016-04-28 09:25:13 +02:00
Lei Jitang
9ab0aa4336 Skip TestBuildNotVerboseFailure if no network
TestBuildNotVerboseFailure use a non-exist image busybox1,
it requires network connection to access to Dockerhub, skip
this test if there is no network.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-04-27 21:29:05 -04:00
Kai Qiang Wu(Kennan)
0656105710 Add load/save image event support
For every docker load and save operations, it would log related
image events.

Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2016-04-27 01:11:03 +00:00
Brian Goff
0147164cfd Merge pull request #22329 from runcom/fix-tmpfs-order
daemon: reorder mounts before setting them
2016-04-26 20:23:13 -04:00
Michael Crosby
2b97201e0c Merge pull request #22181 from Microsoft/jjh/workdir
Windows: Consistent build workdir handling
2016-04-26 16:51:09 -07:00
John Howard
0433801093 Windows: Consistent build workdir handling
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-04-26 15:32:52 -07:00
Brian Goff
4925fcbe2e Merge pull request #22324 from WeiZhang555/fix-test-case
Fix test case
2016-04-26 15:01:02 -04:00
Zhang Wei
a7eecd2b61 Fix test case
"TestRestartContainerwithRestartPolicy" contains some codes that could be
flaky, it's supposed to be fixed in #22256.

This commit removes unnecessary code, make the test case cleaner.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-04-26 19:22:48 +08:00
Antonio Murdaca
6a8ea46c67 daemon: reorder mounts before setting them
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-04-26 11:03:25 +02:00
Sebastiaan van Stijn
2fae3d2693
skip TestAuthApi if no network is available
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-04-25 20:12:36 +02:00
Aaron Lehmann
e6df098390 Merge pull request #22254 from yongtang/22244-remote-api-auth-behavior
Add default `serveraddress` value in remote API `/auth`
2016-04-25 10:15:08 -07:00
Vincent Demeester
88d1ae148c Merge pull request #22272 from yongtang/22271-relative-symlinks
Relative symlinks don't work with --device argument
2016-04-25 18:10:04 +02:00
Yong Tang
632b314b23 Relative symlinks don't work with --device argument
This fix tries to address the issue raised in #22271 where
relative symlinks don't work with --device argument.

Previously, the symlinks in --device was implemneted (#20684)
with `os.Readlink()` which does not resolve if the linked
target is a relative path. In this fix, `filepath.EvalSymlinks()`
has been used which will reolve correctly with relative
paths.

An additional test case has been added to the existing
`TestRunDeviceSymlink` to cover changes in this fix.

This fix is related to #13840 and #20684, #22271.
This fix fixes #22271.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-04-25 07:22:56 -07:00
allencloud
e78884dafd make Insecure registries uppercase like other keys in docker info
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-04-25 18:44:34 +08:00
Tibor Vass
1e9b2355e4 Merge pull request #22184 from yongtang/22036-label-set
Labels set on the command line don't override labels in Dockerfile
2016-04-24 08:37:00 -04:00
Vincent Demeester
4e5ad97f5b Merge pull request #22138 from wenchma/deprecated_since_before
Deprecated of docker ps since and before options for v1.12
2016-04-24 11:23:21 +02:00
Yong Tang
5844736c14 Labels set on the command line always override labels in Dockerfile
This fix tries to address the inconsistency in #22036 where labels
set on the command line will not override labels specified in
Dockerfile, but will override labels inherited from `FROM` images.

The fix add a LABEL with command line options at the end of the
processed Dockerfile so that command line options labels always
override the LABEL in Dockerfiles (or through `FROM`).

An integration test has been added for test cases specified in #22036.

This fix fixes #22036.

NOTE: Some changes are from #22266 (@tiborvass).

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-04-23 18:49:17 -07:00
John Howard
27f44b8af6 Merge pull request #20639 from dnephin/split_client
Split the binary into two: client and daemon
2016-04-23 14:14:20 -07:00
Yong Tang
93973196f4 Add default serveraddress value in remote API /auth
This fix tries to address the issue in #22244 where the remote
API `/auth` will not set the default value of `serveraddress`
if not provided. This behavior happens after only in 1.11.0
and is a regression as in 1.10.3 `serveraddress` will be assigned
with `IndexServer` if no value is provided.

The default value `IndexServer` is assigned to `serveraddress` if
no value provided in this fix.

An integration test `TestAuthApi` has been added to cover this change

This fix fixes #22244.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-04-22 20:00:47 -07:00
Daniel Nephin
9e7651db4d Build two binaries client and daemon.
Add a proxy to support 'docker daemon'
Fix configFile option, and remove a test that is no longer relevant.
Remove daemon build tag.
Remove DOCKER_CLIENTONLY from build scripts.

Signed-off-by: Daniel Nephin <dnephin@docker.com>

Change docker-daemon to dockerd.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-04-22 11:26:01 -04:00
Kai Qiang Wu(Kennan)
62cb06a6c1 Make cpu validation correct
There was an error in validation logic before, should use period
instead of quota, and also add check for negative
number here, if not with that, it would had cpu.cfs_period_us: invalid argument
which is not good for users.

Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2016-04-22 01:18:03 +00:00
Michael Crosby
6f67c13d20 Merge pull request #22213 from yongtang/22210-docker-http-panics
Docker http panics caused by container deletion with empty names.
2016-04-21 10:37:24 -07:00
Alexander Morozov
228759fd42 Merge pull request #22172 from cpuguy83/fix_nosapce_test
Containerize `TestDaemonNoSpaceLeftOnDeviceError`
2016-04-21 09:41:31 -07:00
Yong Tang
9d8071a74d Docker http panics caused by container deletion with empty names.
This fix tries to fix the http panics caused by container deletion
with empty names in #22210.

The issue was because when an empty string was passed, `GetByName()`
tried to access the first element of the name string without checking
the length. A length check has been added.

A test case for #22210 has been added.

This fix fixes #22210.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-04-21 07:53:49 -07:00
David Calavera
cf03e17c5c Merge pull request #22191 from mavenugo/jp
Initialize activateWait for plugins activated by json spec
2016-04-20 08:37:20 -07:00
Madhu Venugopal
de806a672b Initialize activateWait for plugins activated by json spec
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-04-20 05:59:19 -07:00
Vincent Demeester
34cc274a80 Merge pull request #21380 from sainath14/improve_help_text_test_time
Improve the time taken by DockerSuite.TestHelpTextVerify
2016-04-20 08:03:45 +02:00
Sainath Grandhi
7f33ec7507 Improve the time taken by DockerSuite.TestHelpTextVerify. This test runs docker <command> --help on all commands supported and also check the output
when it is passed with bad arguments and no arguments. This patch would divide the total number of commands into five sets and runs them in parallel.
Test time is improved from around 9 seconds to around 3 seconds

Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
2016-04-19 16:46:59 -07:00
Brian Goff
bb91bd3a89 Merge pull request #22043 from WeiZhang555/remove-start-event-failed-start
Remove start/die event when fail to start container
2016-04-19 19:45:40 -04:00
Brian Goff
59b83d8aae Containerize TestDaemonNoSpaceLeftOnDeviceError
Why? Because the `mount` here will sometimes fail when run in
`debian:jessie`, which is what the environrment hosting the test suite
is running if run from the `Makefile`.
Also, why the heck not containerize it, all the things.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-04-19 17:16:18 -04:00
Alexander Morozov
eab65e438e Merge pull request #22153 from vdemeester/update-engine-api-again
Update engine api again for CopyToContainer and versions
2016-04-19 11:05:27 -07:00
Vincent Demeester
75cc2c926b Merge pull request #21495 from HackToday/addnetworkfilter
Add network label filter support
2016-04-19 19:15:14 +02:00
Vincent Demeester
7534f17261
Update code for latest engine-api
- Update CopyToContainer uses
- Use engine-api/types/versions instead of pkg/version

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-04-19 16:56:54 +02:00
Brian Goff
8adc8c3a68 Merge pull request #21901 from mavenugo/sid
Add container's short-id as default network alias
2016-04-19 08:16:41 -04:00
Brian Goff
42a7efd691 Merge pull request #22122 from Microsoft/jjh/defaultdir
Windows: Set default directory
2016-04-19 07:27:13 -04:00
Wen Cheng Ma
91b7157064 Deprecated of docker ps since and before options for v1.12
Deprecated note https://github.com/docker/docker/blob/master/docs/deprecated.md#docker-ps-before-and-since-options

Signed-off-by: Wen Cheng Ma <wenchma@cn.ibm.com>
2016-04-19 18:13:55 +08:00
David Calavera
7fd53f7c71 Merge pull request #21657 from vdemeester/update-engine-api
Update engine api with required arguments
2016-04-18 19:47:22 -07:00
John Howard
c2d183426b Windows: Set default directory
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-04-18 15:59:41 -07:00
Madhu Venugopal
ea531f061d Add container's short-id as default network alias
link feature in docker0 bridge by default provides short-id as a
container alias. With built-in SD feature, providing a container
short-id as a network alias will fill that gap.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-04-18 14:45:16 -07:00
Kai Qiang Wu(Kennan)
f812b55692 Add network label filter support
This patch did following:

1) Make filter check logic same as `docker ps ` filters

Right now docker container logic work as following:
when same filter used like below:
 -f name=jack -f name=tom
it would get all containers name is jack or tom(it is or logic)

when different filter used like below:

 -f name=jack -f id=7d1
it would get all containers name is jack and id contains 7d1(it is and logic)

It would make sense in many user cases, but it did lack of compliate filter cases,
like "I want to get containers name is jack or id=7d1", it could work around use
(get id=7d1 containers' name and get name=jack containers, and then construct the
final containers, they could be done in user side use shell or rest API)

2) Fix one network filter bug which could include duplicate result
when use -f name=  -f id=, it would get duplicate results

3) Make id filter same as container id filter, which means match any string.
not use prefix match.

It is for consistent match logic

Closes: #21417

Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2016-04-18 00:38:48 +00:00
Doug Davis
5314296c69 Merge pull request #20835 from cpuguy83/handle_stats_client_errors
Do not remove containers from stats list on err
2016-04-16 10:20:58 +01:00
Brian Goff
19a453e6b4 Merge pull request #21939 from calavera/events_until_past
Get events until a time in the past.
2016-04-15 15:33:41 -04:00
Alexander Morozov
d2851cc7e3 Merge pull request #22050 from tophj-ibm/increase-timeout-stdin-close-test
Fix flaky test TestRunExitOnStdinClose
2016-04-15 10:46:31 -07:00
Vincent Demeester
e40e5b97c1 Merge pull request #21006 from cpuguy83/volume_inspect_meta
Allow volume drivers to provide a `Status` field
2016-04-15 18:53:39 +02:00
Tõnis Tiigi
1a14bbc61e Merge pull request #21726 from aaronlehmann/tarsum-filename-normalization
Fix build cache false positives when build context tar contains unnormalized paths
2016-04-15 09:45:26 -07:00
Brian Goff
36a1c56cf5 Allow volume drivers to provide a Status field
The `Status` field is a `map[string]interface{}` which allows the driver to pass
back low-level details about the underlying volume.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-04-15 10:56:38 -04:00
Christopher Jones
f84cabd3b8 Fix flaky test TestRunExitOnStdinClose
This test was flaky on ppc64le, where the average time to close was
around 1 second. This bumps that timeout to 60 seconds which should be
plently.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2016-04-15 09:33:51 -04:00
Vincent Demeester
b9c94b70bf
Update client code with api changes
Using new methods from engine-api, that make it clearer which element is
required when consuming the API.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-04-15 12:48:01 +02:00
Zhang Wei
5548966c37 Remove start/die event when fail to start container
If contaner start fail of (say) "command not found", the container
actually didn't start at all, we shouldn't log start and die event for
it, because that doesnt actually happen.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-04-15 13:02:34 +08:00
Aaron Lehmann
8691a77e44 Fix build cache false positives when build context tar contains unnormalized paths
If a build context tar has path names of the form 'x/./y', they will be
stored in this unnormalized form internally by tarsum. When the builder
walks the untarred directory tree and queries hashes for each relative
path, it will query paths of the form 'x/y', and they will not be found.

To correct this, have tarsum normalize path names by calling Clean.

Add a test to detect this caching false positive.

Fixes #21715

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-04-14 17:57:45 -07:00
Vincent Demeester
bc0c8828e9 Merge pull request #21172 from yongtang/20909-seccomp-in-docker-info
Show "seccomp" in docker info (#20909).
2016-04-15 01:24:54 +02:00
David Calavera
55053d3537
Get events until a time in the past.
This change allow to filter events that happened in the past
without waiting for future events. Example:

docker events --since -1h --until -30m

Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-04-14 16:22:16 -07:00
Vincent Demeester
8011228b53 Merge pull request #21634 from cpuguy83/add_beter_logging_for_TestDaemonNoSpaceleftOnDeviceError
More logs for `TestDaemonNoSpaceleftOnDeviceError`
2016-04-14 22:06:49 +02:00
Alexander Morozov
cb87b6eb6a Merge pull request #21879 from WeiZhang555/fix-kill-nonexist
Fix bug that can't kill an restarting container
2016-04-13 22:50:19 -07:00
Alexander Morozov
7cd420d63a Merge pull request #21970 from cpuguy83/use_cached_path_on_ls
Fix N+1 calling `Path()` on `volume ls`
2016-04-13 22:47:53 -07:00
Brian Goff
ff08036cc0 Do not remove containers from stats list on err
Before this patch, containers are silently removed from the stats list
on error. This patch instead will display `--` for all fields for the
container that had the error, allowing it to recover from errors.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-04-13 16:36:34 -04:00
Brian Goff
d954097c0b Merge pull request #21953 from Microsoft/jjh/containerapipostcontainerstop
Windows: Fix deamon deadlock in docker stop
2016-04-13 13:28:59 -04:00
Vincent Demeester
988508a2b5 Merge pull request #19265 from rhatdan/netsysctl
Add support for setting sysctls
2016-04-13 18:36:30 +02:00
Tibor Vass
348d902768 Merge pull request #21959 from coolljt0725/fix_21957
Fix docker load progressbar, fixes #21957
2016-04-13 00:31:27 -04:00
Lei Jitang
96d7db665b Fix docker load progressbar, fixes #21957
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-04-12 22:45:42 -04:00
John Howard
d691b4af18 Windows: Timeout TestContainerApiPostContainerStop
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-04-12 18:21:54 -07:00
Aaron Lehmann
fa4fea3233 Merge pull request #21337 from yongtang/21247-TestRunAttachFailedNoLeak
Flaky test: TestRunAttachFailedNoLeak (#21247)
2016-04-12 17:40:16 -07:00
Brian Goff
9e6b1852a7 Fix N+1 calling Path() on volume ls
Implements a `CachedPath` function on the volume plugin adapter that we
call from the volume list function instead of `Path.
If a driver does not implement `CachedPath` it will just call `Path`.

Also makes sure we store the path on Mount and remove the path on
Unmount.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-04-12 20:30:34 -04:00
Alexander Morozov
f3dcc1c462 Merge pull request #21962 from Microsoft/jjh/logssincefuturefollow
Windows: Disable flakey LogsSinceFutureFollow
2016-04-12 15:07:51 -07:00
John Howard
acaef7caaf Windows: Fix flakey LogsSinceFutureFollow
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-04-12 13:27:29 -07:00
Dan Walsh
9caf7aeefd Add support for setting sysctls
This patch will allow users to specify namespace specific "kernel parameters"
for running inside of a container.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2016-04-12 13:37:31 -04:00