-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
68 lines (63 loc) · 2.1 KB
/
Dockerfile
File metadata and controls
68 lines (63 loc) · 2.1 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 docker.io/library/golang:1.17
LABEL name="drycc-go-dev"
ENV ENVTPL_VERSION=v1.0.0
ENV GOLANGCI_LINT_VERSION=v1.42.1
# This is a huge one-liner to optimize the Docker image layer.
# We disable source repos to speed up apt-get update.
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update -y --no-install-recommends \
&& apt-get install -y --no-install-recommends \
lsb-release \
bash \
build-essential \
ca-certificates \
curl \
git-core \
jq \
libffi-dev \
libssl-dev \
man \
mercurial \
net-tools \
netcat \
openssh-client \
procps \
rsync \
ruby \
unzip \
upx \
util-linux \
vim \
wget \
zip \
shellcheck \
etcd \
&& 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 \
&& go env -w GO111MODULE=on \
&& go get -u -v \
github.com/AlekSi/gocov-xml \
github.com/axw/gocov/gocov \
github.com/mitchellh/gox \
github.com/mgechev/revive \
&& git clone --dept 1 -b $ENVTPL_VERSION https://github.com/subfuzion/envtpl $GOPATH/src/github.com/subfuzion/envtpl \
&& cd $GOPATH/src/github.com/subfuzion/envtpl \
&& export GO111MODULE=on \
&& CGO_ENABLED=0 go build \
-ldflags "-X main.AppVersionMetadata=$(date -u +%s)" \
-a -installsuffix cgo -o /bin/envtpl ./cmd/envtpl/. \
&& git clone --dept 1 https://github.com/buildpacks/pack -b v0.23.0 /tmp/pack \
&& cd /tmp/pack \
&& make \
&& cp /tmp/pack/out/pack /usr/local/bin \
&& chmod +x /usr/local/bin/pack \
&& rm -rf /tmp/pack \
&& curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOPATH/bin $GOLANGCI_LINT_VERSION \
&& bash -c "mkdir -p /var/lib/shared/{overlay-images,overlay-layers}" \
&& bash -c "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 /go
COPY . /