-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
63 lines (58 loc) · 2.16 KB
/
Dockerfile
File metadata and controls
63 lines (58 loc) · 2.16 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
ARG CODENAME
FROM registry.drycc.cc/drycc/base:${CODENAME}
LABEL name="drycc-go-dev"
ENV GO_VERSION=1.23
ENV GOLANGCI_LINT_VERSION=v1.61.0
# This is a huge one-liner to optimize the Container image layer.
# We disable source repos to speed up apt-get update.
RUN export DEBIAN_FRONTEND=noninteractive \
&& install-packages \
lsb-release \
bash \
build-essential \
ca-certificates \
curl \
git \
jq \
libffi-dev \
libssl-dev \
man-db \
mercurial \
net-tools \
netcat-openbsd \
openssh-client \
procps \
rsync \
ruby \
unzip \
util-linux \
vim \
wget \
zip \
shellcheck \
etcd-server \
&& UPX_VERSION=4.2.4 \
&& OS_ARCH=$(dpkg --print-architecture) \
&& wget https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-${OS_ARCH}_linux.tar.xz \
&& tar -Jxvf upx-${UPX_VERSION}-${OS_ARCH}_linux.tar.xz \
&& cp upx-${UPX_VERSION}-${OS_ARCH}_linux/upx /usr/local/bin \
&& rm -rf upx-${UPX_VERSION}-${OS_ARCH}_linux* \
&& install-stack go $GO_VERSION && . init-stack \
&& curl -o /usr/local/bin/kubectl \
-L "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/$(dpkg --print-architecture)/kubectl" \
&& chmod +x /usr/local/bin/kubectl \
&& curl -SL https://cli.codecov.io/latest/$([ $(dpkg --print-architecture) == "arm64" ] && echo linux-arm64 || echo linux)/codecov -o /usr/local/bin/codecov \
&& chmod +x /usr/local/bin/codecov \
&& go env -w GO111MODULE=on \
&& go install github.com/AlekSi/gocov-xml@latest \
&& go install github.com/axw/gocov/gocov@latest \
&& go install github.com/mitchellh/gox@latest \
&& go install github.com/mgechev/revive@latest \
&& curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin $GOLANGCI_LINT_VERSION \
&& mkdir -p /var/lib/shared/{overlay-images,overlay-layers} \
&& touch /var/lib/shared/{overlay-images/images.lock,overlay-layers/layers.lock} \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man /usr/share/doc
WORKDIR /opt/drycc/go
COPY . /