Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

docker: make container user UID and GID configurable via build ARGs - fixes #9839

Vaibhav Mashal2c4bc66e459b
diff --git a/Dockerfile b/Dockerfile
index bb0861594..3fb9ad36c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -35,6 +35,9 @@ RUN echo "**** Print Version Binary ****" && \
# Begin final image
FROM alpine:latest
+ARG RCLONE_UID=1009
+ARG RCLONE_GID=1009
+
RUN echo "**** Install Dependencies ****" && \
apk add --no-cache \
ca-certificates \
@@ -45,7 +48,7 @@ RUN echo "**** Install Dependencies ****" && \
COPY --from=builder /go/src/github.com/rclone/rclone/rclone /usr/local/bin/
-RUN addgroup -g 1009 rclone && adduser -u 1009 -Ds /bin/sh -G rclone rclone
+RUN addgroup -g "${RCLONE_GID}" rclone && adduser -u "${RCLONE_UID}" -Ds /bin/sh -G rclone rclone
ENTRYPOINT [ "rclone" ]