diff options
author | Alex Bennée <alex.bennee@linaro.org> | 2023-02-28 19:06:47 +0000 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2023-03-01 12:45:11 +0000 |
commit | 5b8bcf6b6cf7a254854e75def40883e2a8fea5dc (patch) | |
tree | 27762903713ba5ab30a085b9ad7f1636c85eba76 /tests/docker/dockerfiles/alpine.docker | |
parent | 60f999b7f2890c9e8ddcd404ce8c4b89b5dee0a2 (diff) |
tests/lcitool: append user setting stanza to dockerfiles
For the cross-compilation use-case it is important to add the host
user to the dockerfile so we can map them to the docker environment
when cross-building files.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230228190653.1602033-19-alex.bennee@linaro.org>
Diffstat (limited to 'tests/docker/dockerfiles/alpine.docker')
-rw-r--r-- | tests/docker/dockerfiles/alpine.docker | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/docker/dockerfiles/alpine.docker b/tests/docker/dockerfiles/alpine.docker index 7589f6c6ed..799932bcc9 100644 --- a/tests/docker/dockerfiles/alpine.docker +++ b/tests/docker/dockerfiles/alpine.docker @@ -124,3 +124,8 @@ ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" ENV NINJA "/usr/bin/ninja" ENV PYTHON "/usr/bin/python3" +# 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 |