Commit graph

453 commits

Author SHA1 Message Date
Guillaume J. Charmes
69c69059fc Merge pull request #4327 from crosbymichael/add-libcontainer
Add native execution driver to docker and make it the default
2014-03-03 16:34:20 -08:00
Michael Crosby
b02b933c62 Don't always just append env vars, replace defaults with ones from config
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-03-01 03:46:45 -08:00
Guillaume J. Charmes
5ec6819705
Check if the command exists before dereference
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-02-28 15:39:24 -08:00
Michael Crosby
ce08083f9c Merge branch 'master' into add-libcontainer
Conflicts:
	execdriver/termconsole.go

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-26 12:55:24 -08:00
Guillaume J. Charmes
3806ff61d1
Fix exit code issue with TTY mode
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-02-25 16:50:33 -08:00
Michael Crosby
27a43692c2 Merge branch 'master' into add-libcontainer
Conflicts:
	runtime.go

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-24 20:35:12 -08:00
Tianon Gravi
b3ffc1f835 Extract our default PATH value to a constant for great reuse
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-02-22 20:01:45 -07:00
Michael Crosby
2419e63d24 Initial commit of libcontainer running docker
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-21 17:23:49 -08:00
Michael Crosby
aac702727e Move current tty and pipe impl to lxc driver
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-21 13:27:34 -08:00
Michael Crosby
8e2284aaa2 Add CloseWriters back and do an interface cast
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-21 12:52:18 -08:00
Michael Crosby
592c2f6f9a Move term creation into driver
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-21 12:42:37 -08:00
Michael Crosby
1e74287698 Change Console to Terminal
Move creation and attach to driver
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-21 12:32:14 -08:00
Michael Crosby
8c783c1c13 Move console into execdriver
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-21 11:47:53 -08:00
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