Commit graph

165 commits

Author SHA1 Message Date
Alexander Morozov
e9d3e237e5 Merge pull request #10005 from estesp/fix-localhost-nameserver-cleanup
Clean up localhost resolv logic and add IPv6 support to regexp
2015-01-20 10:30:06 -08:00
Michael Crosby
7b48488c56 Merge pull request #10190 from ashahab-altiscale/9875-lxc-run-links
LXC needs stdin for container to remain up
2015-01-19 17:13:37 -08:00
Phil Estes
93d51e5e97 Clean up localhost resolv logic and add IPv6 support to regexp
Addresses #5811

This cleans up an error in the logic which removes localhost resolvers
from the host resolv.conf at container creation start time. Specifically
when the determination is made if any nameservers are left after
removing localhost resolvers, it was using a string match on the word
"nameserver", which could have been anywhere (including commented out)
leading to incorrect situations where no nameservers were left but the
default ones were not added.

This also adds some complexity to the regular expressions for finding
nameservers in general, as well as matching on localhost resolvers due
to the recent addition of IPv6 support.  Because of IPv6 support now
available in the Docker daemon, the resolvconf code is now aware of
IPv6 enable/disable state and uses that for both filter/cleaning of
nameservers as well as adding default Google DNS (IPv4 only vs. IPv4
and IPv6 if IPv6 enabled).  For all these changes, tests have been
added/strengthened to test these additional capabilities.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-01-19 19:35:55 -05:00
Jessie Frazelle
9b4cd01b21 Merge pull request #9730 from cpuguy83/9709_fix_volumes_from_missing_container
Fix volumes-from re-applying on each start
2015-01-19 14:00:53 -08:00
Abin Shahab
79f17dcf74 LXC needs stdin for container to remain up
To run shell(and not exit), lxc needs STDIN. Without STDIN open, it will exit 0.
Signed-off-by: Abin Shahab <ashahab@altiscale.com> (github: ashahab-altiscale)
2015-01-18 04:07:20 +00:00
Brian Goff
a738df0354 Fix volumes-from re-applying on each start
Fixes #9709
In cases where the volumes-from container is removed and the consuming
container is restarted, docker was trying to re-apply volumes from that
now missing container, which is uneccessary since the volumes are
already applied.

Also cleaned up the volumes-from parsing function, which was doing way more than
it should have been.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-01-17 07:14:25 -05:00
Abin Shahab
bff3509e43 SEND CAPABILITY IDS TO LXC
Sending capability ids instead of capability names ot LXC for --cap-add and --cap-drop.
Also fixed tests.

Docker-DCO-1.1-Signed-off-by: Abin Shahab <ashahab@altiscale.com> (github: ashahab-altiscale)
2015-01-17 04:01:52 +00:00
Alexander Morozov
95c0f07966 Merge pull request #10093 from crosbymichael/readonly-containers
Add --read-only for read only container rootfs
2015-01-14 15:56:51 -08:00
Michael Crosby
409407091a Add --readonly for read only container rootfs
Add a --readonly flag to allow the container's root filesystem to be
mounted as readonly.  This can be used in combination with volumes to
force a container's process to only write to locations that will be
persisted.  This is useful in many cases where the admin controls where
they would like developers to write files and error on any other
locations.

Closes #7923
Closes #8752

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-01-14 15:41:31 -08:00
Alexander Morozov
a75b02fe72 Fix format calls as suggested by vet
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-01-14 14:12:03 -08:00
Michael Crosby
37b69408f8 Merge pull request #10056 from coolljt0725/add_link_accept_ID
Add --link accept container ID
2015-01-14 12:50:10 -08:00
Jessie Frazelle
95fea08f7a Merge pull request #10072 from LK4D4/fix_mutable_net_files
Rewrite TestRunMutableNetworkFiles to avoid races
2015-01-14 11:48:46 -08:00
Jessie Frazelle
5136b11514 Merge pull request #10075 from LK4D4/test_for_maxcount
Test for restarting count
2015-01-14 09:17:02 -08:00
Lei Jitang
2292167b02 Add tests for --link
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-01-14 15:25:58 +08:00
Alexander Morozov
79d30364c9 Test for restarting count
This test is for #10058
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-01-13 20:28:44 -08:00
Michael Crosby
15e8f3fdd3 Add test for --pid=host
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-01-13 16:39:08 -08:00
Alexander Morozov
492b18ac08 Rewrite TestRunMutableNetworkFiles to avoid races
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-01-13 14:14:36 -08:00
Arnaud Porterie
9a9339d9a2 Test case for error code when exiting on OOM
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-01-12 23:16:28 -08:00
Alexander Morozov
92af1f0145 Merge pull request #9648 from estesp/9202-update-resolvconf
Update container resolv.conf when host network changes /etc/resolv.conf
2015-01-08 14:06:55 -08:00
Phil Estes
63a7ccdd23 Update container resolv.conf when host network changes /etc/resolv.conf
Only modifies non-running containers resolv.conf bind mount, and only if
the container has an unmodified resolv.conf compared to its contents at
container start time (so we don't overwrite manual/automated changes
within the container runtime). For containers which are running when
the host resolv.conf changes, the update will only be applied to the
container version of resolv.conf when the container is "bounced" down
and back up (e.g. stop/start or restart)

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-01-08 14:15:13 -05:00
Srini Brahmaroutu
2338a9cf5a add ability to publish range of ports
Closes #8899
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-01-02 23:21:26 +00:00
Alexander Morozov
e98c08a88f Rewrite TestRunNetHost to compare namespaces
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2014-12-29 13:10:30 -08:00
Alexander Morozov
74ee405a27 Fix done messages and error message for ipc tests
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2014-12-29 13:10:16 -08:00
Alexandr Morozov
732c94a502 Test for host networking
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-12-26 21:04:27 -08:00
Jessica Frazelle
98d5720594 Add test for non local mac address.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-12-26 10:22:14 -08:00
Alexander Morozov
04117e4021 Merge pull request #7003 from porjo/6034-fowardChain
Move per-container forward rules to DOCKER chain
2014-12-22 14:40:42 -08:00
Ian Bishop
0da92633b4 Create tests for pkg/iptables
Docker-DCO-1.1-Signed-off-by: Ian Bishop <ianbishop@pace7.com> (github: porjo)
2014-12-21 12:57:32 +10:00
Arnaud Porterie
f3ed42286e Enable test-integration-cli for Windows platform
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2014-12-20 16:40:40 -08:00
Michael Crosby
17cacf3326 Merge pull request #9643 from LK4D4/fix_vet_errors
Fix vet errors
2014-12-16 12:04:15 -08:00
Alexander Morozov
03bdacbb4e Fix missing logDone for TestRunMutableNetworkFiles
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2014-12-15 13:44:22 -08:00
Alexander Morozov
a7ae7fed73 Fix vet errors about formatting directives
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2014-12-12 10:58:56 -08:00
Arnaud Porterie
67e3ddb75f Forbid client piping to tty enabled container
Forbid `docker run -t` with a redirected stdin (such as `echo test |
docker run -ti busybox cat`). Forbid `docker exec -t` with a redirected
stdin. Forbid `docker attach` with a redirect stdin toward a tty enabled
container.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2014-12-09 14:30:49 -08:00
Alexandr Morozov
a00a1a1fca Try other port on any error from Map
Sometimes other programs can bind on ports from our range, so we just
skip this ports on allocation.

Fixes #9293
Probably fixes #8714

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2014-12-01 16:26:30 -08:00
Yohei Ueda
64fd3e89c7 Increase memory limit in test cases
Signed-off-by: Yohei Ueda <yohei@jp.ibm.com>
2014-11-27 03:22:16 +09:00
Erik Hollensbe
20575d20ba Break some routines out of the mutable files test for future use
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-11-25 16:46:09 -08:00
Daehyeok Mun
7fbbd515b1 remove deprecated cmd function in integration-cli
Remove deprecated cmd function in integration-cli
and change cmd to dockerCmd in all test files

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
2014-11-25 00:32:38 +09:00
Alexander Morozov
0f2de5158f Merge pull request #9261 from unclejack/fix_test_tmp_cleanup
fix cleanup of /tmp in tests
2014-11-21 08:48:04 -08:00
Doug Davis
ae9bd580af Make --tlsverify enable tls regardless of value specified
I also needed to add a mflag.IsSet() function that allows you to check
to see if a certain flag was actually specified on the cmd line.

Per #9221 - also tweaked the docs to fix a typo.

Closes #9221

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-11-20 16:09:06 -08:00
unclejack
98307c8fae integ-cli: fix cleanup in test which mounts tmpfs
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-11-20 19:37:46 +02:00
Michael Crosby
739d917d70 Merge pull request #9226 from crosbymichael/container-net-test
Add test for --net container:<id>
2014-11-19 17:57:45 -08:00
Michael Crosby
71209f7579 Add test for --net container:<id>
This adds an integration test for checking that the network namespace
fds are the same when a container joins another container's network
namespace.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-11-19 17:43:04 -08:00
Tonis Tiigi
da3d3b97eb Make sure integration-cli test clean up
Common patterns:
- Multiple images were built with same name but only one cleanup.
- Containers were deleted after images.
- Images not removed after retagging.

Signed-off-by: Tõnis Tiigi <tonistiigi@gmail.com> (github: tonistiigi)
2014-11-19 23:41:46 +02:00
Doug Davis
2facc04673 Add --log-level support
Next steps, in another PR, would be:
- make all logging go through the logrus stuff
- I'd like to see if we can remove the env var stuff (like DEBUG) but we'll see

Closes #5198

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-11-15 09:00:48 -08:00
Dan Walsh
497fc8876e Allow IPC namespace to be shared between containers or with the host
Some workloads rely on IPC for communications with other processes.  We
would like to split workloads between two container but still allow them
to communicate though shared IPC.

This patch mimics the --net code to allow --ipc=host to not split off
the IPC Namespace.  ipc=container:CONTAINERID to share ipc between containers

If you share IPC between containers, then you need to make sure SELinux labels
match.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2014-11-12 11:29:58 -05:00
Doug Davis
69a5b827dc See #8379 - if the container doesn't start I added code to make sure that if no other processing sets the container.exitCode to a non-zero value when we make sure its done before we return. I also made sure that while trying to start the CMD/ENTRYPOINT, if it fails, then we set the container.exitCode to the exitStatus from the exec().
Closes #8379

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-11-05 18:23:42 -08:00
Malte Janduda
971fc2253a enhancing set-macaddress docu
Signed-off-by: Malte Janduda <mail@janduda.net>
2014-11-03 11:43:27 +01:00
Malte Janduda
f2df38050e Adding docker-cli run param to set MAC address
Signed-off-by: Malte Janduda <mail@janduda.net>
2014-11-01 15:35:09 +01:00
Srini Brahmaroutu
fd774a818c adding support for port ranges on --expose
Closes #1834

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2014-10-31 23:06:30 +00:00
Tonis Tiigi
417e48e4a0 Generalize consumeSlow and add stop support
Signed-off-by: Tõnis Tiigi <tonistiigi@gmail.com> (github: tonistiigi)
2014-10-30 21:11:33 +02:00
Tonis Tiigi
8a81c46272 Move consumeSlow() under test utils
Signed-off-by: Tõnis Tiigi <tonistiigi@gmail.com> (github: tonistiigi)
2014-10-30 20:55:08 +02:00