Adapt to using go modules as default for new project

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2019-09-12 16:09:24 +02:00
parent 9c04401a27
commit f6c76e012e
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -5,7 +5,9 @@ WORKDIR /go/src/{{ .package }}
RUN set -ex \ RUN set -ex \
&& apk add --update git \ && 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 FROM alpine:latest
@ -18,7 +20,8 @@ RUN set -ex \
&& echo "{{ .timezone }}" > /etc/timezone \ && echo "{{ .timezone }}" > /etc/timezone \
&& apk --no-cache del --purge tzdata \ && apk --no-cache del --purge tzdata \
{{- end -}} {{- end -}}
&& apk --no-cache add ca-certificates && apk --no-cache add \
ca-certificates
COPY --from=builder /go/bin/{{ .binary }} /usr/local/bin/{{ .binary }} COPY --from=builder /go/bin/{{ .binary }} /usr/local/bin/{{ .binary }}