-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
68 lines (54 loc) · 2.87 KB
/
Copy pathDockerfile
File metadata and controls
68 lines (54 loc) · 2.87 KB
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
FROM alpine:latest as build
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
RUN apk add -U --no-cache build-base ncurses-dev py3-pip python3-dev git bash cmake
WORKDIR /root/tmp/
# gtags
RUN wget https://www.tamacom.com/global/global-6.6.5.tar.gz && tar xvf global-6.6.5.tar.gz && \
cd global-6.6.5 && ./configure && make -j8 && make install-exec DESTDIR=/root/tmp/global/install
COPY pyreq.txt /root/tmp/
RUN pip install -r pyreq.txt --prefix=/root/tmp/pipinstall
#Leaderf plugin that need build
RUN git clone https://github.com/Yggdroot/LeaderF.git && cd LeaderF && ./install.sh
#################################### deploy ##############################
# ssh rg git nvim fish fzf tmux gtags
FROM alpine:latest as deploy
COPY --from=build /root/tmp/global/install/usr/local/bin/ /usr/local/bin/
COPY --from=build /root/tmp/pipinstall /usr/
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
RUN apk add -U --no-cache \
neovim git \
fish tmux openssh-client bash \
tree curl less ripgrep perl py3-pip tar npm findutils tig ctags \
clang-extra-tools
ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8
# TERM
ENV TERM=xterm-256color
#tmux config
WORKDIR /root/
RUN git clone https://github.com/gpakosz/.tmux.git && ln -s -f .tmux/.tmux.conf && cp .tmux/.tmux.conf.local .
COPY tmux.conf.local /root/.tmux.conf.local
#nvim
RUN npm install -g neovim
RUN 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'
WORKDIR /root/.config/nvim/
RUN git clone https://github.com/sheeaza/nvim.config.git .
RUN nvim --headless +PlugInstall +qall && nvim --headless '+CocInstall -sync coc-clangd' +qall
COPY --from=build /root/tmp/LeaderF/autoload/leaderf/python/ /root/.local/share/nvim/plugged/LeaderF/autoload/leaderf/python/
ENV VIRTUAL=nvim
ENV EDITOR=nvim
# fish
RUN curl -L https://get.oh-my.fish > install && fish install --noninteractive --yes && rm install
RUN fish -c 'omf install clearance' && fish -c 'set -Ux EDITOR nvim' && fish -c 'set -Ux VISUAL nvim' && \
fish -c 'alias -s l="ls --group-directories-first"' && \
fish -c 'alias -s la="l -a"' && fish -c 'alias -s ll="l -lh"' && fish -c 'alias -s lla="ll -a"' && \
fish -c 'alias -s git-root="cd (git rev-parse --show-toplevel)"' && \
fish -c 'set -U fish_user_paths /root/bin $fish_user_paths' && \
mkdir -p /root/.local/share/fish/generated_completions #see https://github.com/fish-shell/fish-shell/issues/7183
COPY fish_prompt.fish /root/.local/share/omf/themes/clearance/fish_prompt.fish
# fzf
RUN git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf && ~/.fzf/install --all
# switch shell to fish
RUN sed -i 's/\/root:\/bin\/ash/\/root:\/usr\/bin\/fish/g' /etc/passwd
WORKDIR /root/
ENTRYPOINT ["/usr/bin/fish"]