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
|
# Create an unprivileged user
|
||||||
RUN useradd \
|
RUN useradd \
|
||||||
--system \
|
|
||||||
--uid 10001 \
|
--uid 10001 \
|
||||||
--create-home \
|
--no-create-home \
|
||||||
--home-dir /nonexistent \
|
|
||||||
--shell /usr/sbin/nologin \
|
--shell /usr/sbin/nologin \
|
||||||
weatherfeeder
|
weatherfeeder
|
||||||
|
|
||||||
# Copy the binary
|
# Copy the binary
|
||||||
COPY --from=build /out/weatherfeeder /weatherfeeder/weatherfeeder
|
COPY --chown=weatherfeeder:weatherfeeder --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
|
|
||||||
|
|
||||||
USER weatherfeeder
|
USER weatherfeeder
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user