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

440 Коммитов

Автор SHA1 Сообщение Дата
Guillaume J. Charmes a3bc3bb8c3 Merge pull request #4159 from crosbymichael/move-volumes
Move volumes out of container.go and into volumes.go
2014-02-17 16:43:20 -08:00
Guillaume J. Charmes e9db157bee Merge pull request #4162 from crosbymichael/movelinks
Move links functionality into pkg
2014-02-17 16:34:47 -08:00
Alexander Larsson ab0f3f86c8 Avoid temporarily unmounting the container when restarting it
Stopping the container will typicall cause it to unmount, to keep it mounted
over the stop/start cycle we aquire a temporary reference to it during this time.

This helps with https://github.com/dotcloud/docker/issues/4036

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-02-17 16:10:54 +01:00
Michael Crosby 147b09fae9 Move links to sub pkg
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-14 18:18:16 -08:00
Michael Crosby fc952e0de9 Remove container dependency for links
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-14 18:07:33 -08:00
Michael Crosby bd54d40f68 Move volumes out of container.go and into volumes.go
This helps clean up the container file and move volumes into
one location.  We currently cannot move volumes to a sub pkg
because they depend on Container and also modify fields on the
container.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-14 17:15:40 -08:00
Alexander Larsson f198ee525a Properly close archives
All archive that are created from somewhere generally have to be closed, because
at some point there is a file or a pipe or something that backs them. So, we
make archive.Archive a ReadCloser. However, code consuming archives does not
typically close them so we add an archive.ArchiveReader and use that when we're
only reading.

We then change all the Tar/Archive places to create ReadClosers, and to properly
close them everywhere.

As an added bonus we can use ReadCloserWrapper rather than EofReader in several places,
which is good as EofReader doesn't always work right. For instance, many compression
schemes like gzip knows it is EOF before having read the EOF from the stream, so the
EofCloser never sees an EOF.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-02-14 13:46:17 +01:00
Guillaume J. Charmes 408ea0771a
Mount-bind the PTY as container console - allow for tmux/screen to run
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-02-13 17:23:09 -08:00
unclejack c6edac9a1a Merge pull request #4073 from crosbymichael/fix-docker-cp-close
Ensure docker cp stream is closed properly
2014-02-13 14:12:53 +02:00
Solomon Hykes 6393c38339 Move the canonical run configuration objects to a sub-package
* Config is now runconfig.Config
    * HostConfig is now runconfig.HostConfig
    * MergeConfig is now runconfig.Merge
    * CompareConfig is now runconfig.Compare
    * ParseRun is now runconfig.Parse
    * ContainerConfigFromJob is now runconfig.ContainerConfigFromJob
    * ContainerHostConfigFromJob is now runconfig.ContainerHostConfigFromJob

This facilitates refactoring commands.go and shrinks the core.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-02-11 20:18:46 -08:00
Solomon Hykes 3ecd8ff0c8 New package `nat`: utilities for manipulating the text description of network ports.
This facilitates the refactoring of commands.go

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-02-11 16:51:01 -08:00
Michael Crosby 35821ad78f Ensure docker cp stream is closes properly
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-11 06:21:53 -08:00
Solomon Hykes 9f994c9646 New build instruction: ONBUILD defines a trigger to execute when extending an image with a new build
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-02-04 01:31:19 +00:00
Michael Crosby 02fdc194fc Fix unmounts out of container export funcs
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-03 16:14:16 -08:00
Michael Crosby 1d4de9ce1f Fix port mapping unit tests
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-31 12:04:44 -08:00
Michael Crosby 167403988d Move network aspect of links into driver as a job
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-31 12:04:44 -08:00
Michael Crosby 2df0166107 Implement requesting the name ip
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-31 12:04:44 -08:00
Michael Crosby 49b9813035 Fix integration tests
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-31 12:04:44 -08:00
Michael Crosby 2d8709696c Fix sending []byte in job env
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-31 12:04:44 -08:00
Michael Crosby c712e74b45 Update core calls to network drivers
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-31 12:04:44 -08:00
Michael Crosby 53ee1daa69 Merge pull request #3841 from alexlarsson/separate-base-fs
Separate out graphdriver mount and container root
2014-01-31 11:49:14 -08:00
Victor Vieux 9261511aa5 refactor all *FromJob functions
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-30 20:45:32 +00:00
Alexander Larsson fab19d197c Separate out graphdriver mount and container root
This separates out the directory as returned from the graphdriver (the
"base" fs) from the root filesystem of the live container. This is
necessary as the "diff" operation needs access to the base filesystem
without all the mounts that the running container needs (/.dockerinit,
volumes, etc).

We change container in the following way:

Container.RootfsPath() returns the the directory which will be used as
the root in a running container. It is always of the form
"/var/lib/docker/container/<id>/root" and is a private bind mount to
the base filesystem. It is only available while the container is running.

Container.BasefsPath() returns the raw directory from the graph driver
without the container runtime mounts. It is availible whenever the
container is mounted (in between a container.Mount()/Unmount() pair,
which are properly refcounted).

This fixes issue #3840

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-30 16:43:53 +01:00
Victor Vieux 187646127f fix convertion issues
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-30 00:56:42 +00:00
Peter Waller 32753c3d24 Fix for issue #3786
This is a fix for the case that one mount is inside another mount and
docker can't then delete the resulting container.

Docker-DCO-1.1-Signed-off-by: Peter Waller <p@pwaller.net> (github: pwaller)
2014-01-27 17:31:25 +00:00
Victor Vieux 5ea2986ce5 Move containers to a job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-24 16:07:42 -08:00
Victor Vieux 641005777a Merge pull request #3747 from crosbymichael/move-networking
Move IP Allocator into sub package and out of the core
2014-01-23 16:43:21 -08:00
Victor Vieux 0dd856ee7f Merge pull request #3724 from creack/extract-lxc-phase-2
Refactor process to command
2014-01-23 15:28:45 -08:00
Paul Morie 2f57eb0410 Fix typo in container.go
Docker-DCO-1.1-Signed-off-by: Paul Morie <pmorie@gmail.com> (github: pmorie)
2014-01-23 18:10:33 -05:00
Michael Crosby fccca3542b Move tests from core into ipallocator
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-23 01:31:38 -08:00
Michael Crosby 8723a8a89e Populate command in ghost state to pass to RestoreCommand
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-22 14:05:01 -08:00
Guillaume J. Charmes 75e0357d69
Populate Command self cointainer (toward Restore())
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-22 14:04:55 -08:00
Guillaume J. Charmes f61a91f50a Merge pull request #3073 from alexlarsson/refcount-driver-mounts
Refcount driver mounts
2014-01-22 11:42:17 -08:00
Michael Crosby 639d2ecd4f Merge pull request #3682 from alexlarsson/implement-tar
Implement tar in Go
2014-01-22 11:23:47 -08:00
Michael Crosby 80f128a6ea Fix die command when monitor returns
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-21 16:18:57 -08:00
Guillaume J. Charmes e56562c35e Merge pull request #3566 from tianon/fix-volume-symlinks
Fix symlink mounting issues
2014-01-21 11:37:05 -08:00
Alexander Larsson 191aa17d16 Remove container.EnsureMounted
This was deprecated already and all it did was call Mount().
The use of this was a bit confusing since we need to pair Mount/Unmount
calls which wasn't obvious with "EnsureMounted".

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-21 11:26:11 +01:00
Alexander Larsson bcaf6c2359 Add Put() to graphdriver API and use it
This makes all users of Put() have a corresponding call
to Get() which means we will be able to track whether
any particular ID is in use and if not unmount it.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-21 11:25:37 +01:00
Guillaume J. Charmes 12468f2bc8
Rename Process to Command
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-20 16:05:07 -08:00
Paul Nasrat 71c1646ba3 Don't expose cgroups via the execdriver API.
Use Resources to represent container limits rather than a cgroup specific field.

Docker-DCO-1.1-Signed-off-by: Paul Nasrat <pnasrat@gmail.com> (github: pnasrat)
2014-01-20 17:06:24 -05:00
Alexander Larsson 4fb1db7f74 archive: Remove unused features
This simplifies that code that calls out to tar by removing support
for now unused features.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-20 20:26:20 +01:00
Paul Nasrat 2553029959 Extract cgroups pkg.
Initial move before enhancing cgroups package.

Docker-DCO-1.1-Signed-off-by: Paul Nasrat <pnasrat@gmail.com> (github: pnasrat)
2014-01-20 14:15:44 -05:00
Paul Nasrat 2e094db639 Extract mount into pkg.
Mount is self contained and generic, it should be in pkg, to allow other pkg modules to use it.

Docker-DCO-1.1-Signed-off-by: Paul Nasrat <pnasrat@gmail.com> (github: pnasrat)
2014-01-20 13:59:29 -05:00
Tianon Gravi 7379a22a8d Fix symlink mounting issues by evaluating symlinks directly on the LHS of a bind-mount -v and by FollowSymlinkInScope on the RHS just before mounting
Tested successfully with variations around mounting /var/run and /var/run/docker.sock inside a "debian" container directly at /var/run/docker.sock where /var/run is a symlink to "/run" on both the host and in the container.

Fixes #3262

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-20 00:38:54 -07:00
Michael Crosby 70a5cb95b3 Move lxc template into lxc driver
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:58 -08:00
Guillaume J. Charmes 9e9f4b925b Rename Capabilities in sysinfo and move it to its own subpackage
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: crosbymichael)
2014-01-17 17:42:58 -08:00
Guillaume J. Charmes 889b4b10ae Cleanup + add Info to driver in order to have specific IsRunning()
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: crosbymichael)
2014-01-17 17:42:22 -08:00
Michael Crosby 8c9f62d037 Improve wait for lxc and driver interface
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:22 -08:00
Michael Crosby c2b602b2ac Use utils.Go to get error from monitor
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:22 -08:00
Michael Crosby f3f2456b04 Simplify chroot wait, address code review issues
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:22 -08:00