# build stage # Using 1.10 because earlier versions of Go cause the following error: # golang.org/x/crypto (download) # package math/bits: unrecognized import path "math/bits" (import path does # not begin with hostname) FROM golang:alpine AS build-env RUN apk --no-cache add git gcc musl-dev ADD * /go/src/app/ RUN go version ENV GOPATH /go-pkg RUN cd /go/src/app && go build -v . # final stage FROM alpine COPY --from=build-env /go/src/app/zfs_replication_exporter /usr/bin/zfs_replication_exporter COPY keys/ /root/.ssh/ EXPOSE 9999 CMD /usr/bin/zfs_replication_exporter \ -logtostderr \ -host mom.xinu.tv:2222 \ -user localuser \ -addr :9999