forked from hairyhenderson/gomplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
65 lines (42 loc) · 1.69 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
FROM hairyhenderson/upx:3.94 AS upx
FROM golang:1.14.1-alpine3.11 AS build
RUN apk add --no-cache \
make \
libgcc libstdc++ ucl \
git
COPY --from=upx /usr/bin/upx /usr/bin/upx
RUN mkdir -p /go/src/github.com/hairyhenderson/gomplate
WORKDIR /go/src/github.com/hairyhenderson/gomplate
COPY . /go/src/github.com/hairyhenderson/gomplate
RUN make build compress
FROM scratch AS artifacts
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /go/src/github.com/hairyhenderson/gomplate/bin/* /bin/
CMD [ "/bin/gomplate_linux-amd64" ]
FROM scratch AS gomplate
ARG VCS_REF
ARG OS=linux
ARG ARCH=amd64
LABEL org.opencontainers.image.revision=$VCS_REF \
org.opencontainers.image.source="https://github.com/hairyhenderson/gomplate"
COPY --from=artifacts /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=artifacts /bin/gomplate_${OS}-${ARCH} /gomplate
ENTRYPOINT [ "/gomplate" ]
FROM alpine:3.11.5 AS gomplate-alpine
ARG VCS_REF
ARG OS=linux
ARG ARCH=amd64
LABEL org.opencontainers.image.revision=$VCS_REF \
org.opencontainers.image.source="https://github.com/hairyhenderson/gomplate"
RUN apk add --no-cache ca-certificates
COPY --from=artifacts /bin/gomplate_${OS}-${ARCH}-slim /bin/gomplate
ENTRYPOINT [ "/bin/gomplate" ]
FROM scratch AS gomplate-slim
ARG VCS_REF
ARG OS=linux
ARG ARCH=amd64
LABEL org.opencontainers.image.revision=$VCS_REF \
org.opencontainers.image.source="https://github.com/hairyhenderson/gomplate"
COPY --from=artifacts /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=artifacts /bin/gomplate_${OS}-${ARCH}-slim /gomplate
ENTRYPOINT [ "/gomplate" ]