This repository has been archived by the owner on Mar 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.tmpl
58 lines (51 loc) · 1.51 KB
/
Dockerfile.tmpl
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
# AUTOMATICALLY GENERATED
# DO NOT EDIT THIS FILE DIRECTLY, USE /Dockerfile.tmpl
# https://hub.docker.com/_/golang
{{ if hasSuffix .Env.DOCKERFILE "alpine" -}}
FROM golang:1.12-alpine
{{- else -}}
FROM golang:1.12-stretch
{{- end }}
MAINTAINER Instrumentisto Team <developer@instrumentisto.com>
{{ if hasSuffix .Env.DOCKERFILE "alpine" -}}
RUN apk update \
&& apk upgrade \
&& apk add --no-cache \
ca-certificates \
git mercurial subversion bzr \
openssh \
{{- else -}}
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends --no-install-suggests \
ca-certificates \
git mercurial subversion bzr \
{{- end }}
&& update-ca-certificates \
\
{{- if hasSuffix .Env.DOCKERFILE "alpine" }}
# Install build dependencies
&& apk add --no-cache --virtual .build-deps \
curl \
\
{{- end }}
# Download Dep executable
&& curl -fL -o /usr/local/bin/dep \
https://github.com/golang/dep/releases/download/v{{ .Env.VERSION }}/dep-linux-amd64 \
&& chmod +x /usr/local/bin/dep \
\
# Install Dep license
&& mkdir -p /usr/local/share/doc/dep \
&& curl -fL -o /usr/local/share/doc/dep/LICENSE \
https://raw.githubusercontent.com/golang/dep/v{{ .Env.VERSION }}/LICENSE \
\
# Cleanup unnecessary files
{{- if hasSuffix .Env.DOCKERFILE "alpine" }}
&& apk del .build-deps \
&& rm -rf /var/cache/apk/* \
{{- else }}
&& rm -rf /var/lib/apt/lists/* \
{{- end }}
/tmp/*
ENTRYPOINT ["/usr/local/bin/dep"]
CMD ["--help"]