blob: 16247ef2a864c993cc0b369b3b8d497c21e95893 [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/jessfraz/tdash
RUN set -x \
&& apk add --no-cache --virtual .build-deps \
git \
gcc \
libc-dev \
libgcc \
make \
&& cd /go/src/github.com/jessfraz/tdash \
&& make static \
&& mv tdash /usr/bin/tdash \
&& apk del .build-deps \
&& rm -rf /go \
&& echo "Build complete."
FROM scratch
COPY --from=builder /usr/bin/tdash /usr/bin/tdash
COPY --from=builder /etc/ssl/certs/ /etc/ssl/certs
ENTRYPOINT [ "tdash" ]
CMD [ "--help" ]