# 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:1.10-alpine AS build-env RUN apk --no-cache add git ADD * /go/src/app/ RUN go get -v app && go install -v app # final stage FROM alpine COPY --from=build-env /go/bin/app /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