-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
base.Dockerfile
77 lines (74 loc) · 2.08 KB
/
base.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Build arguments
ARG CUDA_VER=12.4.1
ARG UBUNTU_VER=22.04
# Download the base image
FROM nvidia/cuda:${CUDA_VER}-cudnn-runtime-ubuntu${UBUNTU_VER}
# you can check for all available images at https://hub.docker.com/r/nvidia/cuda/tags
# Install as root
USER root
# Shell
SHELL ["/bin/bash", "--login", "-o", "pipefail", "-c"]
# Install dependencies
ARG DEBIAN_FRONTEND="noninteractive"
ARG USERNAME=coder
ARG USERID=1000
ARG GROUPID=1000
RUN apt-get update && apt-get install -y --no-install-recommends \
bash \
bash-completion \
ca-certificates \
curl \
git \
htop \
nano \
nvidia-modprobe \
nvtop \
openssh-client \
python3 python3-dev python3-pip python-is-python3 \
sudo \
tmux \
unzip \
vim \
wget \
zip && \
apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Download and install zellij
RUN curl -L -o zellij.tar.gz https://github.com/zellij-org/zellij/releases/download/v0.40.1/zellij-x86_64-unknown-linux-musl.tar.gz && \
tar -xzf zellij.tar.gz -C /usr/local/bin && \
rm zellij.tar.gz && \
zellij --version
# Add a user `${USERNAME}` so that you're not developing as the `root` user
RUN groupadd -g ${GROUPID} ${USERNAME} && \
useradd ${USERNAME} \
--create-home \
--uid ${USERID} \
--gid ${GROUPID} \
--shell=/bin/bash && \
echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" >>/etc/sudoers.d/nopasswd
# Change to your user
USER ${USERNAME}
# Chnage Workdir
WORKDIR /home/${USERNAME}
# Install packages inside the new environment
RUN pip install --upgrade --no-cache-dir pip setuptools wheel && \
pip install --upgrade --no-cache-dir \
ipywidgets \
jupyterlab \
matplotlib \
nltk \
notebook \
numpy \
pandas \
Pillow \
plotly \
PyYAML \
scipy \
scikit-image \
scikit-learn \
sympy \
seaborn \
tqdm && \
pip cache purge && \
# Set path of python packages
echo "# Set path of python packages" >>/home/${USERNAME}/.bashrc && \
echo 'export PATH=$HOME/.local/bin:$PATH' >>/home/${USERNAME}/.bashrc