-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
84 lines (74 loc) · 2.68 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
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
ARG IMG_NAME=ubuntu:20.04
ARG SKIP_JUPYTER=false
FROM $IMG_NAME
SHELL ["/bin/bash", "-c"]
## To source ~/.bashrc (sh cannot execute bash files in general)
## and to enable some of bash syntax features.
LABEL maintainer="lukoshkin.workspace@gmail.com" \
repository="https://github.com/lukoshkin/evangelist" \
description="This Dockerfile is a part of 'evangelist' project"
ENV USER=${USER:-evn}
ENV HOME=${HOME:-/home/$USER} SHELL=/bin/bash
## Set SHELL to get rid of errors in Tmux.
ENV XDG_CACHE_HOME="$HOME/.cache" \
XDG_CONFIG_HOME="$HOME/.config" \
XDG_DATA_HOME="$HOME/.local/share"
USER root
RUN if ! id -u $USER &> /dev/null; then \
## Add a user if need be.
useradd -m -s /bin/bash $USER; \
fi \
&& mkdir -p "$HOME" \
"$XDG_DATA_HOME" \
"$XDG_CONFIG_HOME/evangelist" \
"$XDG_CACHE_HOME/nvim/packer.nvim"
## Install all the libraries required by evangelist.
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get -qq update \
&& apt-get install -yq \
build-essential libssl-dev cmake \
pkg-config automake libtool-bin gettext \
locales x11-xserver-utils uuid-runtime \
git tmux wget curl ruby-full ripgrep tree \
python3 python3-dev python3-pip \
# zsh \
# && chsh -s $(which zsh) \
&& curl -fsSL https://deb.nodesource.com/setup_current.x | bash - \
&& apt-get install -yq nodejs \
&& locale-gen en_US.UTF-8 \
&& rm -rf /var/lib/apt/lists/*
## Install Neovim (latest version)
## NOTE: `pkg-config automake libtool-bin gettext` might be
## removed after the installation of Neovim from source.
RUN git clone https://github.com/neovim/neovim \
&& cd neovim && git checkout stable \
&& make CMAKE_BUILD_TYPE=Release \
&& make install \
&& npm install -g neovim \
&& gem install neovim \
&& cd .. && rm -rf neovim \
## Ensure everything in HOME belongs to USER.
&& chown -R $USER:$(id -gn $USER) "$HOME"
## Install Jupyter and its extensions
RUN if ! $SKIP_JUPYTER; then \
pip3 install --no-cache-dir --upgrade \
pip \
pynvim \
jupyter \
jupyter_contrib_nbextensions \
jupyter_nbextensions_configurator; \
fi
USER $USER
COPY --chown=$USER . "$XDG_CONFIG_HOME/evangelist/"
## We need to source ~/.bashrc if conda is used.
RUN . ~/.bashrc \
# . ~/.zshrc \
&& cd $XDG_CONFIG_HOME/evangelist \
&& ./evangelist.sh install+ bash+ \
# && ./evangelist.sh install+ zsh+ \
&& if ! $SKIP_JUPYTER; then \
./evangelist.sh install jupyter; \
fi
## WORKDIR is commented out, since the image is used on top of another,
## and we may want to preserve the original value.
# WORKDIR $HOME