From a4fc6e11d0e03b3ec6449fe0b2ad03e71b195bc0 Mon Sep 17 00:00:00 2001 From: Andrew Hurley Date: Tue, 9 Aug 2022 22:02:26 +0800 Subject: [PATCH] Dockerfile - change UID of www-data rather than copy passwd and group --- Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1e4e388..c2e22df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,9 @@ ARG VERSION="latest" +ARG PUID="33" FROM docker.io/library/nextcloud:$VERSION -COPY ncloud-passwd /etc/password -COPY ncloud-group /etc/group +RUN \ + if [[ $PUID != "33" ]]; then \ + usermod --uid $PUID www-data && \ + chown -R www-data /var/www/ \ + fi