forked from hairyhenderson/gomplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (37 loc) · 1.45 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
FROM golang:1.10-alpine@sha256:2d95d31c8d9d59c85199309a357a0dc76df7f31033834af811103781df0362dc AS build
RUN apk add --no-cache \
make \
git \
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-x compress-all
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 BUILD_DATE
ARG VCS_REF
ARG OS=linux
ARG ARCH=amd64
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="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" ]
CMD [ "--help" ]
FROM scratch AS gomplate-slim
ARG BUILD_DATE
ARG VCS_REF
ARG OS=linux
ARG ARCH=amd64
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="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" ]
CMD [ "--help" ]