-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdockerfile_centos
executable file
·320 lines (267 loc) · 14.5 KB
/
dockerfile_centos
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
FROM centos:8
MAINTAINER SmartBrave <SmartBraveCoder@gmail.com>
ARG NORMAL_USER=test_user
ARG NORMAL_PASSWD=test_passwd
ARG ROOT_PASSWD=root_passwd
ARG PROXY
ENV HOME=/home/$NORMAL_USER \
GOPATH=/home/$NORMAL_USER/code \
CLONE_PATH=/usr/local/src \
APP_PATH=/usr/local/app \
BIN_PATH=/usr/local/bin \
ALL_PROXY=${PROXY}
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \
&& sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
RUN dnf -y install dnf-plugins-core \
&& dnf config-manager --set-enabled powertools \
&& dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo \
&& dnf localinstall -y https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm \
&& dnf -y update \
&& dnf -y install epel-release \
&& dnf -y install libgcc.i686 glibc-devel bison flex texinfo libtool \
zlib-devel bzip2-devel openssl-devel sqlite-devel readline-devel tk-devel \
gdbm-devel xz-devel gettext pkg-config autoconf automake txt2man ncurses ncurses-devel \
tcl-devel net-tools llvm clang-libs clang-devel which libX11-devel libXcursor-devel libXrandr-devel \
libXinerama-devel mesa-libGL-devel mesa-libGLU-devel freeglut-devel libXi-devel libevent \
libevent-devel asciidoc pcre-devel xz-devel bind-utils freetype-devel glib2-devel fontconfig-devel \
pango-devel libwebp-devel libde265 libheif* privoxy initscripts cscope SDL2-devel x264-devel x264-libs \
&& dnf -y --skip-broken install libpng libpng-devel libjpeg-devel ghostscript-devel libtiff-devel libwmf-devel \
protobuf-devel mesa-dri-drivers coreutils \
&& dnf -y groupinstall "Development Tools" \
&& dnf -y install git sudo gcc gcc-c++ gdb make unzip ctags vim expect passwd wget cmake figlet ncdu \
nnn gh kakoune colordiff git-lfs the_silver_searcher ack fortune-mod \
&& dnf -y install perl nodejs rust python2 python2-pip python2-devel \
python3 python3-pip python3-devel ruby lua luajit zsh \
&& dnf -y remove mesa-libGL mesa-libGL-devel \
&& ln -s /usr/bin/python3 /usr/bin/python \
&& ln -s /usr/bin/pip3 /usr/bin/pip \
&& sed -i '/Defaults/s/env_reset/\!env_reset/g' /etc/sudoers \
&& useradd --create-home $NORMAL_USER --password $NORMAL_PASSWD && echo "$NORMAL_USER ALL=(ALL) NOPASSWD:ALL" >>/etc/sudoers \
&& echo "root:$ROOT_PASSWD" | chpasswd \
&& mkdir ${APP_PATH} \
&& chmod a+w ${CLONE_PATH} ${APP_PATH} ${BIN_PATH} \
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
USER $NORMAL_USER
WORKDIR ${HOME}
RUN mkdir $GOPATH
RUN git clone https://github.com/ImageMagick/ImageMagick ${CLONE_PATH}/ImageMagick \
&& cd ${CLONE_PATH}/ImageMagick \
&& git checkout 7.1.0-36 \
&& ./configure --prefix=${APP_PATH}/ImageMagick --with-heic=yes --with-jxl=yes --with-jpeg=yes --with-png=yes --with-webp=yes \
&& make -j $(nproc) \
&& make install \
&& ln -s ${APP_PATH}/ImageMagick/bin/magick ${BIN_PATH}/magick \
&& ln -s ${APP_PATH}/ImageMagick/bin/animate ${BIN_PATH}/animate \
&& ln -s ${APP_PATH}/ImageMagick/bin/compare ${BIN_PATH}/compare \
&& ln -s ${APP_PATH}/ImageMagick/bin/composite ${BIN_PATH}/composite \
&& ln -s ${APP_PATH}/ImageMagick/bin/conjure ${BIN_PATH}/conjure \
&& ln -s ${APP_PATH}/ImageMagick/bin/convert ${BIN_PATH}/convert \
&& ln -s ${APP_PATH}/ImageMagick/bin/display ${BIN_PATH}/display \
&& ln -s ${APP_PATH}/ImageMagick/bin/identify ${BIN_PATH}/identify \
&& ln -s ${APP_PATH}/ImageMagick/bin/import ${BIN_PATH}/import \
&& ln -s ${APP_PATH}/ImageMagick/bin/magick-script ${BIN_PATH}/magick-script \
&& ln -s ${APP_PATH}/ImageMagick/bin/mogrify ${BIN_PATH}/mogrify \
&& ln -s ${APP_PATH}/ImageMagick/bin/montage ${BIN_PATH}/montage \
&& ln -s ${APP_PATH}/ImageMagick/bin/stream ${BIN_PATH}/stream
RUN cd ${CLONE_PATH} \
&& curl -OL https://github.com/wagoodman/dive/releases/download/v0.9.2/dive_0.9.2_linux_amd64.rpm \
&& sudo rpm -i dive_0.9.2_linux_amd64.rpm
RUN cd ${CLONE_PATH} \
&& wget https://github.com/rgburke/grv/releases/download/v0.3.2/grv_v0.3.2_linux64 \
&& chmod +x grv_v0.3.2_linux64 \
&& cp grv_v0.3.2_linux64 ${APP_PATH}/grv
RUN cd ${CLONE_PATH} \
&& wget https://github.com/axel-download-accelerator/axel/releases/download/v2.17.7/axel-2.17.7.tar.gz \
&& tar -zxvf axel-2.17.7.tar.gz \
&& cd axel-2.17.7 \
&& cd ${CLONE_PATH}/axel-2.17.7 \
&& ./configure --prefix=${APP_PATH}/axel-2.17.7 \
&& make -j $(nproc) \
&& make install \
&& ln -s ${APP_PATH}/axel-2.17.7/bin/axel ${BIN_PATH}/axel
RUN git clone https://github.com/jarun/bcal ${CLONE_PATH}/bcal \
&& cd ${CLONE_PATH}/bcal \
&& make -j $(nproc) \
&& make strip install PREFIX=${APP_PATH}/bcal
RUN git clone https://github.com/so-fancy/diff-so-fancy ${APP_PATH}/diff-so-fancy \
&& ln -s ${APP_PATH}/diff-so-fancy/diff-so-fancy ${BIN_PATH}/diff-so-fancy
RUN git clone https://github.com/dylanaraps/fff ${CLONE_PATH}/fff \
&& cd ${CLONE_PATH}/fff \
&& make PREFIX=${APP_PATH}/fff install \
&& ln -s ${APP_PATH}/fff/bin/fff ${BIN_PATH}/fff
RUN git clone https://github.com/golbin/git-commander ${CLONE_PATH}/git-commander \
&& cd ${CLONE_PATH}/git-commander \
&& sudo npm -g install blessed lodash git-commander
RUN git clone https://github.com/hishamhm/htop ${CLONE_PATH}/htop \
&& cd ${CLONE_PATH}/htop \
&& ./autogen.sh \
&& ./configure --prefix=${APP_PATH}/htop \
&& make -j $(nproc) \
&& make install \
&& ln -s ${APP_PATH}/htop/bin/htop ${BIN_PATH}/htop
RUN git clone https://github.com/stedolan/jq ${CLONE_PATH}/jq \
&& cd ${CLONE_PATH}/jq \
&& git submodule update --init \
&& autoreconf -fi \
&& ./configure --prefix=${APP_PATH}/jq --with-oniguruma=builtin \
&& make -j $(nproc) \
&& make check \
&& make install \
&& ln -s ${APP_PATH}/jq/bin/jq ${BIN_PATH}/jq
RUN git clone https://github.com/hackerb9/lsix ${APP_PATH}/lsix \
&& ln -s ${APP_PATH}/lsix ${BIN_PATH}/lsix
RUN git clone https://github.com/facebook/PathPicker ${APP_PATH}/PathPicker \
&& ln -s ${APP_PATH}/PathPicker/fpp ${BIN_PATH}/fpp
RUN git clone https://github.com/jonas/tig ${CLONE_PATH}/tig \
&& cd ${CLONE_PATH}/tig \
&& make prefix=${APP_PATH}/tig \
&& make install prefix=${APP_PATH}/tig \
&& ln -s ${APP_PATH}/tig/bin/tig ${BIN_PATH}/tig
RUN git clone https://github.com/tmux/tmux ${CLONE_PATH}/tmux \
&& cd ${CLONE_PATH}/tmux \
&& sh autogen.sh \
&& ./configure --prefix=${APP_PATH}/tmux \
&& make -j $(nproc) \
&& make install \
&& ln -s ${APP_PATH}/tmux/bin/tmux ${BIN_PATH}/tmux
RUN git clone https://github.com/andreafrancia/trash-cli ${CLONE_PATH}/trash-cli \
&& cd ${CLONE_PATH}/trash-cli \
&& sudo python setup.py install
RUN git clone https://github.com/vifm/vifm ${CLONE_PATH}/vifm \
&& cd ${CLONE_PATH}/vifm \
&& ./scripts/fix-timestamps \
&& ./configure --prefix=${APP_PATH}/vifm \
&& make \
&& make install \
&& ln -s ${APP_PATH}/vifm/bin/vifm ${BIN_PATH}/vifm
RUN git clone https://github.com/mptre/yank ${CLONE_PATH}/yank \
&& cd ${CLONE_PATH}/yank \
&& make install PREFIX=${APP_PATH}/yank \
&& ln -s ${APP_PATH}/yank/bin/yank ${BIN_PATH}/yank
RUN wget https://github.com/sharkdp/insect/releases/download/v5.3.0/insect-linux-x64 -O ${APP_PATH}/insect-linux-x64 \
&& ln -s ${APP_PATH}/insect-linux-x64 ${BIN_PATH}/insect
RUN cd ${CLONE_PATH} \
&& wget https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz \
&& tar xf shellcheck-stable.linux.x86_64.tar.xz \
&& ln -s ./shellcheck-stable/shellcheck ${BIN_PATH}/shellcheck
RUN git clone https://github.com/bobthecow/git-flow-completion.git ${APP_PATH}/git-flow-completion
RUN git clone https://github.com/arzzen/git-quick-stats.git ${CLONE_PATH}/git-quick-stats \
&& cd ${CLONE_PATH}/git-quick-stats \
&& make install PREFIX=${APP_PATH}/git-quick-stats \
&& ln -s ${APP_PATH}/git-quick-stats ${BIN_PATH}/git-quick-stats
RUN git clone https://github.com/brendangregg/FlameGraph.git ${APP_PATH}/FlameGraph
RUN git clone https://github.com/libsdl-org/SDL.git ${CLONE_PATH}/sdl \
&& cd ${CLONE_PATH}/sdl \
&& ./configure --prefix=${APP_PATH}/sdl \
&& make -j $(nproc) \
&& make install
RUN git clone https://git.ffmpeg.org/ffmpeg.git ${CLONE_PATH}/ffmpeg \
&& cd ${CLONE_PATH}/ffmpeg \
&& PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${APP_PATH}/sdl/lib/pkgconfig ./configure --prefix=${APP_PATH}/ffmpeg --enable-gpl --enable-libx264 --disable-x86asm --extra-cflags=-I${APP_PATH}/sdl/include --extra-ldflags=-L${APP_PATH}/sdl/lib --enable-shared \
&& make -j $(nproc) \
&& make install \
&& sudo ln -s ${APP_PATH}/ffmpeg/bin/ffmpeg ${BIN_PATH}/ffmpeg \
&& sudo ln -s ${APP_PATH}/ffmpeg/bin/ffprobe ${BIN_PATH}/ffprobe \
&& sudo ln -s ${APP_PATH}/ffmpeg/bin/ffplay ${BIN_PATH}/ffplay
RUN git clone https://github.com/vim/vim.git ${CLONE_PATH}/vim \
&& cd ${CLONE_PATH}/vim \
&& ./configure --prefix=${APP_PATH}/vim --with-features=huge --enable-multibyte --enable-python3interp=yes --with-python3-config-dir=/usr/lib64/python3.6/config-3.6m-x86_64-linux-gnu --enable-gui=gtk2 --enable-cscope \
&& make -j $(nproc) \
&& make install \
&& sudo mv /usr/bin/vim /usr/bin/vim.bak \
&& ln -s ${APP_PATH}/vim/bin/vim ${BIN_PATH}/vim \
&& ln -s ${APP_PATH}/vim/bin/vimdiff ${BIN_PATH}/vimdiff \
&& ln -s ${APP_PATH}/vim/bin/xxd ${BIN_PATH}/xxd \
&& hash -r
RUN curl -LSfs https://raw.githubusercontent.com/cantino/mcfly/master/ci/install.sh | sh -s -- --git cantino/mcfly
RUN git clone https://github.com/mobile-shell/mosh ${CLONE_PATH}/mosh \
&& cd ${CLONE_PATH}/mosh \
&& ./autogen.sh \
&& ./configure --prefix=${APP_PATH}/mosh \
&& make \
&& make install \
&& ln -s ${APP_PATH}/mosh/bin/mosh ${BIN_PATH}/mosh \
&& ln -s ${APP_PATH}/mosh/bin/mosh-client ${BIN_PATH}/mosh-client \
&& ln -s ${APP_PATH}/mosh/bin/mosh-server ${BIN_PATH}/mosh-server
#nodejs
RUN sudo npm install -g fx fx-completion cloc svg-term-cli zx @squoosh/cli bash-language-server
#python
RUN unset ALL_PROXY && sudo python -m pip install --upgrade setuptools pip \
&& sudo pip2 install percol flvlib \
&& sudo pip3 install --upgrade httpie pybind11 iredis ranger-fm mdv thefuck mycli asciinema http-prompt yapf icdiff
RUN ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
#go
RUN wget https://dl.google.com/go/go1.18.linux-amd64.tar.gz -O ${CLONE_PATH}/go1.18.linux-amd64.tar.gz \
&& tar -zxvf ${CLONE_PATH}/go1.18.linux-amd64.tar.gz -C ${APP_PATH} \
&& ln -s ${APP_PATH}/go/bin/go ${BIN_PATH}/go \
&& ln -s ${APP_PATH}/go/bin/gofmt ${BIN_PATH}/gofmt
RUN go install github.com/tomnomnom/gron@latest \
&& go install github.com/jingweno/ccat@latest \
&& go install github.com/go-delve/delve/cmd/dlv@latest \
&& go install github.com/mikefarah/yq/v4@latest \
&& go install github.com/cheat/cheat/cmd/cheat@latest \
&& go install github.com/wader/fq@latest \
&& go install github.com/mikefarah/yq/v4@latest \
&& go install github.com/jesseduffield/lazydocker@latest
#&& go get -u -v github.com/liamg/aminal \
RUN git clone https://github.com/adwpc/xvim.git ${CLONE_PATH}/xvim \
&& cd ${CLONE_PATH}/xvim \
&& yes | ./install vimrc
#TODO: need to update your user_name and email in .gitconfig
RUN git clone https://github.com/SmartBrave/dev-env-linux ${CLONE_PATH}/dev-env-linux \
&& cd ${CLONE_PATH}/dev-env-linux \
&& cp .ssh_config ~/.ssh/config \
&& cp relay.sh login ~/.ssh \
&& cp .bash_profile .bashrc .gitconfig .gitignore .tigrc .tmux.conf .vimrc ~ \
&& echo -ne '\n' | vim +PlugInstall +GoInstallBinaries +qall
RUN git clone https://github.com/kevinschoon/pomo.git ${CLONE_PATH}/pomo \
&& cd ${CLONE_PATH}/pomo \
&& make
RUN unset ALL_PROXY && curl -L https://bit.ly/glances | /bin/bash
RUN git clone https://github.com/charmbracelet/glow.git ${CLONE_PATH}/glow \
&& cd ${CLONE_PATH}/glow \
&& go build
RUN git clone https://github.com/rs/curlie.git ${CLONE_PATH}/curlie \
&& cd ${CLONE_PATH}/curlie \
&& go install
RUN git clone https://github.com/muesli/duf.git ${CLONE_PATH}/duf \
&& cd ${CLONE_PATH}/duf \
&& go install
RUN git clone https://github.com/multiprocessio/dsq ${CLONE_PATH}/dsq \
&& cd ${CLONE_PATH}/dsq \
&& go install .
RUN git clone https://github.com/rupa/z.git ${APP_PATH}/z
#TODO: need to install tmux plugins with `prefix+I` in tmux
#install tmux plugins automatically
RUN git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# && tmux source ~/.tmux.conf
#rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > ${CLONE_PATH}/rustup-init.sh \
&& chmod +x ${CLONE_PATH}/rustup-init.sh \
&& ${CLONE_PATH}/rustup-init.sh -y
RUN git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf \
&& ~/.fzf/install
#similar to https://github.com/bigH/git-fuzzy
RUN mkdir ${APP_PATH}/forgit \
cd ${APP_PATH}/forgit \
wget git.io/forgit
#zoxide need to configure
#RUN ~/.cargo/bin/cargo install --git https://github.com/Peltoche/lsd.git --branch master \
# && ~/.cargo/bin/cargo install broot exa fd-find hexyl ripgrep sd bat procs gping bottom choose du-dust \
# && ~/.cargo/bin/cargo install onefetch tealdeer pastel hyperfine git-delta xh zoxide fselect
########################## other funny tools ##########################
#starship/manimlib/gor/mediainfo/ssh-chat/FlameGraph/ohmyzsh/ccache/prettyping/neovim/zellij
#gitflow
#https://github.com/amix/vimrc.git
#github.com/liamg/aminal
#https://github.com/github/hub.git
#https://github.com/flok99/multitail
#https://github.com/alebcay/awesome-shell
#https://github.com/lheric/GitlHEVCAnalyzer.git
#https://cht.sh/
#https://github.com/peco/peco
#https://github.com/ogham/dog.git
#https://github.com/p-e-w/hegemon.git
########################## other funny tools ##########################
ENV ALL_PROXY=
CMD /usr/sbin/init