Commit Graph

15 Commits

Author SHA1 Message Date
Alexander Larsson 56a8f21ae9 Move ListOps to utils submodule
This will be needed for later use in docker-init without a docker
dependency
2013-10-25 15:13:24 -07:00
Alexander Larsson 44429dedef Use netlink directly instead of /bin/ip in Sysinit
The sysinit code only uses /bin/ip to set a default gateway. This
is pretty easy to do via netlink directly, so we can avoid
the ip dependency.
2013-10-25 15:13:24 -07:00
Yang Bai 62af3a62f1 check return value of syscall.Chdir when changing working directory 2013-10-14 15:27:38 +08:00
jbbarth 452744cb31 Improve formatting with 'go fmt' as stated in CONTRIBUTING.md
As 'go fmt' doesn't support verifying files in multiple directories,
it's probably a good idea to run it on all '*.go' files from time to
time with something like this:

  find . -name "*.go" | xargs dirname | sort -u | xargs -n 1 echo go fmt
2013-08-27 10:05:25 +02:00
Marco Hennings 0f2a913be8 Add an option to set the working directory.
This makes it possible to simply wrap a command inside a container. This makes
it easier to use a container as an unified build environment.

Examples:

~/workspace/docker
$ docker  run  -v `pwd`:`pwd` -w `pwd` -i -t  ubuntu ls
AUTHORS		 Makefile	archive.go	   changes.go	      docker
[...]


docker  run  -v `pwd`:`pwd` -w `pwd` -i -t  ubuntu pwd
/home/marco/workspace/docker
2013-08-18 19:34:01 +02:00
Guillaume J. Charmes 9d9379e827 Remove the os.user dependency and manually lookup /etc/passwd instead 2013-07-12 10:49:47 -07:00
Elias Probst 3dbef66c4e Don't remove the container= environment variable, as it is crucial for a lot of tools to detect, whether they're run inside an LXC container or not. 2013-07-02 19:13:37 +02:00
Guillaume J. Charmes 6a99421733 Manually pass the env to docker-init instead of relying on lxc to pass it 2013-04-16 14:32:50 -07:00
Louis Opter 480ea7abb8 Use ip to setup the gateway in sysinit.go
ip from iproute2 replaces the legacy route tool which is often not
installed by default on recent Linux distributions.

The same patch has been done in network.go and is re-used here.
2013-04-10 17:40:28 -07:00
Solomon Hykes 6c3dcdded2 Clean up 'container' environment variable injected by lxc-start 2013-03-23 19:11:00 -07:00
Solomon Hykes e07b18d7a6 'docker run -e': set environment variables in a container 2013-03-22 20:36:34 -07:00
Solomon Hykes 53e17c0f1d Setup a predictable, repeatable environment for containers 2013-03-07 09:25:41 -08:00
Andrea Luzzardi df0c8fdac4 sysinit: Support for the -g (gateway) flag used in networking setup 2013-02-21 10:47:57 -08:00
Andrea Luzzardi 251a700785 Implemented support to run as a different user (through the -u flag) 2013-02-13 17:24:35 -08:00
Andrea Luzzardi 8a5cd74ac5 Implemented a self-injecting process wrapper that runs inside the container
- Before starting the container, docker injects itself inside the container by mount binding the dockerd binary into /sbin/init
- Instead of running the user process directly inside the container, we run /sbin/init targetprocess [args...]
- When docker is run as /sbin/init (e.g. argv[0] == "/sbin/init"), then its own sys init code kicks in
- The sys init code will be responsible for setting up the process environment prior to its execution (setuid, networking, ...).
- Finally, docker's sys init will exec() the container's process, thus replacing itself with the target binary (which will be running as pid 1)
2013-02-13 14:01:44 -08:00