Skip to content

Commit 81243a5

Browse files
committed
Reworked adding non-root user to docker images. This gives you the ability to run ntfy as a non-root user. fixes #966
1 parent fc62682 commit 81243a5

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ LABEL org.opencontainers.image.licenses="Apache-2.0, GPL-2.0"
99
LABEL org.opencontainers.image.title="ntfy"
1010
LABEL org.opencontainers.image.description="Send push notifications to your phone or desktop using PUT/POST"
1111

12-
RUN apk add --no-cache tzdata
12+
RUN apk add --no-cache tzdata \
13+
&& /usr/sbin/adduser -D -u 1000 ntfy
1314
COPY ntfy /usr/bin
1415

1516
EXPOSE 80/tcp

Dockerfile-arm

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ LABEL org.opencontainers.image.description="Send push notifications to your phon
1212
# Alpine does not support adding "tzdata" on ARM anymore, see
1313
# https://github.com/binwiederhier/ntfy/issues/894
1414

15+
RUN /usr/sbin/adduser -D -u 1000 ntfy
1516
COPY ntfy /usr/bin
1617

1718
EXPOSE 80/tcp

Dockerfile-build

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ LABEL org.opencontainers.image.licenses="Apache-2.0, GPL-2.0"
5353
LABEL org.opencontainers.image.title="ntfy"
5454
LABEL org.opencontainers.image.description="Send push notifications to your phone or desktop using PUT/POST"
5555

56+
RUN /usr/sbin/adduser -D -u 1000 ntfy
57+
5658
COPY --from=builder /app/dist/ntfy_linux_server/ntfy /usr/bin/ntfy
5759

5860
EXPOSE 80/tcp

0 commit comments

Comments
 (0)