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
parent
fc355ca6b9
commit
93623e8cc2
|
@ -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}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ services:
|
|||
dockerfile: ./docker/Dockerfile
|
||||
args:
|
||||
- username=devel
|
||||
- userid=1000
|
||||
container_name: handson-ml
|
||||
image: handson-ml
|
||||
logging:
|
||||
|
|
Loading…
Reference in New Issue