FROM golang:1.13 AS builder COPY . /build/ WORKDIR /build/ RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 GOFLAGS='-mod=vendor' go build -tags netgo -ldflags '-w -extldflags "-static"' FROM scratch COPY --from=builder /build/fwzookeeper /usr/local/bin/fwzookeeper VOLUME ["/data"] ENTRYPOINT [ "/usr/local/bin/fwzookeeper" ]