1
0
Fork 0
mirror of https://github.com/Luzifer/share.git synced 2024-12-20 10:31:16 +00:00

Improve Dockerfile

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2024-03-18 18:26:14 +01:00
parent 93d19426eb
commit 2c2605d016
Signed by: luzifer
SSH key fingerprint: SHA256:/xtE5lCgiRDQr8SLxHMS92ZBlACmATUmF1crK16Ks4E

View file

@ -1,13 +1,16 @@
FROM golang:alpine as builder FROM golang:alpine as builder
COPY . /go/src/github.com/Luzifer/share COPY . /src/share
WORKDIR /go/src/github.com/Luzifer/share WORKDIR /src/share
RUN set -ex \ RUN set -ex \
&& apk add --update git \ && apk add --update git \
&& go install \ && go install \
-ldflags "-X main.version=$(git describe --tags --always || echo dev)" \ -ldflags "-X main.version=$(git describe --tags --always || echo dev)" \
-mod=readonly -mod=readonly \
-modcacherw \
-trimpath
FROM alpine:latest FROM alpine:latest