diff --git a/Dockerfile b/Dockerfile index 6a0dbf3..d8d3825 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,21 @@ FROM golang:alpine as builder -ADD . /go/src/github.com/Luzifer/ots +COPY . /go/src/github.com/Luzifer/ots WORKDIR /go/src/github.com/Luzifer/ots RUN set -ex \ && apk add --update git \ - && go install -ldflags "-X main.version=$(git describe --tags || git rev-parse --short HEAD || echo dev)" + && go install \ + -ldflags "-X main.version=$(git describe --tags --always || echo dev)" \ + -mod=readonly FROM alpine:latest LABEL maintainer "Knut Ahlers " RUN set -ex \ - && apk --no-cache add ca-certificates + && apk --no-cache add \ + ca-certificates COPY --from=builder /go/bin/ots /usr/local/bin/ots diff --git a/Dockerfile.minimal b/Dockerfile.minimal index 63a3d9a..0f9b4cd 100644 --- a/Dockerfile.minimal +++ b/Dockerfile.minimal @@ -2,12 +2,14 @@ FROM golang:alpine as builder ENV CGO_ENABLED=0 -ADD . /go/src/github.com/Luzifer/ots +COPY . /go/src/github.com/Luzifer/ots WORKDIR /go/src/github.com/Luzifer/ots RUN set -ex \ && apk add --update git \ - && go install -ldflags "-X main.version=$(git describe --tags || git rev-parse --short HEAD || echo dev)" + && go install \ + -ldflags "-X main.version=$(git describe --tags --always || echo dev)" \ + -mod=readonly FROM scratch