From 1a91a5d34da84c9b3cf725f934eaa13190cb0446 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Fri, 24 Jan 2020 16:17:09 +0100 Subject: [PATCH] Update Dockerfiles Signed-off-by: Knut Ahlers --- Dockerfile | 9 ++++++--- Dockerfile.minimal | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) 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