-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
96 lines (82 loc) · 3.05 KB
/
Copy pathDockerfile
File metadata and controls
96 lines (82 loc) · 3.05 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
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
96
FROM ruby:3.3.0
MAINTAINER Yanhao Yang <yanhao.yang@gmail.com>
# Development tools
RUN \
apt-get update && \
apt-get install -y apt-transport-https && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
# for build vim
libncurses5-dev libncursesw5-dev \
python3-dev ruby-dev lua5.1 liblua5.1-dev \
zsh silversearcher-ag locales sudo less netcat-openbsd tmux \
&& \
apt-get autoremove -y && \
apt-get autoclean && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN \
chsh --shell /bin/zsh && \
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
locale-gen && \
groupadd --gid 1000 docker && \
useradd --gid 1000 --uid 1000 --create-home docker && \
echo "docker ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/user && \
chmod 0440 /etc/sudoers.d/user && \
# build vim
cd /tmp && \
git clone https://github.com/vim/vim.git && \
cd /tmp/vim && git checkout v8.2.1222 && \
./configure \
--with-features=huge \
--enable-multibyte \
--enable-rubyinterp=yes \
--enable-python3interp=yes \
--with-python3-config-dir=/usr/lib/python3.4/config-3.4m-x86_64-linux-gnu \
--enable-luainterp=yes \
--enable-cscope \
&& \
make && \
make install && \
cd ~ && \
rm -rf /tmp/*
ENV TERM=xterm-256color
# To make oh-my-zsh installer happy
ENV SHELL=/usr/bin/zsh
USER docker
# nvm && yarn
ENV NODE_VERSION v20.14.0
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.38.0/install.sh | bash && \
bash -c "\
source $HOME/.nvm/nvm.sh && \
nvm install $NODE_VERSION && \
nvm use $NODE_VERSION && \
npm install -g yarn && \
echo 'export NVM_DIR=\"$HOME/.nvm\"' >> ~/.zshrc.local && \
echo '[ -s \"\$NVM_DIR/nvm.sh\" ] && . \"\$NVM_DIR/nvm.sh\"' >> ~/.zshrc.local && \
echo 'nvm use $NODE_VERSION' >> ~/.zshrc.local"
RUN \
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" && \
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting && \
git clone https://github.com/zsh-users/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions && \
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf && \
~/.fzf/install --all && \
gem install ripper-tags && \
gem install webrick
COPY --chown=docker:docker bin/gs /usr/local/bin/gs
COPY --chown=docker:docker bin/nb /usr/local/bin/nb
COPY --chown=docker:docker bin/dummy_server /usr/local/bin/dummy_server
COPY --chown=docker:docker bin/install-protoc.sh /usr/local/bin/install-protoc.sh
COPY --chown=docker:docker config/zshrc /home/docker/.zshrc
COPY --chown=docker:docker config/irbrc /home/docker/.irbrc
COPY --chown=docker:docker config/vim /home/docker/.vim
RUN bash -c "\
source $HOME/.nvm/nvm.sh && \
cd ~/.vim && ./setup.sh"
# tmux new-session -c $PWD
RUN cd && \
git clone https://github.com/gpakosz/.tmux.git && \
ln -s -f .tmux/.tmux.conf && \
cp .tmux/.tmux.conf.local .
EXPOSE 3000
CMD ["/usr/local/bin/dummy_server"]