Dockerfile argument to set container user UID

The UID of created user should be set to the UID of the user that will
be running the image/container to set appropriate permissions on files
within notebooks directory. Default 1000 should be ok for users using
the default account created while installing linux.
main
ziembla 2017-11-28 10:33:20 +01:00
parent fc355ca6b9
commit 93623e8cc2
2 changed files with 3 additions and 1 deletions

View File

@ -13,8 +13,9 @@ RUN conda install -y -c conda-forge \
jupyter_contrib_nbextensions
ARG username
ARG userid
RUN adduser ${username} --gecos '' --disabled-password && \
RUN adduser ${username} --uid ${userid} --gecos '' --disabled-password && \
echo "${username} ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/${username} && \
chmod 0440 /etc/sudoers.d/${username}

View File

@ -6,6 +6,7 @@ services:
dockerfile: ./docker/Dockerfile
args:
- username=devel
- userid=1000
container_name: handson-ml
image: handson-ml
logging: