summaryrefslogtreecommitdiffstats
path: root/tests/docker/dockerfiles/debian-bootstrap.docker
diff options
context:
space:
mode:
authorAlex Bennée2016-07-19 15:20:39 +0200
committerFam Zheng2016-07-20 13:19:43 +0200
commit95c975013a15405a5ab257deae843ecd2eea20ec (patch)
tree9af73b1fb7de6d2e101034bf4b38915f8eeac251 /tests/docker/dockerfiles/debian-bootstrap.docker
parenttests/docker/docker.py: check and run .pre script (diff)
downloadqemu-95c975013a15405a5ab257deae843ecd2eea20ec.tar.gz
qemu-95c975013a15405a5ab257deae843ecd2eea20ec.tar.xz
qemu-95c975013a15405a5ab257deae843ecd2eea20ec.zip
tests/docker/dockerfiles: new debian-bootstrap.docker
Together with the debian-bootstrap.pre script can now build an arbitrary architecture of Debian using debootstrap. This allows debootstrap to set up its first stage before the container is built. To build a container you need a command line like: DEB_ARCH=armhf DEB_TYPE=testing \ ./tests/docker/docker.py build \ --include-executable=arm-linux-user/qemu-arm debian:armhf \ ./tests/docker/dockerfiles/debian-bootstrap.docker Although a number of non-debian systems package the debootstrap script it is fairly portable in itself. Assuming we have some sort of fakeroot implementation we can just clone the upstream repository and use the script from there. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-id: 1468934445-32183-5-git-send-email-famz@redhat.com Signed-off-by: Fam Zheng <famz@redhat.com>
Diffstat (limited to 'tests/docker/dockerfiles/debian-bootstrap.docker')
-rw-r--r--tests/docker/dockerfiles/debian-bootstrap.docker21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/docker/dockerfiles/debian-bootstrap.docker b/tests/docker/dockerfiles/debian-bootstrap.docker
new file mode 100644
index 0000000000..3a9125e497
--- /dev/null
+++ b/tests/docker/dockerfiles/debian-bootstrap.docker
@@ -0,0 +1,21 @@
+# Create Debian Bootstrap Image
+#
+# This is intended to be pre-poluated by:
+# - a first stage debootstrap (see debian-bootstrap.pre)
+# - a native qemu-$arch that binfmt_misc will run
+FROM scratch
+
+# Add everything from the context into the container
+ADD . /
+
+# Patch all mounts as docker already has stuff set up
+RUN sed -i 's/in_target mount/echo not for docker in_target mount/g' /debootstrap/functions
+
+# Run stage 2
+RUN /debootstrap/debootstrap --second-stage
+
+# At this point we can install additional packages if we want
+# Duplicate deb line as deb-src
+RUN cat /etc/apt/sources.list | sed "s/deb/deb-src/" >> /etc/apt/sources.list
+RUN apt-get update
+RUN apt-get -y build-dep qemu