blob: e4a308381a3670acc96ffdba1d6436ab85647d70 [file] [log] [blame]
Christian29952512017-08-31 13:29:38 +02001FROM golang:alpine as builder
Jess Frazelle94a48712016-10-02 21:22:06 -07002MAINTAINER Jessica Frazelle <jess@linux.com>
Jess Frazelle181f0fe2016-08-25 08:11:20 -07003
4ENV PATH /go/bin:/usr/local/go/bin:$PATH
5ENV GOPATH /go
Jess Frazelle181f0fe2016-08-25 08:11:20 -07006
Jess Frazelle94a48712016-10-02 21:22:06 -07007RUN apk add --no-cache \
8 ca-certificates
Jess Frazelle181f0fe2016-08-25 08:11:20 -07009
Jess Frazelled1b5d4b2018-03-11 10:37:08 -040010COPY . /go/src/github.com/genuinetools/certok
Jess Frazelle181f0fe2016-08-25 08:11:20 -070011
Jess Frazelle94a48712016-10-02 21:22:06 -070012RUN set -x \
13 && apk add --no-cache --virtual .build-deps \
Jess Frazelle181f0fe2016-08-25 08:11:20 -070014 git \
15 gcc \
16 libc-dev \
17 libgcc \
Jess Frazelle8416da02018-01-01 15:51:40 -050018 make \
Jess Frazelled1b5d4b2018-03-11 10:37:08 -040019 && cd /go/src/github.com/genuinetools/certok \
Jess Frazelle8416da02018-01-01 15:51:40 -050020 && make static \
21 && mv certok /usr/bin/certok \
Jess Frazelle94a48712016-10-02 21:22:06 -070022 && apk del .build-deps \
Jess Frazelle181f0fe2016-08-25 08:11:20 -070023 && rm -rf /go \
24 && echo "Build complete."
25
Christian29952512017-08-31 13:29:38 +020026FROM scratch
27
28COPY --from=builder /usr/bin/certok /usr/bin/certok
29COPY --from=builder /etc/ssl/certs/ /etc/ssl/certs
Jess Frazelle181f0fe2016-08-25 08:11:20 -070030
31ENTRYPOINT [ "certok" ]
Jess Frazelle2cd2ef32017-04-10 17:30:21 +000032CMD [ "--help" ]