tests/docker: add USER stanzas to non-lci images
authorAlex Bennée <alex.bennee@linaro.org>
Tue, 28 Feb 2023 19:06:48 +0000 (19:06 +0000)
committerAlex Bennée <alex.bennee@linaro.org>
Wed, 1 Mar 2023 12:45:11 +0000 (12:45 +0000)
These are flat but not generated by lcitool so we need to manually
update them with the `useradd` stanza.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230228190653.1602033-20-alex.bennee@linaro.org>

20 files changed:
tests/docker/dockerfiles/debian-all-test-cross.docker
tests/docker/dockerfiles/debian-alpha-cross.docker
tests/docker/dockerfiles/debian-hexagon-cross.docker
tests/docker/dockerfiles/debian-hppa-cross.docker
tests/docker/dockerfiles/debian-loongarch-cross.docker
tests/docker/dockerfiles/debian-m68k-cross.docker
tests/docker/dockerfiles/debian-mips-cross.docker
tests/docker/dockerfiles/debian-mips64-cross.docker
tests/docker/dockerfiles/debian-native.docker
tests/docker/dockerfiles/debian-powerpc-test-cross.docker
tests/docker/dockerfiles/debian-riscv64-cross.docker
tests/docker/dockerfiles/debian-riscv64-test-cross.docker
tests/docker/dockerfiles/debian-sh4-cross.docker
tests/docker/dockerfiles/debian-sparc64-cross.docker
tests/docker/dockerfiles/debian-toolchain.docker
tests/docker/dockerfiles/debian-tricore-cross.docker
tests/docker/dockerfiles/debian-xtensa-cross.docker
tests/docker/dockerfiles/fedora-cris-cross.docker
tests/docker/dockerfiles/fedora-i386-cross.docker
tests/docker/dockerfiles/python.docker

index 8dc5e1b5de8f230a933b1dcb827cac5dff8145f8..981e9bdc7b0ee1496704f210d468d503d27e0f6d 100644 (file)
@@ -61,3 +61,8 @@ RUN DEBIAN_FRONTEND=noninteractive eatmydata \
 
 ENV QEMU_CONFIGURE_OPTS --disable-system --disable-docs --disable-tools
 ENV DEF_TARGET_LIST aarch64-linux-user,alpha-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,sh4-linux-user,sparc64-linux-user
+# As a final step configure the user (if env is defined)
+ARG USER
+ARG UID
+RUN if [ "${USER}" ]; then \
+  id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
index 4eeb43c78ac8c3adabb8e87ec95d0145c9a79ad0..7fa7bf1bdec6ec5de78c23629f605a9292b90f14 100644 (file)
@@ -12,3 +12,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
     eatmydata apt-get install --no-install-recommends -y \
         gcc-alpha-linux-gnu \
         libc6.1-dev-alpha-cross
+# As a final step configure the user (if env is defined)
+ARG USER
+ARG UID
+RUN if [ "${USER}" ]; then \
+  id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
index 8a0d74834356ae77805703179ce0cbdc85db32b2..5308ccb8fe97a43a3778f433d17ab7068d0e2007 100644 (file)
@@ -33,3 +33,8 @@ ENV TOOLCHAIN_URL https://codelinaro.jfrog.io/artifactory/codelinaro-toolchain-f
 
 RUN curl -#SL "$TOOLCHAIN_URL" | tar -xJC "$TOOLCHAIN_INSTALL"
 ENV PATH $PATH:${TOOLCHAIN_INSTALL}/${TOOLCHAIN_BASENAME}/x86_64-linux-gnu/bin
+# As a final step configure the user (if env is defined)
+ARG USER
+ARG UID
+RUN if [ "${USER}" ]; then \
+  id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
index af1c8403d8fdcbfb31b5b2534df9bf3d682ce338..dd47ffdfa4f68345fb683861e8dd1cc283a8cc39 100644 (file)
@@ -12,3 +12,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
     eatmydata apt-get install --no-install-recommends -y \
         gcc-hppa-linux-gnu \
         libc6-dev-hppa-cross
+# As a final step configure the user (if env is defined)
+ARG USER
+ARG UID
+RUN if [ "${USER}" ]; then \
+  id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
index a8e8e98909a62c8b29ed6ff736644ef035f6d36c..9d957547b5c5e6659ed222760ef5589b248c6852 100644 (file)
@@ -25,3 +25,8 @@ RUN curl -#SL https://github.com/loongson/build-tools/releases/download/2022.05.
 
 ENV PATH $PATH:/opt/cross-tools/bin
 ENV LD_LIBRARY_PATH /opt/cross-tools/lib:/opt/cross-tools/loongarch64-unknown-linux-gnu/lib:$LD_LIBRARY_PATH
+# As a final step configure the user (if env is defined)
+ARG USER
+ARG UID
+RUN if [ "${USER}" ]; then \
+  id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
index dded71c5d26143b3988f894397fb8250dc3193e6..25dd1c1e688c699547ef05b7a6a9c3b5cb95c1cc 100644 (file)
@@ -12,3 +12,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
     eatmydata apt-get install --no-install-recommends -y \
         gcc-m68k-linux-gnu \
         libc6-dev-m68k-cross
+# As a final step configure the user (if env is defined)
+ARG USER
+ARG UID
+RUN if [ "${USER}" ]; then \
+  id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
index 7b55f0f3b29a3c076b9e9d795ab69bb0e119a845..2cbc568ed1d5c9edab49944d8141361e8aa15a26 100644 (file)
@@ -12,3 +12,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
     eatmydata apt-get install --no-install-recommends -y \
             gcc-mips-linux-gnu \
             libc6-dev-mips-cross
+# As a final step configure the user (if env is defined)
+ARG USER
+ARG UID
+RUN if [ "${USER}" ]; then \
+  id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
index afcff9726f09b78f776e8c7b60541658a38b0da1..ba965cf564466aae1e83e752cf5c1c6613f521d9 100644 (file)
@@ -12,3 +12,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
     eatmydata apt-get install --no-install-recommends -y \
         gcc-mips64-linux-gnuabi64 \
         libc6-dev-mips64-cross
+# As a final step configure the user (if env is defined)
+ARG USER
+ARG UID
+RUN if [ "${USER}" ]; then \
+  id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
index 8dd033097c0607a3a3d2c65ce7373a0b2bf41289..abac7d7cd747941e89e765cce06da8922bd75653 100644 (file)
@@ -47,3 +47,8 @@ RUN apt update && \
 
 ENV QEMU_CONFIGURE_OPTS $QEMU_CONFIGURE_OPTS
 ENV DEF_TARGET_LIST "none"
+# As a final step configure the user (if env is defined)
+ARG USER
+ARG UID
+RUN if [ "${USER}" ]; then \
+  id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
index d6b2909cc42f4beae2b7b73c6c3eb52637adb495..23779413d3b4d37d791ea476b31e9a3f7d5f0e50 100644 (file)
@@ -16,4 +16,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
         libc6-dev-ppc64-cross \
         gcc-10-powerpc64le-linux-gnu \
         libc6-dev-ppc64el-cross
-
+# As a final step configure the user (if env is defined)
+ARG USER
+ARG UID
+RUN if [ "${USER}" ]; then \
+  id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
index 3daf93968ab0de2208703d0cd4e0d3da814b10f8..803afb957345c7e9e7a05bd908b6af94bbec20e4 100644 (file)
@@ -50,3 +50,8 @@ RUN apt update && \
 # Specify the cross prefix for this image (see tests/docker/common.rc)
 ENV QEMU_CONFIGURE_OPTS --cross-prefix=riscv64-linux-gnu-
 ENV DEF_TARGET_LIST riscv64-softmmu,riscv64-linux-user
+# As a final step configure the user (if env is defined)
+ARG USER
+ARG UID
+RUN if [ "${USER}" ]; then \
+  id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
index e5f83a5aebbf87eb1065bbcc4e56cc653e32bc47..6e631295bce5c6dd9557e56b5da42a1d58944561 100644 (file)
@@ -12,3 +12,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
     eatmydata apt-get install --no-install-recommends -y \
         gcc-riscv64-linux-gnu \
         libc6-dev-riscv64-cross
+# As a final step configure the user (if env is defined)
+ARG USER
+ARG UID
+RUN if [ "${USER}" ]; then \
+  id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
index d48ed9065f5c4290148b7a80a7a91af70d6760f2..6bd8171d33304d1851f7b6a83c9c69dae101d815 100644 (file)
@@ -12,3 +12,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
     eatmydata apt-get install --no-install-recommends -y \
         gcc-sh4-linux-gnu \
         libc6-dev-sh4-cross
+# As a final step configure the user (if env is defined)
+ARG USER
+ARG UID
+RUN if [ "${USER}" ]; then \
+  id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
index 8d3d306bc1739338d43b2d023ab95ed8a58f6817..1ef735f22304df59726efb63669850de0b82b12c 100644 (file)
@@ -12,3 +12,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
     eatmydata apt-get install --no-install-recommends -y \
         gcc-sparc64-linux-gnu \
         libc6-dev-sparc64-cross
+# As a final step configure the user (if env is defined)
+ARG USER
+ARG UID
+RUN if [ "${USER}" ]; then \
+  id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
index dc9545857fc130f3cf1fd090f7e160feeeacb09a..687a97fec4a965e52a9cd774929ce1f34b51ece4 100644 (file)
@@ -34,3 +34,8 @@ RUN cd /root && ./build-toolchain.sh
 # then copying the built toolchain from stage 0.
 FROM docker.io/library/debian:11-slim
 COPY --from=0 /usr/local /usr/local
+# As a final step configure the user (if env is defined)
+ARG USER
+ARG UID
+RUN if [ "${USER}" ]; then \
+  id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
index 82e457648543d5e437d2830827c23ce554070e13..cfd2faf9a80358dadec9da73c481f017bde536b3 100644 (file)
@@ -41,3 +41,8 @@ RUN curl -#SL https://github.com/bkoppelmann/package_940/releases/download/trico
 # This image can only build a very minimal QEMU as well as the tests
 ENV DEF_TARGET_LIST tricore-softmmu
 ENV QEMU_CONFIGURE_OPTS --disable-user --disable-tools --disable-fdt
+# As a final step configure the user (if env is defined)
+ARG USER
+ARG UID
+RUN if [ "${USER}" ]; then \
+  id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
index 2f11b3b7bc23b791e1884e9cabc87da5d3cbdc97..082b50da19540968c638c90b5b67c2fb45af18e6 100644 (file)
@@ -27,3 +27,8 @@ RUN for cpu in $CPU_LIST; do \
     done
 
 ENV PATH $PATH:/opt/$TOOLCHAIN_RELEASE/xtensa-dc232b-elf/bin:/opt/$TOOLCHAIN_RELEASE/xtensa-dc233c-elf/bin:/opt/$TOOLCHAIN_RELEASE/xtensa-de233_fpu-elf/bin:/opt/$TOOLCHAIN_RELEASE/xtensa-dsp3400-elf/bin
+# As a final step configure the user (if env is defined)
+ARG USER
+ARG UID
+RUN if [ "${USER}" ]; then \
+  id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
index 91c373fdd3eda7f81a125c2e30d70f446fe17211..f2899af410bc1d8f829b19999fc05985e52bd90d 100644 (file)
@@ -6,3 +6,8 @@ FROM registry.fedoraproject.org/fedora:33
 ENV PACKAGES gcc-cris-linux-gnu
 RUN dnf install -y $PACKAGES
 RUN rpm -q $PACKAGES | sort > /packages.txt
+# As a final step configure the user (if env is defined)
+ARG USER
+ARG UID
+RUN if [ "${USER}" ]; then \
+  id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
index f58b64dc3eb0ce1539b81a35581debba13efedb9..14c1fb2c93ab7ad6a9de7063dbecdcf7db76713e 100644 (file)
@@ -32,3 +32,8 @@ ENV PKG_CONFIG_LIBDIR /usr/lib/pkgconfig
 
 RUN dnf update -y && dnf install -y $PACKAGES
 RUN rpm -q $PACKAGES | sort > /packages.txt
+# As a final step configure the user (if env is defined)
+ARG USER
+ARG UID
+RUN if [ "${USER}" ]; then \
+  id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
index 175c10a34e89108e35b0523a56baa71938e3f380..383ccbdc3a59edaee095a1e9f6b0627002061d70 100644 (file)
@@ -15,3 +15,8 @@ ENV PACKAGES \
 
 RUN dnf install -y $PACKAGES
 RUN rpm -q $PACKAGES | sort > /packages.txt
+# As a final step configure the user (if env is defined)
+ARG USER
+ARG UID
+RUN if [ "${USER}" ]; then \
+  id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi