-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
37 lines (25 loc) · 991 Bytes
/
Dockerfile
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
ARG TARGET
FROM tensorflow/tensorflow:2.4.1$TARGET-jupyter
RUN apt-get update
# create Kaladin user
RUN useradd kaladin -u 1002 && \
apt-get install sudo && \
usermod -aG sudo kaladin && \
# Disable sudo login for the new kaladin user.
echo "kaladin ALL = NOPASSWD : ALL" >> /etc/sudoers
USER kaladin
WORKDIR /home/kaladin
RUN sudo chown -R kaladin /home/kaladin
# Update pip: https://packaging.python.org/tutorials/installing-packages/#ensure-pip-setuptools-and-wheel-are-up-to-date
RUN sudo -H python3 -m pip install --upgrade pip setuptools wheel
# By copying over requirements first, we make sure that Docker will "cache"
# our installed requirements in a dedicated FS layer rather than reinstall
# them on every build
COPY --chown=kaladin requirements.txt requirements.txt
# Install the requirements
RUN sudo -H python3 -m pip install -r requirements.txt
COPY --chown=kaladin src src
# Only needed for Jupyter
EXPOSE 8888
WORKDIR /home/kaladin/src
ENTRYPOINT ["./start.sh"]