Skip to content

Commit

Permalink
Run as nonroot user
Browse files Browse the repository at this point in the history
  • Loading branch information
HadrienPatte committed Apr 22, 2024
1 parent 403e182 commit 46384c7
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
13 changes: 11 additions & 2 deletions images/prowlarr/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ RUN \
--root /rootfs \
base-files_base \
base-files_release-info \
base-passwd_data \
ca-certificates_data \
dotnet-runtime-8.0_libs \
libsqlite3-0_libs
libsqlite3-0_libs \
&& useradd \
--root /rootfs \
--system \
--no-create-home \
--uid 1000 \
nonroot \
&& rm /rootfs/etc/.pwd.lock \
&& mkdir /rootfs/config \
&& chown 1000 /rootfs/config

# Download prowlarr
RUN \
Expand All @@ -33,4 +41,5 @@ FROM scratch
COPY --from=builder /rootfs /
COPY --from=builder /Prowlarr /Prowlarr

USER nonroot
ENTRYPOINT ["/Prowlarr/Prowlarr", "--nobrowser", "--data=/config"]
13 changes: 11 additions & 2 deletions images/radarr/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ RUN \
--root /rootfs \
base-files_base \
base-files_release-info \
base-passwd_data \
ca-certificates_data \
dotnet-runtime-8.0_libs \
libsqlite3-0_libs
libsqlite3-0_libs \
&& useradd \
--root /rootfs \
--system \
--no-create-home \
--uid 1000 \
nonroot \
&& rm /rootfs/etc/.pwd.lock \
&& mkdir /rootfs/config \
&& chown 1000 /rootfs/config

# Download radarr
RUN \
Expand All @@ -33,4 +41,5 @@ FROM scratch
COPY --from=builder /rootfs /
COPY --from=builder /Radarr /Radarr

USER nonroot
ENTRYPOINT ["/Radarr/Radarr", "--nobrowser", "--data=/config"]
13 changes: 11 additions & 2 deletions images/sonarr/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ RUN \
--root /rootfs \
base-files_base \
base-files_release-info \
base-passwd_data \
ca-certificates_data \
dotnet-runtime-8.0_libs \
libsqlite3-0_libs
libsqlite3-0_libs \
&& useradd \
--root /rootfs \
--system \
--no-create-home \
--uid 1000 \
nonroot \
&& rm /rootfs/etc/.pwd.lock \
&& mkdir /rootfs/config \
&& chown 1000 /rootfs/config

# Download sonarr
RUN \
Expand All @@ -33,4 +41,5 @@ FROM scratch
COPY --from=builder /rootfs /
COPY --from=builder /Sonarr /Sonarr

USER nonroot
ENTRYPOINT ["/Sonarr/Sonarr", "--nobrowser", "--data=/config"]

0 comments on commit 46384c7

Please sign in to comment.