github.com/hairyhenderson/templater@v3.5.0+incompatible/Dockerfile (about) 1 FROM alpine:3.8 AS upx 2 RUN apk add --no-cache upx=3.94-r0 3 4 FROM golang:1.12.5-alpine AS build 5 6 RUN apk add --no-cache \ 7 make \ 8 libgcc libstdc++ ucl \ 9 git 10 11 COPY --from=upx /usr/bin/upx /usr/bin/upx 12 13 RUN mkdir -p /go/src/github.com/hairyhenderson/gomplate 14 WORKDIR /go/src/github.com/hairyhenderson/gomplate 15 COPY . /go/src/github.com/hairyhenderson/gomplate 16 17 RUN make build-x compress-all 18 19 FROM scratch AS artifacts 20 21 COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt 22 COPY --from=build /go/src/github.com/hairyhenderson/gomplate/bin/* /bin/ 23 24 CMD [ "/bin/gomplate_linux-amd64" ] 25 26 FROM scratch AS gomplate 27 28 ARG BUILD_DATE 29 ARG VCS_REF 30 ARG OS=linux 31 ARG ARCH=amd64 32 33 LABEL org.opencontainers.image.created=$BUILD_DATE \ 34 org.opencontainers.image.revision=$VCS_REF \ 35 org.opencontainers.image.source="https://github.com/hairyhenderson/gomplate" 36 37 COPY --from=artifacts /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt 38 COPY --from=artifacts /bin/gomplate_${OS}-${ARCH} /gomplate 39 40 ENTRYPOINT [ "/gomplate" ] 41 42 FROM alpine:3.9 AS gomplate-alpine 43 44 ARG BUILD_DATE 45 ARG VCS_REF 46 ARG OS=linux 47 ARG ARCH=amd64 48 49 LABEL org.opencontainers.image.created=$BUILD_DATE \ 50 org.opencontainers.image.revision=$VCS_REF \ 51 org.opencontainers.image.source="https://github.com/hairyhenderson/gomplate" 52 53 RUN apk add --no-cache ca-certificates 54 COPY --from=artifacts /bin/gomplate_${OS}-${ARCH}-slim /bin/gomplate 55 56 ENTRYPOINT [ "/bin/gomplate" ] 57 58 FROM scratch AS gomplate-slim 59 60 ARG BUILD_DATE 61 ARG VCS_REF 62 ARG OS=linux 63 ARG ARCH=amd64 64 65 LABEL org.opencontainers.image.created=$BUILD_DATE \ 66 org.opencontainers.image.revision=$VCS_REF \ 67 org.opencontainers.image.source="https://github.com/hairyhenderson/gomplate" 68 69 COPY --from=artifacts /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt 70 COPY --from=artifacts /bin/gomplate_${OS}-${ARCH}-slim /gomplate 71 72 ENTRYPOINT [ "/gomplate" ]