Update Dockerfiles
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
cbfc002c15
commit
1a91a5d34d
2 changed files with 10 additions and 5 deletions
|
@ -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 <knut@ahlers.me>"
|
||||
|
||||
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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue