forked from Swarmies/fast.ai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
56 lines (42 loc) · 1.54 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
FROM quay.io/jupyter/base-notebook
USER root
# Install the required packages
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
curl \
git \
libssl-dev \
libffi-dev \
python3-dev \
&& apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN mamba install --quiet --yes \
'numpy' \
'pandas' \
'matplotlib'
ARG DEFAULT_USER=default_value
# Set the default user
ENV DEFAULT_USER ${DEFAULT_USER}
# Copy everything from /home/jovyan to /home/$USER
RUN mkdir -p /home/${DEFAULT_USER} && \
cp -r /home/jovyan/* /home/${DEFAULT_USER}/ && \
chown -R ${NB_UID}:${NB_GID} /home/${DEFAULT_USER}
# Install in the default python3 environment
RUN pip install --no-cache-dir 'flake8' && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${DEFAULT_USER}"
# Install from the requirements.txt file
COPY --chown=${NB_UID}:${NB_GID} requirements.txt /tmp/
RUN pip install --no-cache-dir --requirement /tmp/requirements.txt
# create a symlink to the default .bashrc file
RUN ln -s /home/jovyan/.bashrc /home/${DEFAULT_USER}/.bashrc
RUN ln -s /home/jovyan/.bash_logout /home/${DEFAULT_USER}/.bash_logout
RUN ln -s /home/jovyan/.cache /home/${DEFAULT_USER}/.cache
RUN ln -s /home/jovyan/.conda /home/${DEFAULT_USER}/.conda
RUN ln -s /home/jovyan/.jupyter /home/${DEFAULT_USER}/.jupyter
RUN ln -s /home/jovyan/.npm /home/${DEFAULT_USER}/.npm
RUN ln -s /home/jovyan/.profile /home/${DEFAULT_USER}/.profile
USER ${DEFAULT_USER}
# Set the working directory
WORKDIR /home/${DEFAULT_USER}/work