Skip to content

Commit cbb9494

Browse files
authored
Merge pull request #65 from aurel-g/aurel-g-patch-1
Improving permissions management / startup time on some systems
2 parents cd62100 + 7d78a1d commit cbb9494

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ RUN mkdir -p ${BASE_DIR}\temp ${SD_INSTALL_DIR} ${BASE_DIR}/outputs
3232

3333
ADD parameters/* ${SD_INSTALL_DIR}/parameters/
3434

35+
RUN groupmod -g 1000 abc && \
36+
usermod -u 1000 abc
37+
3538
COPY --chown=abc:abc *.sh ./
3639

3740
RUN chmod +x /entry.sh
@@ -46,7 +49,7 @@ RUN cd /tmp && \
4649
bash Miniconda3-latest-Linux-x86_64.sh -b && \
4750
rm Miniconda3-latest-Linux-x86_64.sh && \
4851
chown -R abc:abc /root && \
49-
chown -R abc:abc ${SD_INSTALL_DIR}
50-
52+
chown -R abc:abc ${SD_INSTALL_DIR} && \
53+
chown -R abc:abc /home/abc
5154

5255
EXPOSE 9000/tcp

docker/root/etc/s6-overlay/s6-rc.d/init-chown/run

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
#echo "-------------------------------------"
44
# permissions
55
#echo "chown'ing home directory to ensure correct permissions."
6-
chown -R abc:abc /home/abc
6+
find /home/abc -type d \( ! -user abc -o ! -group abc \) -exec chown -R abc:abc {} \;
7+
find /home/abc -type f \( ! -user abc -o ! -group abc \) -exec chown abc:abc {} \;
78
#echo "Done!"
89
#echo -e "-------------------------------------\n"
910

@@ -19,4 +20,4 @@ find $BASE_DIR -type d -exec chmod 777 {} +
1920
echo Delete this file to reset access rights at next launch > $BASE_DIR/'Delete_this_file_to_reset_access_rights_at_next_launch'
2021
echo "Done!"
2122
echo -e "-------------------------------------\n"
22-
fi
23+
fi

0 commit comments

Comments
 (0)