Commit graph

324 commits

Author SHA1 Message Date
Brian Goff
6c95040e3b Merge pull request #14765 from runcom/fix-dockerCmd-refactor
Refactor missed dockerCmd changes
2015-07-21 11:53:28 -04:00
Eric Windisch
80d99236c1 Move AppArmor policy to contrib & deb packaging
The automatic installation of AppArmor policies prevents the
management of custom, site-specific apparmor policies for the
default container profile. Furthermore, this change will allow
a future policy for the engine itself to be written without demanding
the engine be able to arbitrarily create and manage AppArmor policies.

- Add deb package suggests for apparmor.
- Ubuntu postinst use aa-status & fix policy path
- Add the policies to the debian packages.
- Add apparmor tests for writing proc files
Additional restrictions against modifying files in proc
are enforced by AppArmor. Ensure that AppArmor is preventing
access to these files, not simply Docker's configuration of proc.
- Remove /proc/k?mem from AA policy
The path to mem and kmem are in /dev, not /proc
and cannot be restricted successfully through AppArmor.
The device cgroup will need to be sufficient here.
- Load contrib/apparmor during integration tests
Note that this is somewhat dirty because we
cannot restore the host to its original configuration.
However, it should be noted that prior to this patch
series, the Docker daemon itself was loading apparmor
policy from within the tests, so this is no dirtier or
uglier than the status-quo.

Signed-off-by: Eric Windisch <eric@windisch.us>
2015-07-21 11:05:53 -04:00
Antonio Murdaca
bd328da555 Refactor missed dockerCmd changes
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-07-20 20:55:57 +02:00
Hu Keping
27ac154d05 CI: use dockercmd when possible
Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-07-21 04:40:15 +08:00
Qiang Huang
6f8ddec1d0 Simplify swappiness check
As suggested in https://github.com/docker/docker/pull/14004/files#r34022527

The concern there is we can't differentiate whether user explicitly
asked for an invalid value of -1 or he did not specify anything.

I don't think this would be a problem, because:
 - like all other default values like zero, we can't differentiate
   user specify it or not, most of which, zeros are also invalid, so
   default is default, we show these default values in help info,
   so users would know if they set value as default, it'll be like
   they set nothing.
 - we can't do this kind of string check in REST api request, so
   it'll make the behave different from docker command and RESTapi.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-07-20 16:10:10 +08:00
Mrunal Patel
0b7938e845 Adds test for additional groups.
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2015-07-13 14:47:28 -04:00
Raghavendra K T
921da495d2 Add the memory swappiness tuning option to docker.
Memory swappiness option takes 0-100, and helps to tune swappiness
behavior per container.
For example, When a lower value of swappiness is chosen
the container will see minimum major faults. When no value is
specified for memory-swappiness in docker UI, it is inherited from
parent cgroup. (generally 60 unless it is changed).

Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
2015-07-12 13:16:33 +05:30
Jessie Frazelle
703248da20 Merge pull request #13669 from ewindisch/readonly-proc
Make /proc, /sys, & /dev readonly for readonly containers
2015-07-10 15:32:13 -07:00
Jessie Frazelle
56e8a99b61 Merge pull request #14480 from Microsoft/fix-windows-ci
Fix Windows CI fail due to GH13866
2015-07-09 16:37:41 -07:00
John Howard
c1b524486c Fix Windows CI fail due to GH13866 and patch up tests
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-09 10:09:45 -07:00
David Calavera
3d029c3bf3 Fix volumes-from mount references.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-07-09 09:01:57 -06:00
Michael Crosby
a5283d2ff3 Merge pull request #13866 from brahmaroutu/runOOM_13766
RunOOM test should check to see if Oom Control is enabled
2015-07-07 16:21:46 -07:00
root
e7fb38410d RunOOM test should check to see if Oom Control is enabled
closes #13766
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-07-06 21:15:55 +00:00
Yuan Sun
230179c8dc add TestRunCapAddCHOWN test case
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-07-03 23:25:52 +08:00
Eric Windisch
5400d8873f Make /proc, /sys, /dev readonly for readonly containers
If a container is read-only, also set /proc, /sys,
& /dev to read-only. This should apply to both privileged and
unprivileged containers.

Note that when /dev is read-only, device files may still be
written to. This change will simply prevent the device paths
from being modified, or performing mknod of new devices within
the /dev path.

Tests are included for all cases. Also adds a test to ensure
that /dev/pts is always mounted read/write, even in the case of a
read-write rootfs. The kernel restricts writes here naturally and
bad things will happen if we mount it ro.

Signed-off-by: Eric Windisch <eric@windisch.us>
2015-07-02 19:08:00 +00:00
Peter Waller
9c2374d196 Move /nat to /pkg/nat
By convention /pkg is safe to use from outside the docker tree, for example
if you're building a docker orchestrator.

/nat currently doesn't have any dependencies outside of /pkg, so it seems
reasonable to move it there.

This rename was performed with:

```
gomvpkg -vcs_mv_cmd="git mv {{.Src}} {{.Dst}}" \
	-from github.com/docker/docker/nat \
        -to   github.com/docker/docker/pkg/nat

```

Signed-off-by: Peter Waller <p@pwaller.net>
2015-06-30 17:43:17 +01:00
Jana Radhakrishnan
9bb69f9726 Fix endpoint leave failure for --net=host mode
When a container is started with `--net=host` with
a particular name and it is subsequently destroyed,
then all subsequent creations of the container with
the same name will fail. This is because in `--net=host`
the namespace is shared i.e the host namespace so
trying to destroy the host namespace by calling
`LeaveAll` will fail and the endpoint is left with
the dangling state. So the fix is, for this mode, do
not attempt to destroy the namespace but just cleanup
the endpoint state and return.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-24 12:33:52 -07:00
Sebastiaan van Stijn
637023a5f8 Merge pull request #13502 from coolljt0725/conflict_port_and_netmode
Add --net=container with --publish --expose --publish-all error out
2015-06-15 16:25:59 +02:00
Jessica Frazelle
0adfb908a6 fix lxc build
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-06-05 09:50:30 -07:00
Zefan Li
e55649192e test: Skip TestDevicePermissions on lxc
Closes: #13641

Signed-off-by: Zefan Li <lizefan@huawei.com>
2015-06-02 10:27:54 +08:00
Phil Estes
71d960d455 Merge pull request #13557 from ewindisch/apparmor-unshare-priv
Expand unshare test to include privileged test
2015-06-01 15:43:37 -04:00
David R. Jenni
c913c9921b Fix issue #10184.
Merge user specified devices correctly with default devices.
Otherwise the user specified devices end up without permissions.

Signed-off-by: David R. Jenni <david.r.jenni@gmail.com>
2015-05-30 11:09:47 +02:00
David Calavera
a914101296 Do not require cgroups capabilities on windows to run the integration tests.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-05-29 11:42:40 -07:00
Eric Windisch
e58161fedc Expand unshare test to include privileged test
This ensures that AppArmor, not other mechanisms used
by Docker or the kernel is restricting the mount.

Signed-off-by: Eric Windisch <eric@windisch.us>
2015-05-28 16:49:48 -04:00
Jessie Frazelle
5bb6262d88 Merge pull request #13529 from hqhq/hq_skip_cgroup_test
Skip test if not have Cpu quota or Cpu period
2015-05-28 10:57:32 -07:00
Qiang Huang
34e5b6af19 Skip test if not have Cpu quota or Cpu period
Closes: #13522

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-05-28 14:59:58 +08:00
Lei Jitang
13f2aa7068 Add --net=container with --publish --publish-all --expose error out
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-05-27 15:31:06 +08:00
Jessica Frazelle
a08fb73f93 fix lxc tests unshare, they dont use our apparmor profile
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-05-26 10:31:21 -07:00
Sebastiaan van Stijn
aee9ac302d Merge pull request #13335 from jfrazelle/add-apparmor-unshare-test
add unshare apparmor profile test
2015-05-26 17:32:45 +02:00
Arnaud Porterie
bce3e761c0 Merge pull request #13161 from calavera/plugin_discovery
Proposal: Volume refactor and external volume plugins
2015-05-23 18:44:18 -07:00
Alexander Morozov
89582f9781 Merge pull request #13403 from hqhq/hq_fix_ipcmode_check
Don't check running container at create time
2015-05-23 08:32:51 -07:00
David Calavera
d592778f4a Propagate unmount events to the external volume drivers.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-05-22 16:43:34 -07:00
Qiang Huang
84aae5a226 Don't check running container at create time
We should let user create container even if the container he wants
join is not running, that check should be done at start time.

In this case, the running check is done by getIpcContainer() when
we start container.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-05-23 07:15:14 +08:00
Zhang Wei
6809fa6861 Delete "defer deleteAllContainers()" from integration-cli
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2015-05-22 17:01:52 +08:00
David Calavera
81fa9feb0c Volumes refactor and external plugin implementation.
Signed by all authors:

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: Jeff Lindsay <progrium@gmail.com>
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Signed-off-by: Luke Marsden <luke@clusterhq.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-05-21 20:34:17 -07:00
Qiang Huang
c0dd8538db Fix test failure when --net none build
Closes: #13369

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-05-22 08:21:09 +08:00
Jessica Frazelle
6f75dd85c5 add unshare apparmor profile test
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-05-20 14:06:00 -07:00
Jana Radhakrishnan
afd901e408 Fix network connectivity problem for non-root users
If a container was started with a non-root user the container
may not be able to resolve DNS names because of too restrictive
permission in the /etc/resolv.conf container file. This problem
is in how this file gets created in libnetwork and ths PR
attempts to fix the issue by vendoring in the libnetwork code
with the fix.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-20 17:51:20 +00:00
Alexander Morozov
7e5902c92d Test for two containers in --net=host
This is test for regression which was encountered during libnetwork
merging.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-05-20 09:35:28 -07:00
Lorenzo Fontana
086b514f6a Removed deleteContainer calls
Signed-off-by: Lorenzo Fontana <fontanalorenzo@me.com>
2015-05-20 08:38:23 +02:00
Jana Radhakrishnan
d18919e304 Docker integration with libnetwork
- Updated Dockerfile to satisfy libnetwork GOPATH requirements.
    - Reworked daemon to allocate network resources using libnetwork.
    - Reworked remove link code to also update network resources in libnetwork.
    - Adjusted the exec driver command population to reflect libnetwork design.
    - Adjusted the exec driver create command steps.
    - Updated a few test cases to reflect the change in design.
    - Removed the dns setup code from docker as resolv.conf is entirely managed
      in libnetwork.
    - Integrated with lxc exec driver.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-19 22:40:19 +00:00
Michael Crosby
aac645ae04 Merge pull request #13282 from duglin/RemoveBash
Remove use of 'bash' from our tests
2015-05-18 13:06:21 -07:00
Brian Goff
ccf02a9f77 Merge pull request #13279 from hqhq/hq_use_inspectfield
Use inspectField to simplify code
2015-05-18 14:53:37 -04:00
Doug Davis
3b1f73fbcd Remove use of 'bash' from our tests
Not 100% sure why our Windows test don't complain about some of these,
I'm guessing it because we have bash as part of some git package, but
either way we really shouldn't require bash to run our tests unless we
really need to - which in these cases we don't

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-18 11:29:08 -07:00
Qiang Huang
74f8a4eca4 Use inspectField to simplify code
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-05-18 10:06:13 +08:00
Lei Jitang
9a09664b51 Fix automatically publish ports without --publish-all
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-05-18 02:57:17 +08:00
Antonio Murdaca
a268e36719 Clean tests from not needed inspect call
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-16 18:12:54 +02:00
Alexander Morozov
b2ad9314a2 Merge pull request #13196 from crosbymichael/update-libocntainer-may13
Update libcontainer to a37b2a4f152e2a1c9de596f54c0
2015-05-14 10:49:25 -07:00
Sebastiaan van Stijn
ed25742002 Merge pull request #12667 from ibuildthecloud/host-uts
Add --uts=host to allow sharing the UTS namespace
2015-05-13 18:30:32 -07:00
Darren Shepherd
f2e5207fc9 Add --uts=host to allow sharing the UTS namespace
Signed-off-by: Darren Shepherd <darren@rancher.com>
2015-05-13 17:56:32 -07:00