diff --git a/Dockerfile b/Dockerfile index 6285f1e..5ebc688 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,6 +32,9 @@ RUN mkdir -p ${BASE_DIR}\temp ${SD_INSTALL_DIR} ${BASE_DIR}/outputs ADD parameters/* ${SD_INSTALL_DIR}/parameters/ +RUN groupmod -g 1000 abc && \ + usermod -u 1000 abc + COPY --chown=abc:abc *.sh ./ RUN chmod +x /entry.sh @@ -46,7 +49,7 @@ RUN cd /tmp && \ bash Miniconda3-latest-Linux-x86_64.sh -b && \ rm Miniconda3-latest-Linux-x86_64.sh && \ chown -R abc:abc /root && \ - chown -R abc:abc ${SD_INSTALL_DIR} - + chown -R abc:abc ${SD_INSTALL_DIR} && \ + chown -R abc:abc /home/abc EXPOSE 9000/tcp diff --git a/docker/root/etc/s6-overlay/s6-rc.d/init-chown/run b/docker/root/etc/s6-overlay/s6-rc.d/init-chown/run index efa61ef..b857b57 100755 --- a/docker/root/etc/s6-overlay/s6-rc.d/init-chown/run +++ b/docker/root/etc/s6-overlay/s6-rc.d/init-chown/run @@ -3,7 +3,8 @@ #echo "-------------------------------------" # permissions #echo "chown'ing home directory to ensure correct permissions." -chown -R abc:abc /home/abc +find /home/abc -type d \( ! -user abc -o ! -group abc \) -exec chown -R abc:abc {} \; +find /home/abc -type f \( ! -user abc -o ! -group abc \) -exec chown abc:abc {} \; #echo "Done!" #echo -e "-------------------------------------\n" @@ -19,4 +20,4 @@ find $BASE_DIR -type d -exec chmod 777 {} + echo Delete this file to reset access rights at next launch > $BASE_DIR/'Delete_this_file_to_reset_access_rights_at_next_launch' echo "Done!" echo -e "-------------------------------------\n" -fi \ No newline at end of file +fi