-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
117 lines (104 loc) · 2.82 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
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
FROM fedora:36
MAINTAINER Yousong Zhou <[email protected]>
RUN set -x \
&& sed -i -e s/nodocs// /etc/dnf/dnf.conf \
&& true
RUN set -x \
&& dnf group install -y "C Development Tools and Libraries" \
&& true
# python3-devel: ycmd build
# glibc-langpack-en: en_US.UTF-8 locale when running manpath
# hostname: for hostname command
# mariadb: mysql client
RUN set -x \
&& dnf install -y \
cmake \
ctags \
docker \
file \
git \
git-email \
glibc-langpack-en \
hostname \
iproute \
iputils \
jq \
lsof \
man-db \
man-pages \
mariadb \
patch \
procps \
python3-devel \
rsync \
strace \
sysstat \
tcpdump \
tmux \
vim \
wget \
which \
zsh \
&& true
RUN set -x \
&& alternatives --verbose --install /usr/bin/python python /usr/bin/python3.10 10 \
&& dnf install -y \
python3-pip \
&& pip3 install https://github.com/yousong/polysh/archive/7fc055ef9075e5dbee4cc7abc020b89fccabfc67.zip \
&& pip3 install \
yq \
&& true
# We use repo settings in the build machine for installing packages. The built
# image is mostly to be used where aliyun mirrors is the faster accessible
RUN set -x \
&& curl -o /etc/yum.repos.d/fedora.repo https://mirrors.aliyun.com/repo/fedora.repo \
&& curl -o /etc/yum.repos.d/fedora-updates.repo https://mirrors.aliyun.com/repo/fedora-updates.repo \
&& true
RUN set -x \
&& adduser --shell /bin/zsh abc \
&& echo "abc ALL=(ALL) NOPASSWD: ALL" >/etc/sudoers.d/abc \
&& true
RUN set -x \
&& mkdir -p /home/abc/.usr/n \
&& curl -o n -L "https://raw.githubusercontent.com/tj/n/master/bin/n" \
&& N_PREFIX=/home/abc/.usr bash n lts \
&& rm -vf n \
&& chown -R abc:abc /home/abc/.usr \
&& true
ARG GOVERSION=go1.20.6
ARG GOURL=https://storage.googleapis.com/golang/$GOVERSION.linux-amd64.tar.gz
RUN set -x \
&& mkdir -p /home/abc/.usr/go \
&& cd /home/abc/.usr/go \
&& curl -L "$GOURL" \
| tar xzf - \
&& chmod -R a-w go \
&& mv go $GOVERSION \
&& chown -R abc:abc /home/abc/.usr/go \
&& true
RUN set -x \
&& cd /home/abc \
&& curl https://sh.rustup.rs -sSf \
| sudo -u abc sh -s -- --no-modify-path --default-toolchain stable -y \
&& sudo -u abc /home/abc/.cargo/bin/rustup component list --installed \
| grep docs \
| xargs sudo -u abc /home/abc/.cargo/bin/rustup component remove \
&& sudo -u abc /home/abc/.cargo/bin/cargo install ripgrep \
&& rm -rf /home/abc/.cargo/registry \
&& true
ADD . /home/abc/git-repo/dconf
RUN set -x \
&& cd /home/abc/git-repo/dconf \
&& chown -R abc:abc /home/abc/git-repo \
&& sudo -u abc \
PATH=/home/abc/.usr/bin:$PATH \
./dconf.sh config \
&& cd /home/abc \
&& rm -rf git-repo \
&& sudo -iu abc PATH=/home/abc/.usr/go/$GOVERSION/bin:$PATH \
vim +GoInstallBinaries +qa \
&& /home/abc/go/bin/gopls version \
&& rm -rf /home/abc/.cache/go-build \
&& true
ADD ./hack/docker/run.sh /run.sh
CMD /run.sh entrypoint