From f6c76e012e552b13ef89d42a485b705c9aa6e9d5 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Thu, 12 Sep 2019 16:09:24 +0200 Subject: [PATCH] Adapt to using go modules as default for new project Signed-off-by: Knut Ahlers --- .config/gen-dockerfile.tpl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.config/gen-dockerfile.tpl b/.config/gen-dockerfile.tpl index 78af101..6073e47 100755 --- a/.config/gen-dockerfile.tpl +++ b/.config/gen-dockerfile.tpl @@ -5,7 +5,9 @@ WORKDIR /go/src/{{ .package }} RUN set -ex \ && apk add --update git \ - && go install -ldflags "-X main.version=$(git describe --tags --always || echo dev)" + && go install \ + -ldflags "-X main.version=$(git describe --tags --always || echo dev)" \ + -mod=readonly FROM alpine:latest @@ -18,7 +20,8 @@ RUN set -ex \ && echo "{{ .timezone }}" > /etc/timezone \ && apk --no-cache del --purge tzdata \ {{- end -}} - && apk --no-cache add ca-certificates + && apk --no-cache add \ + ca-certificates COPY --from=builder /go/bin/{{ .binary }} /usr/local/bin/{{ .binary }}