From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5wG2-0001pz-Sx for qemu-devel@nongnu.org; Thu, 26 May 2016 10:27:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5wFy-0006mM-NX for qemu-devel@nongnu.org; Thu, 26 May 2016 10:27:29 -0400 Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]:35414) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5wFy-0006m9-Fe for qemu-devel@nongnu.org; Thu, 26 May 2016 10:27:26 -0400 Received: by mail-wm0-x22f.google.com with SMTP id a136so29920168wme.0 for ; Thu, 26 May 2016 07:27:26 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Thu, 26 May 2016 15:27:41 +0100 Message-Id: <1464272863-2285-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] [RFC PATCH 0/2] Support building qemu-user powered docker test images List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: famz@redhat.com, peter.maydell@linaro.org, neil.williams@linaro.org, steve.mcintyre@linaro.org, riku.voipio@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Hi, I had a an set of scripts for setting up and running executable binaries in a $arch-linux-user powered rootfs. However it has been a while since I last used them and there was various breakage which spurred me on to a better way. As Fam has been working with Docker containers for building I investigated if we could use the docker framework to make all the chroot/bind mount stuff go away. A couple of caveats as befits an RFC: - built on top of Fam's docker series [PATCH v5 00/14] tests: Introducing docker tests - assumes binfmt_misc setup an set to /usr/bin/qemu-FOO - uses ldd to copy dynamically shared libs across - this should be OK for distro's that are multiarch safe For example to build a Debian Testing armhf distro I run: DEB_ARCH=armhf DEB_TYPE=testing \ ./tests/docker/docker.py build --qemu=qemu-arm debian:armhf \ ./tests/docker/dockerfiles/debian-bootstrap.docker This uses Fam's docker helper which now copies qemu-arm into the docker build context, loads the debian-bootstrap.docker evaluating HOST_CMD (to do the debootstrap) and then runs the build steps to make the image. I can then run the final image with something like: $ docker run -t -i --rm debian:armhf /bin/bash root@e659ddf8232c:/# uname -a Linux e659ddf8232c 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016 armv7l GNU/Linux Obviously this requires Fam's stuff to go in and needs some clean-up but is this worth pursuing? Cheers, Alex Bennée (2): tests/docker/docker.py: support --qemu option add debian-bootstrap.docker target tests/docker/docker.py | 77 +++++++++++++++++++++--- tests/docker/dockerfiles/debian-bootstrap.docker | 22 +++++++ 2 files changed, 89 insertions(+), 10 deletions(-) create mode 100644 tests/docker/dockerfiles/debian-bootstrap.docker -- 2.7.4