-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
65 lines (60 loc) · 2.02 KB
/
Dockerfile
File metadata and controls
65 lines (60 loc) · 2.02 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
FROM docker.io/library/golang:1.15
LABEL name="drycc-go-dev"
ENV ENVTPL_VERSION=v1.0.0
ENV GOLANGCI_LINT_VERSION=v1.29.0
# 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 \
&& apt-get install -y lsb-release \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \
&& curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \
&& echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | tee -a /etc/apt/sources.list.d/kubernetes.list \
&& echo "deb https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee -a /etc/apt/sources.list.d/docker.list \
&& apt-get update \
&& apt-get upgrade -y --no-install-recommends \
&& apt-get install -y --no-install-recommends \
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 \
kubectl \
docker-ce-cli \
&& go env -w GO111MODULE=on \
&& go get -u -v \
github.com/AlekSi/gocov-xml \
github.com/axw/gocov/gocov \
github.com/mitchellh/gox \
golang.org/x/lint \
&& 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/. \
&& curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOPATH/bin $GOLANGCI_LINT_VERSION \
&& 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 . /