Improve user creation in Dockerfile

This commit is contained in:
James Musselman 2023-11-21 14:23:56 -06:00
parent ccdd52afa4
commit 4fc8725438

View file

@ -16,7 +16,7 @@ RUN go build -o /home/notatio/notatio
# Stage 2: Create the final image # Stage 2: Create the final image
FROM docker.io/library/alpine:3.18.4 FROM docker.io/library/alpine:3.18.4
# Add the user notatio and create its home directory # Add the user notatio and create its home directory
RUN adduser -D -g '' notatio RUN adduser --home /home/notatio --disabled-password --gecos "" notatio
USER notatio USER notatio
WORKDIR / WORKDIR /