docker: update & use build cache
This commit is contained in:
parent
4f48866daa
commit
b5b7272603
18
Dockerfile
18
Dockerfile
@ -1,12 +1,22 @@
|
||||
# ------------------------------------------------------------------------
|
||||
from golang:1.21.4-bullseye as build
|
||||
from golang:1.21.5-bullseye as build
|
||||
|
||||
run apt-get update && apt-get install -y git
|
||||
|
||||
workdir /src
|
||||
|
||||
copy go.mod go.sum ./
|
||||
run go mod download
|
||||
run \
|
||||
--mount=type=cache,id=gomod,target=/go/pkg/mod \
|
||||
--mount=type=cache,id=gobuild,target=/root/.cache/go-build \
|
||||
go mod download
|
||||
|
||||
copy . ./
|
||||
run go test ./...
|
||||
run hack/build ./...
|
||||
run \
|
||||
--mount=type=cache,id=gomod,target=/go/pkg/mod \
|
||||
--mount=type=cache,id=gobuild,target=/root/.cache/go-build \
|
||||
go test ./... && \
|
||||
hack/build ./...
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
from debian:bullseye
|
||||
|
Loading…
Reference in New Issue
Block a user