fix(Dockerfile): create /home/noroot directory and change ownership of it

This commit is contained in:
lanvent
2023-05-09 23:08:20 +08:00
parent 0bf06ddfd3
commit 2133c1d6af
3 changed files with 5 additions and 3 deletions

View File

@@ -31,9 +31,10 @@ WORKDIR ${BUILD_PREFIX}
ADD ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh \
&& mkdir -p /home/noroot \
&& groupadd -r noroot \
&& useradd -r -g noroot -s /bin/bash -d /home/noroot noroot \
&& chown -R noroot:noroot ${BUILD_PREFIX}
&& chown -R noroot:noroot /home/noroot ${BUILD_PREFIX}
USER noroot