Skip to contentSkip to conversation

docker: Improve 'host-cross' image

PATCH In review Philippe Mathieu-Daudé 3 participants 10 messages Jul 17, 2018

lore
Share & tools
lore
#0 lore raw

cover docker: Improve 'host-cross' image

Sorry I don't have a better name for this image, it is meant to cross-build for the same architecture than the host.

Due to the bad name, explicitely tagged the last 2 patches as 'RFC'.

Tested on x86_64 and aarch64, should also work on
s390x and ppc64le (per the Docker doc).

If they are volunteers for test, the command is as simple as:

  $ make docker-test-quick@debian-host-cross [V=1]

Regards,

Phil.

Philippe Mathieu-Daudé (4):
docker: Use the host architecture
docker: Improve how the virgl library is built
docker: Rename 'amd64' image as 'host-cross'
docker: Add many libraries to the 'host-cross' image

 .shippable.yml                                |  4 +-
 tests/docker/Makefile.include                 |  2 +-
 tests/docker/dockerfiles/debian-amd64.docker  | 39 ---------
 .../dockerfiles/debian-host-cross.docker      | 83 +++++++++++++++++++
 4 files changed, 86 insertions(+), 42 deletions(-)
 delete mode 100644 tests/docker/dockerfiles/debian-amd64.docker
 create mode 100644 tests/docker/dockerfiles/debian-host-cross.docker
Signature · 1 line
2.18.0
#1 lore raw

PATCH 1/4 docker: Use the host architecture

This image is badly named and not amd64 specific.

Use dpkg --print-architecture to get the host architecture.

---
 tests/docker/dockerfiles/debian-amd64.docker | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
tests/docker/dockerfiles/debian-amd64.docker +4 -2
index eb13f06ed1..3312374304 100644
@@ -30,9 +30,11 @@ RUN cd /usr/src/virglrenderer && ./autogen.sh && ./configure --with-glx --disabl
 # netmap
 RUN DEBIAN_FRONTEND=noninteractive eatmydata \
     apt-get install -y --no-install-recommends \
-        linux-headers-amd64
+        linux-headers-$(dpkg --print-architecture)
 RUN git clone https://github.com/luigirizzo/netmap.git /usr/src/netmap
-RUN cd /usr/src/netmap/LINUX && ./configure --no-drivers --no-apps --kernel-dir=$(ls -d /usr/src/linux-headers-*-amd64) && make install
+RUN cd /usr/src/netmap/LINUX && \
+    ./configure --no-drivers --no-apps --kernel-dir=$(ls -d /usr/src/linux-headers-*-$(dpkg --print-architecture)) && \
+    make install
 ENV QEMU_CONFIGURE_OPTS --enable-netmap
 
 # gcrypt
Signature · 1 line
2.18.0
Reviewed-by on v1 1/4
#2 lore raw

Re: [Qemu-devel] [PATCH 1/4] docker: Use the host architecture

Quoted 5 lines · Philippe Mathieu-Daudé

This image is badly named and not amd64 specific.

Use dpkg --print-architecture to get the host architecture.

It's like you've been reading my mind ;-)

Quoted 12 lines
---
 tests/docker/dockerfiles/debian-amd64.docker | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
tests/docker/dockerfiles/debian-amd64.docker +0 -0
index eb13f06ed1..3312374304 100644
@@ -30,9 +30,11 @@ RUN cd /usr/src/virglrenderer && ./autogen.sh && ./configure --with-glx --disabl
 # netmap
 RUN DEBIAN_FRONTEND=noninteractive eatmydata \
     apt-get install -y --no-install-recommends \

tests/docker/dockerfiles/debian-amd64.docker RUN cd /usr/src/virglrenderer && ./autogen.sh && ./configure --with-glx --disabl · line 40

Quoted 10 lines
tests/docker/dockerfiles/debian-amd64.docker +4 -2
-        linux-headers-amd64
+        linux-headers-$(dpkg --print-architecture)
 RUN git clone https://github.com/luigirizzo/netmap.git /usr/src/netmap
-RUN cd /usr/src/netmap/LINUX && ./configure --no-drivers --no-apps --kernel-dir=$(ls -d /usr/src/linux-headers-*-amd64) && make install
+RUN cd /usr/src/netmap/LINUX && \
+    ./configure --no-drivers --no-apps --kernel-dir=$(ls -d /usr/src/linux-headers-*-$(dpkg --print-architecture)) && \
+    make install
 ENV QEMU_CONFIGURE_OPTS --enable-netmap
 
 # gcrypt

--
Alex Bennée

#3 lore raw

PATCH 2/4 docker: Improve how the virgl library is built

In reply to Philippe Mathieu-Daudé

- Call autogen once in the same layer of the git repository clone,
- Disable build warnings (they are not relevant for QEMU),
- Call ldconfig once installed.

---
 tests/docker/dockerfiles/debian-amd64.docker | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
tests/docker/dockerfiles/debian-amd64.docker +6 -2
index 3312374304..d79a599a0d 100644
@@ -24,8 +24,12 @@ RUN DEBIAN_FRONTEND=noninteractive eatmydata \
         libegl1-mesa-dev \
         libepoxy-dev \
         libgbm-dev
-RUN git clone git://anongit.freedesktop.org/virglrenderer /usr/src/virglrenderer
-RUN cd /usr/src/virglrenderer && ./autogen.sh && ./configure --with-glx --disable-tests && make install
+RUN git clone git://anongit.freedesktop.org/virglrenderer /usr/src/virglrenderer && \
+    cd /usr/src/virglrenderer && ./autogen.sh
+RUN cd /usr/src/virglrenderer && \
+    CPPFLAGS=-w ./configure --with-glx --disable-tests && \
+    make install && \
+    ldconfig
 
 # netmap
 RUN DEBIAN_FRONTEND=noninteractive eatmydata \
Signature · 1 line
2.18.0
#4 lore raw

RFC PATCH 3/4 docker: Rename 'amd64' image as 'host-cross'

In reply to Philippe Mathieu-Daudé
---
 .shippable.yml                                           | 4 ++--
 tests/docker/Makefile.include                            | 2 +-
 .../{debian-amd64.docker => debian-host-cross.docker}    | 9 ++++++---
 3 files changed, 9 insertions(+), 6 deletions(-)
 rename tests/docker/dockerfiles/{debian-amd64.docker => debian-host-cross.docker} (82%)
.shippable.yml +2 -2
index f74a3de3ff..7625ba8f27 100644
@@ -5,8 +5,8 @@ env:
   global:
     - LC_ALL=C
   matrix:
-    - IMAGE=debian-amd64
-      TARGET_LIST=x86_64-softmmu,x86_64-linux-user
+    - IMAGE=debian-host-cross
+      TARGET_LIST=aarch64-softmmu,x86_64-softmmu,x86_64-linux-user
     - IMAGE=debian-win32-cross
       TARGET_LIST=arm-softmmu,i386-softmmu,lm32-softmmu
     - IMAGE=debian-win64-cross
tests/docker/Makefile.include +1 -1
index b2a7e761cc..2db4190b4c 100644
@@ -83,7 +83,7 @@ endif
 # Enforce dependencies for composite images
 docker-image-debian: docker-image-debian9
 docker-image-debian8-mxe: docker-image-debian8
-docker-image-debian-amd64: docker-image-debian9
+docker-image-debian-host-cross: docker-image-debian9
 docker-image-debian-armel-cross: docker-image-debian9
 docker-image-debian-armhf-cross: docker-image-debian9
 docker-image-debian-arm64-cross: docker-image-debian9
tests/docker/dockerfiles/debian-host-cross.docker renamed from tests/docker/dockerfiles/debian-amd64.docker +6 -3
similarity index 82%
rename from tests/docker/dockerfiles/debian-amd64.docker
rename to tests/docker/dockerfiles/debian-host-cross.docker
index d79a599a0d..17d937efc9 100644
@@ -1,8 +1,11 @@
 #
-# Docker x86_64 target
+# Docker 'host' target (same architecture than the host)
 #
-# This docker target builds on the debian Stretch base image. Further
-# libraries which are not widely available are installed by hand.
+# This docker target builds on the debian Stretch base image.
+#
+# It is intented to build the host architecture, with as much
+# features as possible (libraries which are not widely available
+# are installed by hand).
 #
 FROM qemu:debian9
 MAINTAINER Philippe Mathieu-Daudé <[email protected]>
Signature · 1 line
2.18.0
Reviewed-by on v1 3/4
#5 lore raw

Re: [Qemu-devel] [RFC PATCH 3/4] docker: Rename 'amd64' image as 'host-cross'

Quoted 6 lines · Philippe Mathieu-Daudé
---
 .shippable.yml                                           | 4 ++--
 tests/docker/Makefile.include                            | 2 +-
 .../{debian-amd64.docker => debian-host-cross.docker}    | 9

++++++---

I'd prefer debian-amd64->debian-host as it's not really a cross compiler.

Otherwise:

Quoted 43 lines
 3 files changed, 9 insertions(+), 6 deletions(-)
 rename tests/docker/dockerfiles/{debian-amd64.docker => debian-host-cross.docker} (82%)
.shippable.yml +2 -2
index f74a3de3ff..7625ba8f27 100644
@@ -5,8 +5,8 @@ env:
   global:
     - LC_ALL=C
   matrix:
-    - IMAGE=debian-amd64
-      TARGET_LIST=x86_64-softmmu,x86_64-linux-user
+    - IMAGE=debian-host-cross
+      TARGET_LIST=aarch64-softmmu,x86_64-softmmu,x86_64-linux-user
     - IMAGE=debian-win32-cross
       TARGET_LIST=arm-softmmu,i386-softmmu,lm32-softmmu
     - IMAGE=debian-win64-cross
tests/docker/Makefile.include +1 -1
index b2a7e761cc..2db4190b4c 100644
@@ -83,7 +83,7 @@ endif
 # Enforce dependencies for composite images
 docker-image-debian: docker-image-debian9
 docker-image-debian8-mxe: docker-image-debian8
-docker-image-debian-amd64: docker-image-debian9
+docker-image-debian-host-cross: docker-image-debian9
 docker-image-debian-armel-cross: docker-image-debian9
 docker-image-debian-armhf-cross: docker-image-debian9
 docker-image-debian-arm64-cross: docker-image-debian9
tests/docker/dockerfiles/debian-host-cross.docker renamed from tests/docker/dockerfiles/debian-amd64.docker +1 -1
similarity index 82%
rename from tests/docker/dockerfiles/debian-amd64.docker
rename to tests/docker/dockerfiles/debian-host-cross.docker
index d79a599a0d..17d937efc9 100644
@@ -1,8 +1,11 @@
 #
-# Docker x86_64 target
+# Docker 'host' target (same architecture than the host)
 #

tests/docker/dockerfiles/debian-host-cross.docker line 11

Quoted 10 lines
tests/docker/dockerfiles/debian-host-cross.docker renamed from tests/docker/dockerfiles/debian-amd64.docker +5 -2
-# This docker target builds on the debian Stretch base image. Further
-# libraries which are not widely available are installed by hand.
+# This docker target builds on the debian Stretch base image.
+#
+# It is intented to build the host architecture, with as much
+# features as possible (libraries which are not widely available
+# are installed by hand).
 #
 FROM qemu:debian9
 MAINTAINER Philippe Mathieu-Daudé <[email protected]>

--
Alex Bennée

#6 lore raw

Re: [Qemu-devel] [RFC PATCH 3/4] docker: Rename 'amd64' image as 'host-cross'

Quoted 10 lines · Alex Bennée
Quoted 6 lines · Philippe Mathieu-Daudé
---
 .shippable.yml                                           | 4 ++--
 tests/docker/Makefile.include                            | 2 +-
 .../{debian-amd64.docker => debian-host-cross.docker}    | 9

++++++---

Quoted 2 lines

I'd prefer debian-amd64->debian-host as it's not really a cross compiler.

This sounds better, indeed.

Quoted 8 lines

Otherwise:

Quoted 3 lines
 3 files changed, 9 insertions(+), 6 deletions(-)
 rename tests/docker/dockerfiles/{debian-amd64.docker => debian-host-cross.docker} (82%)
Quoted 12 lines

.shippable.yml env: · line 9

Quoted 12 lines
.shippable.yml +2 -2
index f74a3de3ff..7625ba8f27 100644
@@ -5,8 +5,8 @@ env:
   global:
     - LC_ALL=C
   matrix:
-    - IMAGE=debian-amd64
-      TARGET_LIST=x86_64-softmmu,x86_64-linux-user
+    - IMAGE=debian-host-cross
+      TARGET_LIST=aarch64-softmmu,x86_64-softmmu,x86_64-linux-user

This line might be tuned a bit.

Quoted 43 lines
Quoted 28 lines
.shippable.yml +0 -0
     - IMAGE=debian-win32-cross
       TARGET_LIST=arm-softmmu,i386-softmmu,lm32-softmmu
     - IMAGE=debian-win64-cross
tests/docker/Makefile.include +1 -1
index b2a7e761cc..2db4190b4c 100644
@@ -83,7 +83,7 @@ endif
 # Enforce dependencies for composite images
 docker-image-debian: docker-image-debian9
 docker-image-debian8-mxe: docker-image-debian8
-docker-image-debian-amd64: docker-image-debian9
+docker-image-debian-host-cross: docker-image-debian9
 docker-image-debian-armel-cross: docker-image-debian9
 docker-image-debian-armhf-cross: docker-image-debian9
 docker-image-debian-arm64-cross: docker-image-debian9
tests/docker/dockerfiles/debian-host-cross.docker renamed from tests/docker/dockerfiles/debian-amd64.docker +1 -1
similarity index 82%
rename from tests/docker/dockerfiles/debian-amd64.docker
rename to tests/docker/dockerfiles/debian-host-cross.docker
index d79a599a0d..17d937efc9 100644
@@ -1,8 +1,11 @@
 #
-# Docker x86_64 target
+# Docker 'host' target (same architecture than the host)
 #

tests/docker/dockerfiles/debian-host-cross.docker line 11

Quoted 10 lines
tests/docker/dockerfiles/debian-host-cross.docker renamed from tests/docker/dockerfiles/debian-amd64.docker +5 -2
-# This docker target builds on the debian Stretch base image. Further
-# libraries which are not widely available are installed by hand.
+# This docker target builds on the debian Stretch base image.
+#
+# It is intented to build the host architecture, with as much
+# features as possible (libraries which are not widely available
+# are installed by hand).
 #
 FROM qemu:debian9
 MAINTAINER Philippe Mathieu-Daudé <[email protected]>

--
Alex Bennée

#7 lore raw

RFC PATCH 4/4 docker: Add many libraries to the 'host-cross' image

In reply to Philippe Mathieu-Daudé

---
To avoid some problem with Docker permissions on NUMA systems, the libnuma-dev package is deliberately not installed (yet).

---
 .../dockerfiles/debian-host-cross.docker      | 37 ++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)
tests/docker/dockerfiles/debian-host-cross.docker +36 -1
index 17d937efc9..89ca0a4daf 100644
@@ -15,11 +15,46 @@ RUN DEBIAN_FRONTEND=noninteractive eatmydata \
 
 RUN DEBIAN_FRONTEND=noninteractive eatmydata \
     apt-get install -y --no-install-recommends \
+        libaio-dev \
+        libasound2-dev \
+        libattr1-dev \
+        libbluetooth-dev \
+        libbrlapi-dev \
         libbz2-dev \
+        libcacard-dev \
+        libcap-dev \
+        libcap-ng-dev \
+        libcapstone-dev \
+        libcurl4-gnutls-dev \
+        libepoxy-dev \
+        libfdt-dev \
+        libibverbs-dev \
+        libiscsi-dev \
+        libjemalloc-dev \
+        libjpeg-dev \
+        liblttng-ust-dev \
         liblzo2-dev \
+        libncursesw5-dev \
+        libnfs-dev \
+        libnss3-dev \
+        libpixman-1-dev \
+        libpulse-dev \
+        librados-dev \
+        librbd-dev \
         librdmacm-dev \
+        libseccomp-dev \
         libsnappy-dev \
-        libvte-dev
+        libspice-protocol-dev \
+        libssh2-1-dev \
+        liburcu-dev \
+        libusb-1.0-0-dev \
+        libusbredirhost-dev \
+        libusbredirparser-dev \
+        libvdeplug-dev \
+        libvte-dev \
+        libxen-dev \
+        uuid-dev \
+        xfslibs-dev
 
 # virgl
 RUN DEBIAN_FRONTEND=noninteractive eatmydata \
Signature · 1 line
2.18.0
#8 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 7 lines · On Mon, 16 Jul 2018 23:29:20 -0300 Philippe Mathieu-Daudé <[email protected]>…

Sorry I don't have a better name for this image, it is meant to cross-build for the same architecture than the host.

Due to the bad name, explicitely tagged the last 2 patches as 'RFC'.

Quoted 6 lines

Tested on x86_64 and aarch64, should also work on
s390x and ppc64le (per the Docker doc).

If they are volunteers for test, the command is as simple as:

  $ make docker-test-quick@debian-host-cross [V=1]

On s390x, all looks reasonable until it tries to install libxen-dev:

Step 4/14 : RUN DEBIAN_FRONTEND=noninteractive eatmydata apt-get install -y --no-install-recommends libaio-dev libasound2-dev libattr1-dev libbluetooth-dev libbrlapi-dev libbz2-dev libcacard-dev libcap-dev libcap-ng-dev libcapstone-dev libcurl4-gnutls-dev libepoxy-dev libfdt-dev libibverbs-dev libiscsi-dev libjemalloc-dev libjpeg-dev liblttng-ust-dev liblzo2-dev libncursesw5-dev libnfs-dev libnss3-dev libpixman-1-dev libpulse-dev librados-dev librbd-dev librdmacm-dev libseccomp-dev libsnappy-dev libspice-protocol-dev libssh2-1-dev liburcu-dev libusb-1.0-0-dev libusbredirhost-dev libusbredirparser-dev libvdeplug-dev libvte-dev libxen-dev uuid-dev xfslibs-dev
---> Running in a7f6ae892a05
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package libxen-dev

#9 lore raw

Hi Cornelia,

Quoted 10 lines · Cornelia Huck
Quoted 7 lines · On Mon, 16 Jul 2018 23:29:20 -0300 Philippe Mathieu-Daudé <[email protected]>…

Sorry I don't have a better name for this image, it is meant to cross-build for the same architecture than the host.

Due to the bad name, explicitely tagged the last 2 patches as 'RFC'.

Quoted 8 lines
Quoted 6 lines

Tested on x86_64 and aarch64, should also work on
s390x and ppc64le (per the Docker doc).

If they are volunteers for test, the command is as simple as:

  $ make docker-test-quick@debian-host-cross [V=1]

On s390x, all looks reasonable until it tries to install libxen-dev:

https://packages.debian.org/stretch/libxen-dev#pdownload
Oh, no Xen for s390x nor ppc64el... OK.

Quoted 6 lines

Step 4/14 : RUN DEBIAN_FRONTEND=noninteractive eatmydata apt-get install -y --no-install-recommends libaio-dev libasound2-dev libattr1-dev libbluetooth-dev libbrlapi-dev libbz2-dev libcacard-dev libcap-dev libcap-ng-dev libcapstone-dev libcurl4-gnutls-dev libepoxy-dev libfdt-dev libibverbs-dev libiscsi-dev libjemalloc-dev libjpeg-dev liblttng-ust-dev liblzo2-dev libncursesw5-dev libnfs-dev libnss3-dev libpixman-1-dev libpulse-dev librados-dev librbd-dev librdmacm-dev libseccomp-dev libsnappy-dev libspice-protocol-dev libssh2-1-dev liburcu-dev libusb-1.0-0-dev libusbredirhost-dev libusbredirparser-dev libvdeplug-dev libvte-dev libxen-dev uuid-dev xfslibs-dev
---> Running in a7f6ae892a05
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package libxen-dev

Thanks for testing this, since the first steps passed, the following shouldn't be a problem now.

Regards,

Phil.