Browse code

Adapt Dockerfile to run docker tests inside docker

Solomon Hykes authored on 2013/09/07 11:19:03
Showing 2 changed files
... ...
@@ -1,5 +1,5 @@
1 1
 # This file describes the standard way to build Docker, using docker
2
-docker-version 0.4.2
2
+docker-version 0.6.1
3 3
 from	ubuntu:12.04
4 4
 maintainer	Solomon Hykes <solomon@dotcloud.com>
5 5
 # Build dependencies
... ...
@@ -23,6 +23,9 @@ run	apt-get install -y -q python-pip
23 23
 run	pip install s3cmd
24 24
 run	pip install python-magic
25 25
 run	/bin/echo -e '[default]\naccess_key=$AWS_ACCESS_KEY\nsecret_key=$AWS_SECRET_KEY\n' > /.s3cfg
26
+# Runtime dependencies
27
+run	apt-get install -y -q iptables
28
+run	apt-get install -y -q lxc
26 29
 # Download dependencies
27 30
 run	PKG=github.com/kr/pty REV=27435c699;		 git clone http://$PKG /go/src/$PKG && cd /go/src/$PKG && git checkout -f $REV
28 31
 run	PKG=github.com/gorilla/context/ REV=708054d61e5; git clone http://$PKG /go/src/$PKG && cd /go/src/$PKG && git checkout -f $REV
... ...
@@ -32,6 +35,10 @@ run	PKG=code.google.com/p/go.net/ REV=84a4013f96e0;  hg  clone http://$PKG /go/s
32 32
 # Upload docker source
33 33
 add	.       /go/src/github.com/dotcloud/docker
34 34
 run	ln -s	/go/src/github.com/dotcloud/docker /src
35
+volume	/var/lib/docker
35 36
 # Build the binary
36 37
 run	cd /go/src/github.com/dotcloud/docker && hack/release/make.sh
38
+workdir	/go/src/github.com/dotcloud/docker
39
+# Wrap all commands in the "docker-in-docker" script to allow nested containers
40
+entrypoint ["hack/dind"]
37 41
 cmd	cd /go/src/github.com/dotcloud/docker && hack/release/release.sh
38 42
old mode 100644
39 43
new mode 100755
... ...
@@ -53,4 +53,7 @@ do
53 53
 done
54 54
 popd
55 55
 
56
+# Mount /tmp
57
+mount -t tmpfs none /tmp
58
+
56 59
 exec $*