blob: e4a308381a3670acc96ffdba1d6436ab85647d70 [file] [log] [blame]
FROM golang:alpine as builder
MAINTAINER Jessica Frazelle <jess@linux.com>
ENV PATH /go/bin:/usr/local/go/bin:$PATH
ENV GOPATH /go
RUN apk add --no-cache \
ca-certificates
COPY . /go/src/github.com/genuinetools/certok
RUN set -x \
&& apk add --no-cache --virtual .build-deps \
git \
gcc \
libc-dev \
libgcc \
make \
&& cd /go/src/github.com/genuinetools/certok \
&& make static \
&& mv certok /usr/bin/certok \
&& apk del .build-deps \
&& rm -rf /go \
&& echo "Build complete."
FROM scratch
COPY --from=builder /usr/bin/certok /usr/bin/certok
COPY --from=builder /etc/ssl/certs/ /etc/ssl/certs
ENTRYPOINT [ "certok" ]
CMD [ "--help" ]