File tree 3 files changed +14
-5
lines changed
3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,6 @@ FROM python:3.6-slim-stretch
2
2
3
3
LABEL maintainer=
"Simon Kassel <[email protected] >"
4
4
5
- WORKDIR /opt/src/
6
-
7
5
ADD requirements.txt /tmp/requirements.txt
8
6
9
7
RUN apt-get update && \
@@ -41,6 +39,17 @@ ENV PYTHONPATH="$PYTHONPATH:/opt/src/"
41
39
# Open Ports for Jupyter
42
40
EXPOSE 8888
43
41
42
+ RUN useradd -d /home/user -m -s /bin/bash user && echo "user:user" | chpasswd && adduser user sudo
43
+
44
+ # start working in the "tester" home directory
45
+ WORKDIR /home/user
46
+
47
+ # Make the files owned by tester
48
+ RUN chown -R user:user /home/user
49
+
50
+ # Switch to your new user in the docker image
51
+ USER user
52
+
44
53
# Run a shell script
45
54
CMD ["/bin/bash" ]
46
55
Original file line number Diff line number Diff line change 3
3
# run container
4
4
docker run -it --rm \
5
5
-p 8888:8888 \
6
- -v $( pwd $1 ) :/opt/src :rw \
6
+ -v $( pwd $1 ) :/home/user :rw \
7
7
da-project \
8
- jupyter notebook --allow-root --port=8888 --ip=0.0.0.0
8
+ jupyter notebook --allow-root --port=8888 --ip=0.0.0.0 --notebook-dir=/home/user/notebooks
Original file line number Diff line number Diff line change 3
3
# run container
4
4
docker run -it --rm \
5
5
-p 8888:8888 \
6
- -v $( pwd $1 ) :/opt/src :rw \
6
+ -v $( pwd $1 ) :/home/user :rw \
7
7
da-project
8
8
You can’t perform that action at this time.
0 commit comments