Commit graph

3489 commits

Author SHA1 Message Date
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
Alexander Morozov
d648d40ace Merge pull request #21904 from yongtang/21848-stats-connected-containers
Docker stats is not working when a container is using another container's network.
2016-04-12 10:28:05 -07:00
Rodolfo Carvalho
fee7e7c7a3 Fix a typo in hostConfig.ShmSize validation
Other places referring to the same configuration, including docs, have
the correct spelling.

Signed-off-by: Rodolfo Carvalho <rhcarvalho@gmail.com>
2016-04-12 16:45:05 +02:00
Vincent Demeester
a0e7e13766 Merge pull request #21818 from Microsoft/jjh/tp4fortests
Windows: Remove TP4 support from test code
2016-04-12 10:07:12 +02:00
John Howard
b0e24c7393 Windows: Remove TP4 support from test code
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-04-11 15:36:31 -07:00
Zhang Wei
51e42e6ee0 Fix ShouldRestart for on-failure handle
Currently if you restart docker daemon, all the containers with restart
policy `on-failure` regardless of its `RestartCount` will be started,
this will make daemon cost more extra time for restart.

This commit will stop these containers to do unnecessary start on
daemon's restart.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-04-10 15:44:47 +08:00
Zhang Wei
ffad0873c9 Add test case for stopping a restarting container
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-04-10 15:39:28 +08:00
Lei Jitang
b4664e3f86 Merge pull request #21854 from WeiZhang555/restart-failure
Fix critical bug: can't restart an restarting container
2016-04-10 11:17:19 +08:00
Yong Tang
faf2b6f7aa Docker stats is not working when a container is using another container's network.
This fix tries to fix the issue in #21848 where `docker stats` will not correctly
display the container stats in case the container reuse another container's
network stack.

The issue is that when `stats` is performed, the daemon will check for container
network setting's `SandboxID`. Unfortunately, for containers that reuse another
container's network stack (`NetworkMode.IsConnected()`), SandboxID is not assigned.
Therefore, the daemon thinks the id is invalid and remote API will never return.

This fix tries to resolve the SandboxID by iterating through connected containers
and identify the appropriate SandboxID.

A test case for `stats` remote API has been added to check if `stats` will return
within the timeout.

This fix fixes #21848.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-04-09 20:15:51 +00:00
Vincent Demeester
a01f4dc229 Merge pull request #21853 from coolljt0725/fix_stats
Fix docker stats missing mem limit
2016-04-09 13:46:58 +02:00
John Howard
f2ed337ac9 Merge pull request #21740 from mindlapse/fixErrorMsg
Improved message when pushing a non-existant image
2016-04-08 20:53:25 -07:00
John Howard
fec6cd2eb9 Merge pull request #20525 from Microsoft/sjw/update-graphdriver-create
Adding readOnly parameter to graphdriver Create method
2016-04-08 20:44:03 -07:00
Sebastiaan van Stijn
fd67c8b203 Merge pull request #21868 from anusha-ragunathan/not-exp-requirement
Add non-experimental daemon as a test requirement.
2016-04-08 17:55:16 -07:00
Sebastiaan van Stijn
eaa1e8a8c4 Merge pull request #21839 from WeiZhang555/add-start-event
Add missing "start" event back for auto-restart container
2016-04-08 17:52:22 -07:00
David Calavera
e626011bfb Merge pull request #21760 from hqhq/hq_minimum_reservation
Add minimum limit for memory reservation
2016-04-08 07:58:28 -07:00
Zhang Wei
a705e166cf Fix critical bug: can't restart a restarting container
When user try to restart a restarting container, docker client report
error: "container is already active", and container will be stopped
instead be restarted which is seriously wrong.

What's more critical is that when user try to start this container
again, it will always fail.

This error can also be reproduced with a `docker stop`+`docker start`.

And this commit will fix the bug.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-04-08 22:02:30 +08:00
Yong Tang
ee4bd806ba API/CLI discrepancy on hostname validation (#21595).
This fix tries to fix the discrepancy between API and CLI on hostname
validation. Previously, the hostname validation was handled at the
CLI interface in runconfig/opts/parse.go and return an error if the
hostname is invalid. However, if an end user use the remote API to
pass the hostname, the error will not be returned immediately.
Instead the error will only be thrown out when the container creation
fails. This creates behavior discrepancy between API and CLI.

In this fix, the hostname validation was moved to
verifyContainerSettings so the behavior will be the same for API and
CLI.

After the change, since CLI does not handle the hostname validation
any more, the previous unit tests about hostname validation on CLI
in runconfig/opts/parse_test.go has to be updated as well because
there is no validation at this stage. All those unit tests are moved
to integration test TestRunTooLongHostname so that the hostname
validation is still properly covered as before.

Note: Since the hostname validation moved to API, the error message
changes from `invalid hostname format for --hostname:` to
`invalid hostname format:` as well because `--hostname` is passed
to CLI only.

This fix fixes #21595.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-04-08 06:13:08 +00:00
Zhang Wei
fdfaaeb9aa Add missing "start" event back for auto-restart container
When container is automatically restarted based on restart policy,
docker events can't get "start" event but only get "die" event, this is
not consistent with previous behavior. This commit will add "start"
event back.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-04-08 11:40:32 +08:00
Lei Jitang
a0a6d031d7 Fix docker stats missing memory limit
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-04-07 22:09:07 -04:00
Tonis Tiigi
20390f65c4 Fix restart monitor stopping on manual restart
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-04-07 16:12:05 -07:00
Anusha Ragunathan
c7076d2670 Add non-experimental daemon as a test requirement.
For test that should be exclusively run only in regular daemon builds
and not in the experimental version, add a requirement.

Verified using TestCleanupMountsAfterDaemonKill.
- On regular daemon, the test ran.
- On experimental daemon, the test skipped.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-04-07 14:46:32 -07:00
Sebastiaan van Stijn
14015eedb1 Merge pull request #21750 from LK4D4/flaky_format_test
integration-cli: try to make TestEventsTimestampFormats less flaky
2016-04-07 13:42:17 -07:00
Vincent Demeester
07f5804899 Merge pull request #21806 from Microsoft/RemoveSymlinkTests
Stop running symlink-volume tests on Windows
2016-04-07 22:03:44 +02:00
Tonis Tiigi
0c0198a5e6 Fix flaky TestSaveLoadParents
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-04-06 21:58:47 -07:00
Alexander Morozov
3f358aeaca integration-cli: try to make TestEventsTimestampFormats less flaky
Fix #21749

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-04-06 14:31:39 -07:00
Stefan J. Wernli
ef5bfad321 Adding readOnly parameter to graphdriver Create method
Since the layer store was introduced, the level above the graphdriver
now differentiates between read/write and read-only layers.  This
distinction is useful for graphdrivers that need to take special steps
when creating a layer based on whether it is read-only or not.
Adding this parameter allows the graphdrivers to differentiate, which
in the case of the Windows graphdriver, removes our dependence on parsing
the id of the parent for "-init" in order to infer this information.

This will also set the stage for unblocking some of the layer store
unit tests in the next preview build of Windows.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2016-04-06 13:52:53 -07:00
Vincent Demeester
5709f8e422 Merge pull request #21092 from WeiZhang555/fix-21064-detach-keys
Client print error when specify wrong detach keys
2016-04-06 22:14:14 +02:00
Sebastiaan van Stijn
2bbe75cdb6 Merge pull request #21783 from vieux/fix_21772
do not trim one char from {{.Names}} each time it is used in --format
2016-04-06 13:01:22 -07:00
Victor Vieux
68ade49ada do not trim one char from {{.Names}} each time it is used in --format
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-04-06 11:04:13 -07:00
mYmNeo
ce87de21a7 fix TestCreateShrinkRootfs and TestCreateShrinkRootfs
Signed-off-by: mYmNeo <thomassong@tencent.com>
2016-04-06 12:40:20 -04:00
mYmNeo
90f512427f fix test requirement about devicemapper and not overlay
Signed-off-by: mYmNeo <thomassong@tencent.com>
2016-04-06 12:40:19 -04:00
Tibor Vass
c7cf245053 Merge pull request #21751 from tonistiigi/runc-maskedpaths
Define readonly/mask paths in spec
2016-04-06 12:16:28 -04:00
Brian Goff
e24673def2 Merge pull request #21795 from mountkin/refactor-init
refactor the init function in docker_utils.go
2016-04-06 10:39:55 -04:00
Shijiang Wei
50d5d55f56 refactor the init function in docker_utils.go
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2016-04-06 20:16:00 +08:00
John Howard
d6ab2ad36d Windows: integration-cli don't delete nat
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-04-05 19:29:43 -07:00
Qiang Huang
50a6181005 Add minimum limit for memory reservation
Kernel has no limit for memory reservation, but in different
kernel versions, the default behavior is different.

On kernel 3.13,
docker run --rm --memory-reservation 1k busybox cat /sys/fs/cgroup/memory/memory.soft_limit_in_bytes
the output would be 4096, but on kernel 4.1, the output is 0.

Since we have minimum limit for memory and kernel memory, we
can have this limit for memory reservation as well, to make
the behavior consistent.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-04-06 09:37:51 +08:00
Darren Stahl
80d6f672f5 Stop running symlink-volume tests on Windows
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-04-05 16:37:00 -07:00
Tonis Tiigi
3f81b49352 Define readonly/mask paths in spec
This vendors in new spec/runc that supports
setting readonly and masked paths in the 
configuration. Using this allows us to make an
exception for `—-privileged`.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-04-04 18:55:55 -07:00
Zhang Wei
91e5bb9541 Let client print error when speicify wrong detach keys
Fix #21064

Let client print error message explicitly when user specifies wrong
detach keys.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-04-04 15:35:55 +08:00
Dave MacDonald
e57900a269
Improved message when pushing a non-existant image
The prior error message caused confusion.  If a user attempts to push an
image up to a registry, but they misspelled (or forgot to properly tag
their image) they would see the message 'Repository does not exist', which
is not very clear and causes some to think that there might be a problem
with the registry or connectivity to it, when the problem was simply just
that an image with that tag specified does not exist locally.

Signed-off-by: Dave MacDonald <mindlapse@gmail.com>
2016-04-03 16:25:07 -04:00
Yuan Sun
16dfb38fb8 Add pause status check for --kernel-memory
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2016-04-01 10:32:46 +08:00
Sebastiaan van Stijn
4a7bd7eaef Merge pull request #20410 from tkopczynski/20236-info-insecure-registry
Add insecure registries to docker info
2016-03-31 16:39:25 -07:00
Aaron Lehmann
dd94c88376 Merge pull request #21698 from tonistiigi/fix-flaky-websocket-attach-test
Fix flaky TestGetContainersAttachWebsocket
2016-03-31 14:03:58 -07:00
Tonis Tiigi
85354fb77c Fix flaky TestGetContainersAttachWebsocket
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-03-31 11:31:48 -07:00
Antonio Murdaca
eb0f9f6641 integration-cli: add info to fatal log
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-03-31 12:38:47 +02:00
Vincent Demeester
47fa54aea3 Merge pull request #21664 from calavera/label_one_layer_images
Apply build labels to images with only a FROM tag.
2016-03-31 11:52:18 +02:00
Antonio Murdaca
60821fe288 Merge pull request #21665 from cyphar/bump-runc
vendor: bump runc to 2441732d6fcc0fb0a542671a4372e0c7bc99c19e
2016-03-31 11:38:57 +02:00
Tomasz Kopczynski
44a50abe7b Add insecure registries to docker info
Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
2016-03-31 08:27:24 +02:00
Sebastiaan van Stijn
ffee5588cd Merge pull request #21372 from anusha-ragunathan/ctrd-rebase
Update mount state of live containers after a daemon crash.
2016-03-30 23:10:04 -07:00
Brian Goff
81d9eaa27e Merge pull request #21600 from Microsoft/jstarks/escape_entrypoint
Windows: escape entrypoint before passing to libcontainerd
2016-03-30 18:00:32 -07:00
Aleksa Sarai
da38ac6c79 vendor: bump runc to 2441732d6fcc0fb0a542671a4372e0c7bc99c19e
Also modify an integration test that hardcoded the error string so it
uses the exported error variable from libcontainer/user.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-03-31 11:20:38 +11:00
David Calavera
1a85c8ebbe Apply build labels to images with only a FROM tag.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-03-30 17:28:13 -04:00
John Starks
86ab343c3e Windows: fix tests depending on entrypoint split behavior
Existing tests assume that the entrypoint in a docker run command will be
split into multiple arguments, which is inconsistent with Linux. Fix the
tests depending on this behavior.

Signed-off-by: John Starks <jostarks@microsoft.com>
2016-03-30 12:59:50 -07:00
Yong Tang
190654aa2e Show "seccomp" in docker info (#20909).
This pull request added a `SecurityOptions` field in the `GET /info`
output to show if there is `apparmor`, `seccomp`, or `selinux` suport.

The API changes are updated in the documentation and the update in
`GET /info` is covered by the test case in `TestInfoApi`.

This pull request fixes #20909.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-03-30 09:23:15 +00:00
Yong Tang
2d03c54388 Flaky test: TestRunAttachFailedNoLeak (#21247)
This pull request tries to diagnosis and fix the flaky test of
TestRunAttachFailedNoLeak. The test failed several times in
Docker CI but is very difficult to repeat even in CI.

This pull request first try to repeat the issue at the Jenkins
server with some diagnosis message added to the output in case
the test fails again.

Since the added ouputs will only be invoked when test fails,
it will not add any unnecessary content in normal situations.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-03-30 02:33:50 +00:00
Sebastiaan van Stijn
eaf138af1f Merge pull request #21598 from aaronlehmann/not-found-error
Change v1 pull 404 message to include tag
2016-03-29 17:28:12 -07:00
Brian Goff
5106c51666 More logs for TestDaemonNoSpaceleftOnDeviceError
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-03-29 15:24:05 -07:00
Anusha Ragunathan
511a70583f Update mount state of live containers after a daemon crash.
Fix unmount issues in the daemon crash and restart lifecycle, w.r.t
graph drivers. This change sets a live container RWLayer's activity
count to 1, so that the RWLayer is aware of the mount. Note that
containerd has experimental support for restore live containers.

Added/updated corresponding tests.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-03-29 14:42:43 -07:00
Aaron Lehmann
745892a7b2 Change v1 pull 404 message to include tag
The current error message is "Error: image [name] not found". This makes
sense from the perspective of the v1 pull, since we found the repository
doesn't exist over the v1 protocol. However, in the vast majority of
cases, this error will be produced by fallback situations, where we
first try to pull the tag with the v2 protocol, and then fall back the
v1 protocol, which probably isn't even supported by the server.
Including the tag in the error message makes a lot more sense since the
actual repository may exist on v2, but not the tag.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-03-29 10:04:59 -07:00
Arnaud Porterie
1da40fb4ba Merge pull request #21586 from calavera/remove_runconfig_from_routes
Remove runconfig package dependency from the API.
2016-03-29 08:40:49 -07:00
Alexander Morozov
d33480474f Merge pull request #21599 from tonistiigi/separate-daemon-exec-root
Use separate exec-root for test daemons
2016-03-29 07:52:18 -07:00
Vincent Demeester
6eb3835995 Merge pull request #21529 from LK4D4/test_exit_early
integration-cli: exit early if daemon immedately crashed
2016-03-29 09:34:17 +02:00
Vincent Demeester
e6aa40a017 Merge pull request #19367 from shishir-a412ed/rootfs_size_configurable_cli
CLI flag for docker create(run) to change block device size.
2016-03-29 08:52:54 +02:00
Tonis Tiigi
0d9b94c4c5 Use separate exec-root for test daemons
Fixes #21545

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-03-28 17:38:14 -07:00
David Calavera
3ca29823d4 Remove runconfig dependency from network routes.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-03-28 16:23:50 -04:00
David Calavera
dd7691423f Merge pull request #21566 from allencloud/upper-case-docker-info-display
upper case docker info details
2016-03-28 11:37:23 -07:00
Shishir Mahajan
b16decfccf CLI flag for docker create(run) to change block device size.
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
2016-03-28 10:05:18 -04:00
allencloud
276a20dd42 upper case docker info details
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-03-28 18:47:04 +08:00
Alexander Morozov
0f217cead8 integration-cli: exit early if daemon immedately crashed
this reduces execution of TestInfoDiscoveryInvalidAdvertise from 11s to 0.2s

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-03-27 21:57:32 -07:00
Liron Levin
3c157713b3 Extend Docker authorization with TLS user information
Currently Docker authorization framework does not use any user
information, which already available in the Docker context for TLS
connection.
The purpose of this CR is to complete the existing authz work by adding
the basic client certificate details (SUBJECT_NAME) and authentication
method (TLS) to the authz request.

We think this should be the default behavior when no extended
authorization module is specified (currently WIP under #20883).

Signed-off-by: Liron Levin <liron@twistlock.com>
2016-03-27 15:53:55 +03:00
Tonis Tiigi
f01e1c865f Disable privileged test from in user namespace
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-03-25 09:31:36 -07:00
Alexander Morozov
d7b341bc06 Merge pull request #21477 from cpuguy83/better_logging_on_integration
Better logging for errors in some tests
2016-03-25 09:16:18 -07:00
Brian Goff
42df9edc4a Better logging for errors in some tests
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-03-25 10:02:52 -04:00
Vincent Demeester
9fbe1d9917 Merge pull request #21465 from runcom/fix-test
integration-cli: fix wrong test and add log
2016-03-25 10:22:01 +01:00
Vincent Demeester
2de29fb9c2 Merge pull request #21361 from HackToday/addfilter
Add name/driver filter support for volume
2016-03-25 08:07:38 +01:00
Sebastiaan van Stijn
f3d824771a Merge pull request #21487 from tonistiigi/fix-old-dind
Fix setting cgroup permission to user/privileged devices
2016-03-24 22:56:39 -07:00
Kai Qiang Wu(Kennan)
8e9305ef94 Add name/driver filter support for volume
This change include filter `name` and `driver`,
and also update related docs to reflect that filters usage.

Closes: #21243

Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2016-03-25 01:11:17 +00:00
Madhu Venugopal
ec77c124de Add "--ipv6" flag in IT for network create when using ipv6 subnets
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-03-24 16:19:59 -07:00
Tonis Tiigi
ee61235880 Fix setting cgroup permission to user/privileged devices
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-03-24 14:16:33 -07:00
Sebastiaan van Stijn
f2847f8ab3 Merge pull request #21315 from hqhq/hq_check_quota
Add validation for cpu period and quota
2016-03-24 14:10:48 -07:00
Yong Tang
fa44b4e81e More descriptive error when running a container with a too long hostname (#21445)
This fix tries to fix issues encountered when running a container with a hostname
that is longer than HOST_NAME_MAX(64).

Previously, `could not synchronise with container process` was generated as the
length of the regex check was missing.

This fix covers the length check so that a hostname that is longer than
HOST_NAME_MAX(64) will be given a correct error message.

Several unit tests cases and additional integration test cases are added as well.

This fix closes #21445.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-03-24 17:42:28 +00:00
Brian Goff
57575a2695 Merge pull request #21460 from tonistiigi/exec-ulimits
Add ulimit support to libcontainerd addprocess
2016-03-24 09:38:21 -04:00
Vincent Demeester
2131558963 Merge pull request #21428 from estesp/reenable-shared-nstests-userns
Re-enable shared namespace tests for userns CI runs
2016-03-24 12:31:27 +01:00
Antonio Murdaca
e73152bf27 integration-cli: fix wrong test and add log
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-03-24 11:10:41 +01:00
Tonis Tiigi
8891afd838 Add ulimit support to libcontainerd addprocess
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-03-23 19:54:32 -07:00
Brian Goff
55bbea3751 Merge pull request #21454 from anusha-ragunathan/fix_overlay
Move layer mount refcounts to mountedLayer
2016-03-23 22:39:38 -04:00
Brian Goff
68674f739f Merge pull request #21443 from calavera/fix_network_path_issue
Fix network path issue
2016-03-23 22:27:44 -04:00
Brian Goff
65d79e3e5e Move layer mount refcounts to mountedLayer
Instead of implementing refcounts at each graphdriver, implement this in
the layer package which is what the engine actually interacts with now.
This means interacting directly with the graphdriver is no longer
explicitly safe with regard to Get/Put calls being refcounted.

In addition, with the containerd, layers may still be mounted after
a daemon restart since we will no longer explicitly kill containers when
we shutdown or startup engine.
Because of this ref counts would need to be repopulated.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-03-23 14:42:52 -07:00
Yong Tang
f154227608 Fix Docker core dumps when removing network with special characters (#21401).
This fix tries to fix Docker core dumps when removing network with special
characters. The issue is from the fact that when docker client tries to
pass the command to API, the networkID is not escaped in case of special
characters. This also means other commands (not just `docker network rm`)
may face the same issue (e.g., `docker network connect`).

This fix adds the URL path escape to properly handle it. In addition, an
integration test for network create and delete is added to cover the cases
in #21401.

This fix fixes #21401.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit f8dc5562d0)
Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-03-23 15:07:14 -04:00
Tibor Vass
bbdd34c370 test: Do not check error message from hub, it is not needed
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-03-23 14:11:44 -04:00
Phil Estes
a1d8441117 Re-enable shared namespace tests for userns CI runs
Allow --net=container and --ipc=container tests to run when user
namespaces are enabled.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2016-03-23 09:39:24 -04:00
Tibor Vass
009399dc8e Add docker- prefix to runc and containerd binaries
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-03-23 00:52:16 -04:00
Tibor Vass
694b32df51 Merge pull request #21370 from tonistiigi/expose-layer-ids
Expose RootFS in image inspect
2016-03-22 20:33:18 -04:00
Tibor Vass
7bc052ae04 Merge pull request #21411 from mlaventure/fix-unauth-to-central
Update TestPushToCentralRegistryUnauthorized to match updated hub
2016-03-22 20:31:10 -04:00
Tibor Vass
3ce494f48c Merge pull request #21367 from mlaventure/containerd-docs-cleanup
Remove unneeded references to execDriver
2016-03-22 19:40:27 -04:00
Kenfe-Mickael Laventure
37e2103e64 Update TestPushToCentralRegistryUnauthorized to match updated hub
The error message was changed from "unauthorized: access to the
requested resource is not authorized" to "unauthorized: authentication
required".

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-03-22 16:15:29 -07:00
David Calavera
506fb9810c Merge pull request #21396 from aboch/vnn
Vendoring libnetwork v0.7.0-dev.10
2016-03-22 15:09:42 -07:00
Tibor Vass
8b8fcb796f Merge pull request #21303 from riyazdf/notary-vendor-docker1.11
vendor notary for docker1.11
2016-03-22 17:57:17 -04:00
David Calavera
acaec7f67c Merge pull request #21385 from tonistiigi/load-parent-chain
Add parent references support to load/save
2016-03-22 14:07:06 -07:00
Tonis Tiigi
14dc4a7158 Expose RootFS in image inspect
Fixes #20451

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-03-22 13:49:30 -07:00
Alessandro Boch
fbdb3c3a4b Vendoring libnetwork v0.7.0-dev.10
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-03-22 12:36:21 -07:00
Tibor Vass
53d2e5e9d7 Merge pull request #21270 from ehazlett/resource-labels
Add Label support for Images (build), Networks and Volumes on Creation
2016-03-22 15:12:33 -04:00
Riyaz Faizullabhoy
ab3772f72f vendor notary for docker1.11
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-03-22 11:28:19 -07:00
Tibor Vass
de9ff4bdc0 Merge pull request #21223 from cpuguy83/add_nocp_to_vols
Add explicit flags for volume cp/no-cp
2016-03-22 13:45:12 -04:00
Evan Hazlett
fc214b4408 add label support for build, networks and volumes
build: implement --label

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

network: allow adding labels on create

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

volume: allow adding labels on create

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

add tests for build, network, volume

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

vendor: libnetwork and engine-api bump

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-03-22 11:49:06 -04:00
Vincent Demeester
666563b190 Merge pull request #21046 from cyli/use-notary-cli
Sign all first-level delegation roles when doing a trusted push
2016-03-22 07:42:21 +01:00
Tonis Tiigi
faeff5118f Add parent references support to load/save
Restores the correct parent chain relationship
between images on docker load if multiple images
have been saved.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-03-21 19:31:10 -07:00
Qiang Huang
aae4bcf773 Remove dot in suffix to avoid double dot error message
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-03-22 09:17:54 +08:00
Brian Goff
b0ac69b67e Add explicit flags for volume cp/no-cp
This allows a user to specify explicitly to enable
automatic copying of data from the container path to the volume path.
This does not change the default behavior of automatically copying, but
does allow a user to disable it at runtime.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-03-21 20:38:44 -04:00
Aaron Lehmann
c44e7a3e63 Pass upstream client's user agent through to registry on operations beyond pulls
This adds support for the passthrough on build, push, login, and search.

Revamp the integration test to cover these cases and make it more
robust.

Use backticks instead of quoted strings for backslash-heavy string
contstands.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-03-21 14:31:47 -07:00
Arnaud Porterie
278d3962a8 Merge pull request #21306 from mgoelzer/issue20001-nodeps
Pass upstream client's user agent through to registry on image pulls
2016-03-21 14:26:59 -07:00
Alexander Morozov
11b4c89087 Merge pull request #21301 from cpuguy83/cleaner_file_log
Fixes some issues with jsonfile write/read
2016-03-21 14:03:36 -07:00
Tibor Vass
3ac32cd72e Merge pull request #21106 from yongtang/20122-volume-one-character
Fix one-character directory issue in the volume option (#20122).
2016-03-21 16:41:03 -04:00
Kenfe-Mickael Laventure
8af4f89cba Remove unneeded references to execDriver
This includes:
 - updating the docs
 - removing dangling variables

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-03-21 13:06:08 -07:00
cyli
623ccc2f31 Pull, Pull-A, and Build will only pull tags from the targets role or the targets/releases role.
It will ignore tags in all other delegation roles.

Signed-off-by: cyli <cyli@twistedmatrix.com>
2016-03-21 10:56:49 -07:00
Riyaz Faizullabhoy
ca57f4e6a8 Add test for targets/releases preference when pulling
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-03-21 10:56:42 -07:00
cyli
497a58e6e4 Trusted push now adds the tag to every first level delegation role for which we have keys
and for which the tag conforms to path restrictions.

Signed-off-by: cyli <cyli@twistedmatrix.com>
2016-03-21 10:56:09 -07:00
Alexander Morozov
a05fdd6806 Merge pull request #21283 from runcom/update-test
vendor docker/distribution d06d6d3b093302c02a93153ac7b06ebc0ffd1793
2016-03-21 09:46:28 -07:00
Brian Goff
1ae9dcf97d Fixes some issues with jsonfile write/read
This cleans up some of the use of the filepoller which makes reading
significantly more robust and gives fewer changes to fallback to the
polling based watcher.
In a lot of cases, if the file was being rotated while we were adding it
to the watcher, it would return an error that the file doesn't exist and
would fallback.
In some cases this fallback could be triggered multiple times even if we
were already on the fallback/poll-based watcher.

It also fixes an open file leak caused by not closing files properly on
rotate, as well as not closing files that were read via the `tail`
function until after the log reader is completed.

Prior to the above changes, it was relatively simple to cause the log
reader to error out by having quick rotations, for example:
```
$ docker run --name test --log-opt max-size=10b --log-opt max-files=10
-d busybox sh -c 'while true; do usleep 500000; echo hello; done'
$ docker logs -f test
```
After these changes I can run this forever without error.

Another fix removes 2 `os.Stat` calls when rotating files. The stat
calls are not needed since we are just calling `os.Rename` anyway, which
will in turn also just produce the same error that `Stat` would.
These `Stat` calls were also quite expensive.
Removing these stat calls also seemed to resolve an issue causing slow
memory growth on the daemon.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-03-21 11:05:58 -04:00
Yong Tang
800a7d513d Fix one-character directory issue in the volume option (#20122).
The issue comes from the implementation of volumeSplitN() where a
driver letter (`[a-zA-Z]:`) was assumed to follow either `:`, `/`,
or `\\`.

In Windows driver letter appears in two situations:
a. `^[a-zA-Z]:` (A colon followed  by `^[a-zA-Z]:` is OK as colon is
the separator in volume option)
b. A string in the format like `\\?\C:\Windows\...` (UNC).
Therefore, a driver letter can only follow either a `:` or `\\`

This PR removes the condition of `/` before the driver letter so
that options like `-v /tmp/q:/foo` could be handled correctly. A
couple of tests has also been added.

This PR fixes #20122.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-03-21 02:55:06 +00:00
Mike Goelzer
d1502afb63 Pass upstream client's user agent through to registry on image pulls
Changes how the Engine interacts with Registry servers on image pull.
Previously, Engine sent a User-Agent string to the Registry server
that included only the Engine's version information.  This commit
appends to that string the fields from the User-Agent sent by the
client (e.g., Compose) of the Engine.  This allows Registry server
operators to understand what tools are actually generating pulls on
their registries.

Signed-off-by: Mike Goelzer <mgoelzer@docker.com>
2016-03-20 04:30:09 -07:00
Antonio Murdaca
264b5b6083 distribution: errors: do not retry if no token in response
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-03-19 12:20:14 +01:00
Antonio Murdaca
c48439af7f vendor docker/distribution d06d6d3b093302c02a93153ac7b06ebc0ffd1793
- fix and add integration tests

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-03-19 12:19:48 +01:00
Jess Frazelle
e5a3f86e44 Merge pull request #20662 from tonistiigi/containerd-integration
Containerd integration
2016-03-18 17:21:18 -07:00
Jess Frazelle
06e98f0a5c Merge pull request #21232 from calavera/consolidate_security_opts_format
Consolidate security options to use `=` as separator.
2016-03-18 16:02:38 -07:00
Tonis Tiigi
9c4570a958 Replace execdrivers with containerd implementation
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-03-18 13:38:32 -07:00
Vincent Demeester
6c6363c726 Merge pull request #21269 from mlaventure/inspect-bind-mounts
Update inspect/ps to properly handle bind mounts
2016-03-18 20:52:02 +01:00
Antonio Murdaca
a30332e705 Merge pull request #21183 from thaJeztah/fix-flaky-TestUpdateRestartPolicy
Fix flaky TestUpdateRestartPolicy on Windows
2016-03-18 17:45:05 +01:00
Yong Tang
48ccdd46ae Fix flaky test of TestRestartStoppedContainer (#21211).
This fix addressed the issue of test TestRestartStoppedContainer
in #21211. Inside the test, a `docker restart` command is
followed by a `docker logs` command. However, `docker restart`
returns immediately so there is no guarantee that `docker logs`
will wait until the restarted container completes the command
`echo foobar`.

This fix use the check of `{{.State.Running}} = false` to make
sure that the restarted container has already finished, before
invoking the `docker logs` command. The timeout is set to 20s
to make sure it passes WindowsTP4 check.

This fixes #21211.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-03-18 05:50:23 +00:00
Kenfe-Mickael Laventure
cdd7fddfec Update TestPsShowMounts to also test bind mounts
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-03-17 15:43:32 -07:00
David Calavera
cb9aeb0413 Consolidate security options to use = as separator.
All other options we have use `=` as separator, labels,
log configurations, graph configurations and so on.
We should be consistent and use `=` for the security
options too.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-03-17 13:34:42 -04:00
Arnaud Porterie
9d62c11ab5 Merge pull request #21276 from nerdalert/mcvlan-v6-ci
Remove v6 IT test for experimental macvlan driver
2016-03-17 09:50:02 -07:00
Brent Salisbury
6d43dc99e5 Remove v6 IT test for experimental macvlan driver
-Temporary until we find the source of CI/v6 issue with driver

Signed-off-by: Brent Salisbury <brent@docker.com>
2016-03-17 08:57:52 -04:00
Yong Tang
1a9f5f4c69 Fix flaky test TestRunAttachFailedNoLeak in #21247.
The issue of the flaky test is because when the second container
starts, the first container in the detached mode may have only
been created and not yet entering the running state. So the
port 8000 might be used by the second container first.

This fix added a check to make sure the first container is already
in running state, before the second container is invoked.

This fix fixes #21247.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-03-17 03:14:59 +00:00
David Calavera
f2b1b44de8 Merge pull request #21212 from runcom/wip-token-service-tests
distribution: errors: do not access the errors slice if it's empty
2016-03-16 13:44:18 -07:00
Vincent Demeester
bd97e4f95a Merge pull request #21203 from HackToday/fixfilter
Add check about filter name for containers
2016-03-16 14:30:04 +01:00
Antonio Murdaca
1b5c2e1d72 distribution: errors: do not access the errors slice if it's empty
- cherry-pick from 1.10.3 branch: 0186f4d422
- add token service test suite
- add integration test (missing in 1.10.3 branch)

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-03-16 09:00:39 +01:00
Phil Estes
2b1b235acf Merge pull request #21222 from aaronlehmann/pull-with-no-layers
Fix pulling images that contain no layers at all
2016-03-15 23:03:42 -07:00