-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
55 lines (34 loc) · 1.38 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 ubuntu
# if you want to use GPU, you only need to change from Image and provide your own NVIDIA CUDA base Image
# FROM nvidia/cuda:12.0.1-cudnn8-devel-ubuntu22.04
RUN apt-get update && apt-get install -y wget git curl nano vim htop nodejs && rm -rf /var/lib/apt/lists/*
# change default shell to bash
RUN ln -sf /bin/bash /bin/sh
# installing Nodejs is necessary for jupyterlab to work correctly
RUN useradd -ms /bin/bash user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:${PATH}
WORKDIR ${HOME}/app
ENV PATH="${HOME}/miniconda3/bin:${PATH}"
ARG PATH="${HOME}/miniconda3/bin:${PATH}"
RUN wget \
https://repo.anaconda.com/miniconda/Miniconda3-py311_24.1.2-0-Linux-x86_64.sh \
&& mkdir ${HOME}/.conda \
&& bash Miniconda3-py311_24.1.2-0-Linux-x86_64.sh -b \
&& rm -f Miniconda3-py311_24.1.2-0-Linux-x86_64.sh
RUN conda install nb_conda_kernels -y
RUN conda install -c conda-forge jupyterlab ipywidgets -y
RUN pip install jupyter
ENV JUPYTER_PORT=8888 \
TOKEN=docker \
SHELL=/bin/bash \
PATH="${HOME}/miniconda3/bin:${PATH}"
# install oh-my-bash
RUN bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)"
RUN conda init bash
RUN echo "export PATH=$PATH" >> ${HOME}/.bashrc
EXPOSE $JUPYTER_PORT
WORKDIR ${HOME}/app
COPY --chown=1000 entry_point.sh /entry/entry_point.sh
CMD ["/entry/entry_point.sh"]