fix user permissions on dev image

This commit is contained in:
routerino 2025-03-15 12:54:29 +11:00 committed by GitHub
parent f5df8899ee
commit 722eaa64ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -45,7 +45,7 @@ RUN chmod -R 755 scripts
RUN /staging/scripts/1-image-build.sh
# set to the non-root user
USER dev-user
USER 1000:1000
WORKDIR /data

View file

@ -4,11 +4,11 @@
# turn on bash logging, exit on error
set -ex
# create a non-root user
useradd -m -d /data/home dev-user
# # create a non-root user. Not needed for node image
# useradd -m -d /data/home dev-user
# set the default shell to the chosen shell
usermod --shell ${SHELL} dev-user
usermod --shell ${SHELL} 1000
# Add the ability to set file permissions on /data to the non-privileged user
echo "ALL ALL=NOPASSWD: /bin/chown -R 1000\:1000 /data" >> /etc/sudoers