-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfileWithRoot
More file actions
39 lines (27 loc) · 923 Bytes
/
DockerfileWithRoot
File metadata and controls
39 lines (27 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM rootproject/root-ubuntu16:6.12
ENV ROOT_VERSION=6.12/07
# Run the following commands as super user (root):
USER root
WORKDIR /app
ADD . /app
# Install required packages for notebooks
RUN sudo ./install_software_root.sh
# Set the python path
ENV PYTHONPATH /app/lib/:/usr/local/lib/:/usr/local/lib/root/:/app/lib/python2.7/site-packages/
# Create a user that does not have root privileges
ARG username=physicist
ENV MY_UID 1000
RUN useradd --create-home --home-dir /home/${username} --uid ${MY_UID} ${username}
ENV HOME /home/${username}
# Set the cwd to /home/{username}
WORKDIR /home/${username}
# Switch to our newly created user
USER ${username}
COPY . ${HOME}
USER root
RUN chown -R ${MY_UID} ${HOME}
USER ${username}
# Allow incoming connections on port 8888
EXPOSE 8888
# Run notebook when the container launches
CMD ["jupyter", "notebook", "--ip", "0.0.0.0"]