From c8bbef805f254c48ec5aa4f98eb45a26c211994f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer <mschiffer@universe-factory.net> Date: Sun, 10 Sep 2023 17:43:34 +0200 Subject: [PATCH] contrib: Dockerfile: install libnss-unknown While Podman automatically populates /etc/passwd and /etc/group with matching entries for the mapped host user, such a feature is missing from Docker. Install libnss-unknown, which will return passwd entries of the form "uid-1000" for all unknown UIDs, to avoid warnings and other weird behaviour that may occur when running as an unnamed user. `-o` must be passed to useradd now to allow non-unique user entries, as with libnss-unknown, every UID is considered occupied. --- contrib/docker/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/docker/Dockerfile b/contrib/docker/Dockerfile index faace7064..2a1386e1d 100644 --- a/contrib/docker/Dockerfile +++ b/contrib/docker/Dockerfile @@ -21,6 +21,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ ecdsautils \ lua-check \ shellcheck \ + libnss-unknown \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* @@ -30,7 +31,7 @@ RUN mkdir /tmp/ec &&\ mv bin/ec-linux-amd64 /usr/local/bin/editorconfig-checker &&\ rm -rf /tmp/ec -RUN useradd -m -d /gluon -u 100 -g 100 gluon +RUN useradd -m -d /gluon -u 100 -g 100 -o gluon USER gluon VOLUME /gluon -- GitLab