Docker to build with new Go and module semantics.
This commit is contained in:
parent
a518150bfe
commit
d00f6c32b7
10
Dockerfile
10
Dockerfile
@ -3,14 +3,16 @@
|
||||
# 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
|
||||
FROM golang:alpine AS build-env
|
||||
RUN apk --no-cache add git gcc musl-dev
|
||||
ADD * /go/src/app/
|
||||
RUN go get -v app && go install -v 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/bin/app /usr/bin/zfs_replication_exporter
|
||||
COPY --from=build-env /go/src/app/zfs_replication_exporter /usr/bin/zfs_replication_exporter
|
||||
COPY keys/ /root/.ssh/
|
||||
|
||||
EXPOSE 9999
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user