Граф коммитов

119 Коммитов

Автор SHA1 Сообщение Дата
Michael Crosby 811d93326b Move get pid into cgroup implementation
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-05-21 21:14:07 +00:00
AnandkumarPatel 789a8f2616 use buffered channel so goroutine does not get blocked on done <- true when a timeout occurs.
Docker-DCO-1.1-Signed-off-by: Anandkumar Patel <anandkumarpatel@gmail.com> (github: anandkumarpatel)
2014-05-20 21:33:40 -07:00
Michael Crosby 83e9dc7200 Merge pull request #5755 from vieux/move_inspect_daemon
move inspect from server to daemon
2014-05-20 15:50:38 -07:00
Michael Crosby 1310243d48 Merge pull request #5946 from crosbymichael/lxc-host-net
Fix network mode for lxc 1.0
2014-05-20 14:51:33 -07:00
Michael Crosby 70d35b9d39 Merge pull request #5918 from crosbymichael/volumes-commit
Do not commit host bind mounts into image
2014-05-20 14:28:49 -07:00
Victor Vieux 603e00a3a7 move inspect from server to daemon
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-05-20 19:36:15 +00:00
Michael Crosby 0f27894094 Fix network mode for lxc 1.0
Fixes #5692

This change requires lxc 1.0+ to work and breaks lxc versions less than
1.0 for host networking.  We think that this is a find tradeoff by
bumping docker to only support lxc 1.0
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-05-20 19:10:23 +00:00
Alexander Larsson fcf2e9a910 native driver: Add required capabilities
We need SETFCAP to be able to mark files as having caps, which is
heavily used by fedora.
See https://github.com/dotcloud/docker/issues/5928

We also need SETPCAP, for instance systemd needs this to set caps
on its childen.

Both of these are safe in the sense that they can never ever
result in a process with a capability not in the bounding set of the
container.

We also add NET_BIND_SERVICE caps, to be able to bind to ports lower
than 1024.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-05-20 11:31:39 +02:00
Michael Crosby d535d98100 Don't save bind mounts in image
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-05-19 22:18:37 +00:00
Michael Crosby e454be7567 Move init volumes code to func
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-05-19 22:04:51 +00:00
Victor Vieux c12dd77090 starts by removing the name from the graph db
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-05-19 21:22:33 +00:00
Victor Vieux 40c8fc668c Merge pull request #5876 from timthelion/docs-daemon-readme
Add readme for daemon directory
2014-05-19 10:51:17 -07:00
Victor Marmol 0abad3ae22 Don't drop CAP_FOWNER in the container. Also sorts the list of allowed
capabilities.

Docker-DCO-1.1-Signed-off-by: Victor Marmol <vmarmol@google.com> (github: vmarmol)
2014-05-19 16:52:39 +00:00
Timothy b175b4dd43 Add readme for daemon directory
See issue #5873

Docker-DCO-1.1-Signed-off-by: Timothy <timothyhobbs@seznam.cz> (github: https://github.com/timthelion)
2014-05-17 17:56:02 +00:00
Victor Marmol 92614928ce Make libcontainer's CapabilitiesMask into a []string (Capabilities).
Docker-DCO-1.1-Signed-off-by: Victor Marmol <vmarmol@google.com> (github: vmarmol)
2014-05-17 00:44:10 +00:00
Victor Marmol 01d10d6f13 Merge pull request #5810 from vmarmol/drop-caps
Change libcontainer to drop all capabilities by default.
2014-05-16 11:51:41 -07:00
Michael Crosby dbd6f10b3d Merge pull request #5842 from alexlarsson/dm-cleanup-tests
devicemapper: Remove non-general tests
2014-05-16 11:08:04 -07:00
Alexander Larsson 39d244a593 devmapper: Remove sys.go mocking framework
This is no longer needed, as the tests are gone.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-05-16 14:12:56 +02:00
Timothy Hobbs 408f050d64 Typo in execdrivers.go five => give
Docker-DCO-1.1-Signed-off-by: Timothy Hobbs <timothyhobbs@seznam.cz> (github: timthelion)
2014-05-16 11:45:20 +00:00
Alexander Larsson bd6fd25dfb devicemapper: Remove non-general tests
Now that we have the generic graphtest tests that actually tests
the driver we can remove the old mock-using tests. Almost all of
these tests were disabled anyway, and the four remaining ones
didn't really test much while at the same time being really
fragile and making the rest of the code more complex due to
the mocking setup.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-05-16 12:46:28 +02:00
Victor Marmol 9d6875d19d Change libcontainer to drop all capabilities by default. Only keeps
those that were specified in the config. This commit also explicitly
adds a set of capabilities that we were silently not dropping and were
assumed by the tests.

Docker-DCO-1.1-Signed-off-by: Victor Marmol <vmarmol@google.com> (github: vmarmol)
2014-05-16 00:57:58 +00:00
Michael Crosby 08a7bcf5db Merge pull request #5497 from alexlarsson/generic-driver-tests
graphdriver: Add generic test framework for graph drivers
2014-05-15 17:21:09 -07:00
Michael Crosby 3b7a19def6 Move cgroups package into libcontainer
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-05-14 15:21:44 -07:00
Guillaume J. Charmes 17a1f470ae Merge pull request #5783 from LK4D4/fix_duplicate_ip_allocation_#5729
Fix duplicate ip allocation
2014-05-14 13:32:27 -07:00
Michael Crosby 4af465fccf Merge pull request #5720 from cyphar/5656-cp-absolute-paths
Ensure `docker cp` cannot traverse outside container rootfs
2014-05-14 11:46:11 -07:00
Victor Vieux d066ceaa4f Merge pull request #5752 from crosbymichael/fix-port-mapping-ps
Fix port mapping in ps display for public and private
2014-05-14 11:36:23 -07:00
Victor Vieux bc22c9948c Merge pull request #5756 from crosbymichael/move-units-to-pkg
Move duration and size to units pkg
2014-05-14 11:36:14 -07:00
Michael Crosby de406b69f3 Merge pull request #5798 from unclejack/fix_startup_speed
don't update Suffixarray for every Register during startup
2014-05-14 11:13:02 -07:00
unclejack fc82199d4f Merge pull request #5758 from crosbymichael/add-cpuset
Add cpuset cpus support for docker
2014-05-14 20:57:12 +03:00
unclejack 5d5c89398c update Suffixarray only once during daemon startup
This commit makes the Docker daemon call UpdateSuffixarray only after
it finishes registering all containers.

This lowers the amount of time required for the Docker daemon to start
up.

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-05-14 17:58:37 +03:00
unclejack e963179c79 don't call sort for every add in history
This moves the call to sort in daemon/history to a function to be
called explicitly when we're done adding elements to the list.

This speeds up `docker ps`.

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-05-14 15:02:02 +03:00
Alexandr Morozov 80fca061e7 Change ip allocation logic
Now IP reuses only after all IPs from network was allocated
Fixes #5729

Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-05-14 06:43:10 +04:00
Michael Crosby adbe3096e8 Add cpuset cpus support for docker
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-05-13 18:17:12 -07:00
cyphar 0fb507dc23 daemon: *: refactored container resource path generation
This patch is a preventative patch, it fixes possible future
vulnerabilities regarding unsantised paths. Due to several recent
vulnerabilities, wherein the docker daemon could be fooled into
accessing data from the host (rather than a container), this patch
was created to try and mitigate future possible vulnerabilities in
the same vein.

Docker-DCO-1.1-Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)
2014-05-14 11:15:50 +10:00
cyphar bfc3a4192a daemon: container: ensure cp cannot traverse outside container rootfs
This patch fixes the bug that allowed cp to copy files outside of
the containers rootfs, by passing a relative path (such as
../../../../../../../../etc/shadow). This is fixed by first converting
the path to an absolute path (relative to /) and then appending it
to the container's rootfs before continuing.

Docker-DCO-1.1-Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)
2014-05-14 11:14:59 +10:00
Michael Crosby ca040b1a37 Update code to handle new path to Follow Symlink func
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-05-13 10:54:08 -07:00
unclejack f1eabe436a Merge pull request #5655 from alexlarsson/mount-run-dir
Always mount a /run tmpfs in the container
2014-05-13 11:51:14 +03:00
Victor Vieux 100a92146e move RegisterLinks to daemon
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-05-13 00:54:46 +00:00
Michael Crosby d33b4655c4 Move duration and size to units pkg
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-05-12 17:05:07 -07:00
Michael Crosby d54dec4d8b Fix port mapping in ps display for public and private
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-05-12 15:26:23 -07:00
Guillaume J. Charmes bc77ec2b17 Merge pull request #5717 from philips/mkdir-in-daemon
fix(daemon): ensure the /var/lib/docker dir exists
2014-05-12 14:13:56 -07:00
Alexander Larsson 905795ece6 Always mount a /run tmpfs in the container
All modern distros set up /run to be a tmpfs, see for instance:
https://wiki.debian.org/ReleaseGoals/RunDirectory

Its a very useful place to store pid-files, sockets and other things
that only live at runtime and that should not be stored in the image.

This is also useful when running systemd inside a container, as it
will try to mount /run if not already mounted, which will fail for
non-privileged container.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-05-12 21:41:04 +02:00
Michael Crosby 243eaac8b6 Merge pull request #5724 from tutumcloud/5718-lxcbugfix
Fix bug on LXC container start. Fixes #5718
2014-05-12 12:14:57 -07:00
Fernando 752c57ae56 Fix bug on LXC container start. Fixes #5718
Docker-DCO-1.1-Signed-off-by: Fernando Mayo <fernando@tutum.co> (github: fermayo)
2014-05-10 18:05:02 -04:00
Brandon Philips b4ccd7cbfb fix(daemon): ensure the /var/lib/docker dir exists
The btrfs driver attempts to stat the /var/lib/docker directory to
ensure it exists. If it doesn't exist then it bails with an unhelpful
log line:

```
2014/05/10 00:51:30 no such file or directory
```

In 0.10 the directory was created but quickly digging through the logs I
can't tell what sort of re-ordering of code caused this regression.

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
2014-05-09 18:09:26 -07:00
Alexander Larsson 55cd7dd7f9 grapdriver: Skip tests on non-supported backends
For now this means the btrfs backend is skipped when run
inside make test. You can however run it manually if you want.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-05-09 14:48:39 +02:00
Alexander Larsson 4bdb8c03fc graphdriver: Fail initialization if supported but got error
If a graphdriver fails initialization due to ErrNotSupported we ignore
that and keep trying the next. But if some driver has a different
error (for instance if you specified an unknown option for it) we fail
the daemon startup, printing the error, rather than falling back to an
unexected driver (typically vfs) which may not match what you have run
earlier.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-05-09 14:48:39 +02:00
Alexander Larsson 27744062aa graphdriver: Add generic test framework for graph drivers
This adds daemon/graphdriver/graphtest/graphtest which has a few
generic tests for all graph drivers, and then uses these
from the btrs, devicemapper and vfs backends.

I've not yet added the aufs backend, because i can't test that here
atm. It should work though.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-05-09 14:48:39 +02:00
Alexander Larsson 84f19a09ac vfs graphdriver: Make root dir mode 755
This matches the other backends.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-05-09 14:48:38 +02:00
Alexander Larsson 47c79870ea devmapper: Properly restore mocked functions after test
Currently the tests that mocks or denies functions leave this state
around for the next test. This is no good if we want to actually
test the devicemapper code in later tests.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-05-09 14:48:38 +02:00