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