Merge pull request #967 from arahja/add_non-root_user_to_containers

Added non-root user to docker images.
This commit is contained in:
Philipp C. Heckel 2024-03-07 10:33:32 -05:00 committed by GitHub
commit f2e600d681
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 1 deletions

View File

@ -9,7 +9,8 @@ LABEL org.opencontainers.image.licenses="Apache-2.0, GPL-2.0"
LABEL org.opencontainers.image.title="ntfy" LABEL org.opencontainers.image.title="ntfy"
LABEL org.opencontainers.image.description="Send push notifications to your phone or desktop using PUT/POST" LABEL org.opencontainers.image.description="Send push notifications to your phone or desktop using PUT/POST"
RUN apk add --no-cache tzdata RUN apk add --no-cache tzdata \
&& adduser -D -u 1000 ntfy
COPY ntfy /usr/bin COPY ntfy /usr/bin
EXPOSE 80/tcp EXPOSE 80/tcp

View File

@ -12,6 +12,7 @@ LABEL org.opencontainers.image.description="Send push notifications to your phon
# Alpine does not support adding "tzdata" on ARM anymore, see # Alpine does not support adding "tzdata" on ARM anymore, see
# https://github.com/binwiederhier/ntfy/issues/894 # https://github.com/binwiederhier/ntfy/issues/894
RUN adduser -D -u 1000 ntfy
COPY ntfy /usr/bin COPY ntfy /usr/bin
EXPOSE 80/tcp EXPOSE 80/tcp

View File

@ -53,6 +53,7 @@ LABEL org.opencontainers.image.licenses="Apache-2.0, GPL-2.0"
LABEL org.opencontainers.image.title="ntfy" LABEL org.opencontainers.image.title="ntfy"
LABEL org.opencontainers.image.description="Send push notifications to your phone or desktop using PUT/POST" LABEL org.opencontainers.image.description="Send push notifications to your phone or desktop using PUT/POST"
RUN adduser -D -u 1000 ntfy
COPY --from=builder /app/dist/ntfy_linux_server/ntfy /usr/bin/ntfy COPY --from=builder /app/dist/ntfy_linux_server/ntfy /usr/bin/ntfy
EXPOSE 80/tcp EXPOSE 80/tcp