faster docker builds
This commit is contained in:
parent
0fa3a91447
commit
13ce2aa07f
1 changed files with 4 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
FROM golang:1.22 as builder
|
FROM --platform=$BUILDPLATFORM golang:1.22 as builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
@ -14,7 +14,9 @@ COPY ./templates ./templates
|
||||||
COPY embed.go embed.go
|
COPY embed.go embed.go
|
||||||
|
|
||||||
RUN go generate ./...
|
RUN go generate ./...
|
||||||
RUN --mount=type=cache,mode=0777,target=/go/pkg/mod CGO_ENABLED=0 go build -tags timetzdata -o /tstor ./cmd/tstor/main.go
|
|
||||||
|
ARG TARGETOS TARGETARCH
|
||||||
|
RUN --mount=type=cache,mode=0777,target=/go/pkg/mod CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -tags timetzdata -o /tstor ./cmd/tstor/main.go
|
||||||
|
|
||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
|
|
Loading…
Reference in a new issue