From a34b77925a94ea439898d6fe3c61172dc9119d99 Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Fri, 8 Sep 2023 21:13:53 +0300
Subject: [PATCH] Daemon: Replace gosu with su-exec.

Pratically the same thing but is available in the regular Alpine repo
and is a bit smaller.
---
 daemon/Dockerfile | 6 ++----
 daemon/entrypoint | 2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/daemon/Dockerfile b/daemon/Dockerfile
index c90beab..39cb9bc 100644
--- a/daemon/Dockerfile
+++ b/daemon/Dockerfile
@@ -1,10 +1,8 @@
 FROM alpine:3.18
 # hadolint ignore=DL3018
-RUN apk add --update --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ \
-        gosu \
-    && \
-    apk add --update --no-cache \
+RUN apk add --update --no-cache \
         python3 \
+        su-exec \
         transmission-daemon \
     && \
     mkdir -m 777 /run/transmission
diff --git a/daemon/entrypoint b/daemon/entrypoint
index 6a0a26a..bb26dcc 100755
--- a/daemon/entrypoint
+++ b/daemon/entrypoint
@@ -11,7 +11,7 @@ then
     uid="$(stat ./Downloads -c '%u')"
     gid="$(stat ./Downloads -c '%g')"
     chown "$uid:$gid" ./
-    eval "exec gosu $uid:$gid $*"
+    eval "exec su-exec $uid:$gid $*"
 else
     eval "exec $*"
 fi
-- 
GitLab