2 # Docker all cross-compiler target (tests only)
4 # While the normal cross builds take care to setup proper multiarch
5 # build environments which can cross build QEMU this just installs the
6 # basic compilers for as many targets as possible. We shall use this
7 # to build and run linux-user tests on GitLab
9 FROM docker.io/library/debian:12-slim
11 # Duplicate deb line as deb-src
12 RUN sed -in "s/Types: deb/Types: deb deb-src/g" /etc/apt/sources.list.d/debian.sources
14 RUN export DEBIAN_FRONTEND=noninteractive && \
16 apt-get install -y eatmydata && \
17 eatmydata apt-get dist-upgrade -y && \
18 apt build-dep -yy qemu
20 # Add extra build tools and as many cross compilers as we can for testing
21 RUN DEBIAN_FRONTEND=noninteractive eatmydata \
22 apt install -y --no-install-recommends \
36 RUN DEBIAN_FRONTEND=noninteractive eatmydata \
37 apt install -y --no-install-recommends \
38 gcc-aarch64-linux-gnu \
39 libc6-dev-arm64-cross \
40 gcc-arm-linux-gnueabihf \
41 libc6-dev-armhf-cross \
43 libc6-dev-hppa-cross \
45 libc6-dev-m68k-cross \
47 libc6-dev-mips-cross \
48 gcc-mips64-linux-gnuabi64 \
49 libc6-dev-mips64-cross \
50 gcc-mips64el-linux-gnuabi64 \
51 libc6-dev-mips64el-cross \
52 gcc-mipsel-linux-gnu \
53 libc6-dev-mipsel-cross \
54 gcc-powerpc-linux-gnu \
55 libc6-dev-powerpc-cross \
56 gcc-powerpc64-linux-gnu \
57 libc6-dev-ppc64-cross \
58 gcc-powerpc64le-linux-gnu \
59 libc6-dev-ppc64el-cross \
60 gcc-riscv64-linux-gnu \
61 libc6-dev-riscv64-cross \
63 libc6-dev-s390x-cross \
64 gcc-sparc64-linux-gnu \
65 libc6-dev-sparc64-cross
68 ENV QEMU_CONFIGURE_OPTS --disable-system --disable-docs --disable-tools
69 ENV DEF_TARGET_LIST aarch64-linux-user,arm-linux-user,hppa-linux-user,i386-linux-user,m68k-linux-user,mips-linux-user,mips64-linux-user,mips64el-linux-user,mipsel-linux-user,ppc-linux-user,ppc64-linux-user,ppc64le-linux-user,riscv64-linux-user,s390x-linux-user,sparc64-linux-user
70 # As a final step configure the user (if env is defined)
73 RUN if [ "${USER}" ]; then \
74 id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi