Skip to content

Commit

Permalink
Reworked adding non-root user to docker images. This gives you the ab…
Browse files Browse the repository at this point in the history
…ility to run ntfy as a non-root user. fixes #966
  • Loading branch information
arahja committed Mar 11, 2024
1 parent 4c0ec3f commit ba8cd4f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.description="Send push notifications to your phone or desktop using PUT/POST"

RUN apk add --no-cache tzdata
RUN apk add --no-cache tzdata \
&& /usr/sbin/adduser -D -u 1000 ntfy
COPY ntfy /usr/bin

EXPOSE 80/tcp
Expand Down
1 change: 1 addition & 0 deletions Dockerfile-arm
Original file line number Diff line number Diff line change
Expand Up @@ -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
# https://github.com/binwiederhier/ntfy/issues/894

RUN /usr/sbin/adduser -D -u 1000 ntfy
COPY ntfy /usr/bin

EXPOSE 80/tcp
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile-build
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ LABEL org.opencontainers.image.licenses="Apache-2.0, GPL-2.0"
LABEL org.opencontainers.image.title="ntfy"
LABEL org.opencontainers.image.description="Send push notifications to your phone or desktop using PUT/POST"

RUN /usr/sbin/adduser -D -u 1000 ntfy

COPY --from=builder /app/dist/ntfy_linux_server/ntfy /usr/bin/ntfy

EXPOSE 80/tcp
Expand Down

0 comments on commit ba8cd4f

Please sign in to comment.