From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id l16-20020adfe590000000b002c70e60eb40sm9764085wrm.11.2023.02.28.04.19.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 04:19:45 -0800 (PST) Received: from zen (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D19401FFB7; Tue, 28 Feb 2023 12:19:44 +0000 (GMT) References: <20230224180857.1050220-1-alex.bennee@linaro.org> <20230224180857.1050220-5-alex.bennee@linaro.org> <6a0a7246-e9fd-abfc-283e-b591000cfec7@linaro.org> User-agent: mu4e 1.9.21; emacs 29.0.60 From: Alex =?utf-8?Q?Benn=C3=A9e?= To: Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Cc: qemu-devel@nongnu.org, Li-Wen Hsu , Thomas Huth , Kevin Wolf , Stefan Hajnoczi , Michael Roth , Qiuhao Li , Beraldo Leal , Paolo Bonzini , =?utf-8?Q?Daniel_P=2E_Berrang=C3=A9?= , Cleber Rosa , Yonggang Luo , Ed Maste , Peter Maydell , Aurelien Jarno , qemu-arm@nongnu.org, qemu-block@nongnu.org, Bastian Koppelmann , John Snow , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , Alexander Bulekov , Hanna Reitz , Bandan Das , Markus Armbruster , Darren Kenny , Wainer dos Santos Moschetta , Pavel Dovgalyuk Subject: Re: [PATCH 4/7] tests/docker: add USER stanzas to non-lci images Date: Tue, 28 Feb 2023 12:18:22 +0000 In-reply-to: <6a0a7246-e9fd-abfc-283e-b591000cfec7@linaro.org> Message-ID: <87h6v6f0db.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-TUID: LEuv5AVoj9Bv Philippe Mathieu-Daud=C3=A9 writes: > On 24/2/23 19:08, Alex Benn=C3=A9e wrote: >> These are flat but not generated by lcitool so we need to manually >> update them with the `useradd` stanza. >> Signed-off-by: Alex Benn=C3=A9e >> --- >> tests/docker/dockerfiles/debian-all-test-cross.docker | 5 +++++ >> tests/docker/dockerfiles/debian-alpha-cross.docker | 5 +++++ >> tests/docker/dockerfiles/debian-hexagon-cross.docker | 5 +++++ >> tests/docker/dockerfiles/debian-hppa-cross.docker | 5 +++++ >> tests/docker/dockerfiles/debian-loongarch-cross.docker | 5 +++++ >> tests/docker/dockerfiles/debian-m68k-cross.docker | 5 +++++ >> tests/docker/dockerfiles/debian-mips-cross.docker | 5 +++++ >> tests/docker/dockerfiles/debian-mips64-cross.docker | 5 +++++ >> tests/docker/dockerfiles/debian-native.docker | 5 +++++ >> tests/docker/dockerfiles/debian-powerpc-test-cross.docker | 6 +++++- >> tests/docker/dockerfiles/debian-riscv64-cross.docker | 5 +++++ >> tests/docker/dockerfiles/debian-riscv64-test-cross.docker | 5 +++++ >> tests/docker/dockerfiles/debian-sh4-cross.docker | 5 +++++ >> tests/docker/dockerfiles/debian-sparc64-cross.docker | 5 +++++ >> tests/docker/dockerfiles/debian-toolchain.docker | 5 +++++ >> tests/docker/dockerfiles/debian-tricore-cross.docker | 5 +++++ >> tests/docker/dockerfiles/debian-xtensa-cross.docker | 5 +++++ >> tests/docker/dockerfiles/fedora-cris-cross.docker | 5 +++++ >> tests/docker/dockerfiles/fedora-i386-cross.docker | 5 +++++ >> tests/docker/dockerfiles/python.docker | 5 +++++ >> 20 files changed, 100 insertions(+), 1 deletion(-) >> diff --git a/tests/docker/dockerfiles/debian-all-test-cross.docker >> b/tests/docker/dockerfiles/debian-all-test-cross.docker >> index 8dc5e1b5de..981e9bdc7b 100644 >> --- a/tests/docker/dockerfiles/debian-all-test-cross.docker >> +++ b/tests/docker/dockerfiles/debian-all-test-cross.docker >> @@ -61,3 +61,8 @@ RUN DEBIAN_FRONTEND=3Dnoninteractive 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-lin= ux-user,mips64el-linux-user,mipsel-linux-user,ppc-linux-user,ppc64-linux-us= er,ppc64le-linux-user,riscv64-linux-user,s390x-linux-user,sh4-linux-user,sp= arc64-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 > > Is that intended for local image building? For building tests. When we run the compilers inside the docker container we want to ensure the final binary is visible and accessible outside the container. > Personally I only use the image built by gitlab and mount the containers > with -u $UID -v $HOME/.ccache -v $HOME/source/qemu. Would that still > keep working, or do I have to map from gitlab user to mine? Its only added on for local builds so in theory you should cache all the layers apart from the last one. --=20 Alex Benn=C3=A9e Virtualisation Tech Lead @ Linaro