From aa4ffd5f5c60de5710703f6dd6bd18fcabd6a0e1 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Tue, 22 Aug 2023 17:38:33 +0300 Subject: [PATCH] feat: make docker build cache deps builds --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 29a340c..efd9bb7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,11 +8,12 @@ RUN go mod download && go mod verify COPY . . -RUN CGO_ENABLED=0 GOOS=linux go build -v -o /tixe ./tixe.go +RUN --mount=type=cache,target=/root/.cache/go-build \ +CGO_ENABLED=0 GOOS=linux go build -v -o /tixe ./tixe.go # tester FROM builder AS tester -RUN go test -v ./... +RUN --mount=type=cache,target=/root/.cache/go-build go test -v ./... # release FROM alpine:3.18 AS release -- 2.44.1