-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
executable file
·89 lines (71 loc) · 2.62 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
85
86
87
FROM ubuntu:hirsute-20210711 as base
ENV TZ=Asia/Shanghai \
LANG=en_US.UTF-8
WORKDIR /
RUN set -eux; \
\
echo "current architecture is: $(dpkg --print-architecture)"; \
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates tzdata; \
update-ca-certificates -f; \
ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime; \
sed -i.bak 's|http://archive.ubuntu.com|https://mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list; \
sed -i 's|http://security.ubuntu.com|https://mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list; \
apt-get update; \
\
# ls for human
# Bash login shells run only /etc/profile
# Bash non-login shells run only /etc/bashrc
{ \
echo "alias l='ls -CF'"; \
echo "alias la='ls -A'"; \
echo "alias ll='ls -alhp'"; \
echo "alias ls='ls --color=auto'"; \
echo 'export EDITOR=nvim'; \
} >> /root/.bashrc; \
\
{ \
echo "alias l='ls -CF'"; \
echo "alias la='ls -A'"; \
echo "alias ll='ls -alhp'"; \
echo "alias ls='ls --color=auto'"; \
echo 'export EDITOR=nvim'; \
} >> /etc/skel/.bashrc
# ------------------------------------------------------------------------------ #
FROM base as builder
RUN set -eux; \
\
# build neovim libluajit-5.1-dev \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git gcc g++ cmake make automake autoconf pkg-config clang \
libtool libtool-bin gettext libgettextpo-dev \
unzip bzip2 curl \
python3-dev \
python3-pip \
libssl-dev \
libffi-dev
RUN set -eux; \
\
git clone https://github.com/neovim/neovim.git /tmp/neovim
RUN set -eux; \
\
cd /tmp/neovim; \
rm -rf ~/.cache/luarocks; \
CC=clang make CMAKE_EXTRA_ARGS=-DCLANG_ASAN_UBSAN=ON -j$(nproc); \
mkdir /build ; \
make DESTDIR=/build install
# ------------------------------------------------------------------------------ #
FROM base as runtime
COPY --from=builder /build/ /
COPY . /root/.config/nvim
# nvim-treesitter needs gcc, g++ and libstdc++
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends xclip curl python3 python3-pip git; \
apt-get install -y --no-install-recommends libluajit-5.1-dev liblua5.1-0-dev; \
apt-get install -y --no-install-recommends gdb gcc g++ libstdc++-10-dev; \
pip3 install --user pynvim
RUN set -eux; \
git clone https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/opt/packer.nvim
WORKDIR /root/.config/nvim
# RUN set -eux; \
# env PACKER_NON_INTERACTIVE=1 nvim -i NONE -c "lua require('packer').install()" -c "PackerCompile"