Update Dockerfile to streamline the weatherfeeder user creation.
All checks were successful
ci/woodpecker/manual/build-image Pipeline was successful
All checks were successful
ci/woodpecker/manual/build-image Pipeline was successful
This commit is contained in:
@@ -64,18 +64,13 @@ WORKDIR /weatherfeeder
|
||||
|
||||
# Create an unprivileged user
|
||||
RUN useradd \
|
||||
--system \
|
||||
--uid 10001 \
|
||||
--create-home \
|
||||
--home-dir /nonexistent \
|
||||
--no-create-home \
|
||||
--shell /usr/sbin/nologin \
|
||||
weatherfeeder
|
||||
|
||||
# Copy the binary
|
||||
COPY --from=build /out/weatherfeeder /weatherfeeder/weatherfeeder
|
||||
|
||||
# Make sure the user can read config.yml when it’s mounted in
|
||||
RUN chown -R weatherfeeder:weatherfeeder /weatherfeeder
|
||||
COPY --chown=weatherfeeder:weatherfeeder --from=build /out/weatherfeeder /weatherfeeder/weatherfeeder
|
||||
|
||||
USER weatherfeeder
|
||||
|
||||
|
||||
Reference in New Issue
Block a user