Skip to content

Commit

Permalink
contrib: Dockerfile: install libnss-unknown
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
neocturne committed Sep 10, 2023
1 parent 4ada0c4 commit c8bbef8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contrib/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/*

Expand All @@ -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
Expand Down

0 comments on commit c8bbef8

Please sign in to comment.