From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHvA7-000894-SD for qemu-devel@nongnu.org; Tue, 28 Jun 2016 11:42:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHvA5-0002U0-M2 for qemu-devel@nongnu.org; Tue, 28 Jun 2016 11:42:54 -0400 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:38580) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHvA5-0002Tl-FL for qemu-devel@nongnu.org; Tue, 28 Jun 2016 11:42:53 -0400 Received: by mail-wm0-x236.google.com with SMTP id r201so33913389wme.1 for ; Tue, 28 Jun 2016 08:42:53 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Tue, 28 Jun 2016 16:42:43 +0100 Message-Id: <1467128564-13476-5-git-send-email-alex.bennee@linaro.org> In-Reply-To: <1467128564-13476-1-git-send-email-alex.bennee@linaro.org> References: <1467128564-13476-1-git-send-email-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v3 4/5] tests/docker/dockerfiles: new debian-bootstrap.docker List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: famz@redhat.com, riku.voipio@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= 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 Signed-off-by: Alex Bennée --- v2 - use .pre script instead of embedded HOST_CMD - make default image include all QEMU build-deps v3 - split docker.py from introduction of bootstrap --- tests/docker/dockerfiles/debian-bootstrap.docker | 21 +++++++++++++++++++++ tests/docker/dockerfiles/debian-bootstrap.pre | 5 +++++ 2 files changed, 26 insertions(+) create mode 100644 tests/docker/dockerfiles/debian-bootstrap.docker create mode 100755 tests/docker/dockerfiles/debian-bootstrap.pre diff --git a/tests/docker/dockerfiles/debian-bootstrap.docker b/tests/docker/dockerfiles/debian-bootstrap.docker new file mode 100644 index 0000000..3a9125e --- /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 diff --git a/tests/docker/dockerfiles/debian-bootstrap.pre b/tests/docker/dockerfiles/debian-bootstrap.pre new file mode 100755 index 0000000..6f42da6 --- /dev/null +++ b/tests/docker/dockerfiles/debian-bootstrap.pre @@ -0,0 +1,5 @@ +#!/bin/sh +# +# Simple wrapper for debootstrap, run in the docker build context +# +fakeroot debootstrap --variant=buildd --foreign --arch=$DEB_ARCH $DEB_TYPE . http://httpredir.debian.org/debian -- 2.7.4