cache lock

This commit is contained in:
Kwitsch 2022-09-14 14:49:24 +02:00
parent 285eda477d
commit 0136755f4a
1 changed files with 3 additions and 2 deletions

View File

@ -31,7 +31,8 @@ WORKDIR /src
# get go modules
COPY go.mod go.sum ./
RUN go mod download
RUN --mount=type=cache,target=/root/go/pkg,sharing=locked \
go mod download
# add source
ADD . .
@ -42,7 +43,7 @@ ENV GO111MODULE=on
ENV CGO_ENABLED=0
# build binary
RUN --mount=type=cache,target=/root/.cache/go-build \
RUN --mount=type=cache,target=/root/.cache/go-build,sharing=locked \
go build \
-tags static \
-v \