-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfileKF
95 lines (81 loc) · 2.97 KB
/
DockerfileKF
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
ARG baseimage=ubuntu:18.04
FROM $baseimage
ARG user=jovyan
ARG pythonversion=python3.8
ARG uid=1000
# to avoid cuda key err
RUN rm -f /etc/apt/sources.list.d/cuda.list
RUN rm -f /etc/apt/sources.list.d/nvidia-ml.list
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
curl \
git \
g++-8 \
htop \
iputils-ping \
libaio-dev \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev\
net-tools \
openssh-client \
$pythonversion \
python3-pip \
$pythonversion-dev \
python3-setuptools \
silversearcher-ag \
software-properties-common \
sudo \
tmux \
zsh
RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata
RUN add-apt-repository ppa:neovim-ppa/stable && \
apt-get install -y neovim && \
rm -rf /var/lib/apt/lists/*
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 700 --slave /usr/bin/g++ g++ /usr/bin/g++-7 && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8 && \
update-alternatives --install /usr/bin/python python /usr/bin/$pythonversion 1 && \
python -m pip install pip==21.0.1 && \
python -m pip install ipdb
ENV PATH="$PATH:/home/$user/.local/bin"
# create user and set required ownership
RUN useradd -M -s /bin/bash -N -u $uid $user \
&& mkdir -p /home/$user \
&& chown -R $user:users /home/$user \
&& chown -R $user:users /usr/local/bin
ENV HOME /home/$user
USER $user
# setting up zsh
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
RUN git clone https://github.com/zsh-users/zsh-autosuggestions /home/$user/.oh-my-zsh/custom/plugins/zsh-autosuggestions && \
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git /home/$user/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
COPY ./configs/zshrc /home/$user/.zshrc
# setting up neovim env
RUN python -m pip install python-language-server pylint cmake jupyterlab && \
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
COPY ./configs/init.vim /home/$user/.config/nvim/init.vim
COPY ./configs/pylintrc /home/$user/.pylintrc
RUN nvim +PlugInstall +qall
RUN python /home/$user/.vim/plugged/youcompleteme/install.py
ENV MPLCONFIGDIR="/tmp/"
# setting up tmux
RUN git clone https://github.com/tmux-plugins/tmux-yank /home/$user/.tmux/yank
COPY ./configs/tmux.conf /home/$user/.tmux.conf
ENV TERM=xterm-256color
COPY ./configs/ide_start.sh .
# setting jupyter lab
RUN pip install --no-cache-dir \
markupsafe==2.0.1 \
jupyterlab==3.4.3 \
notebook==6.4.12 \
ipykernel==6.15.0
EXPOSE 8888
ENV NB_PREFIX /
ENV DISPLAY=""
ENV TZ="Asia/Kolkata"
USER root
RUN chown -R $user:users /home/$user
USER $user
CMD ["zsh","-c", "jupyter lab --notebook-dir=/home/jovyan --ip=0.0.0.0 --no-browser --allow-root --port=8888 --NotebookApp.token='' --NotebookApp.password='' --NotebookApp.allow_origin='*' --NotebookApp.base_url=${NB_PREFIX}"]