Skip to content

Commit 90f4562

Browse files
authored
Merge pull request #755 from Sedetius/rootles-docker
[Docker] kiwix-serve image to use unprivileged user
2 parents e22cfea + 869b08c commit 90f4562

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM alpine:3.18
2-
LABEL org.opencontainers.image.source https://github.com/openzim/kiwix-tools
2+
LABEL org.opencontainers.image.source=https://github.com/openzim/kiwix-tools
33

44
# TARGETPLATFORM is injected by docker build
55
ARG TARGETPLATFORM

docker/server/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@ ARG VERSION=latest
22

33
# kiwix-tools is multi-arch
44
FROM ghcr.io/kiwix/kiwix-tools:$VERSION
5-
LABEL org.opencontainers.image.source https://github.com/openzim/kiwix-tools
5+
LABEL org.opencontainers.image.source=https://github.com/openzim/kiwix-tools
66

77
# expose kiwix-serve default port and workdir
88
EXPOSE 8080
99
VOLUME /data
1010
WORKDIR /data
1111

12+
# running as a named unprivileged user
13+
RUN addgroup -S user && adduser -S user -G user
14+
USER user
15+
1216
COPY ./start.sh /usr/local/bin/
1317

1418
ENTRYPOINT ["/usr/bin/dumb-init", "--", "/usr/local/bin/start.sh"]

0 commit comments

Comments
 (0)