Skip to content

Commit

Permalink
build with target and cache mounts
Browse files Browse the repository at this point in the history
  • Loading branch information
endorama committed Apr 12, 2024
1 parent e9e799d commit d64579b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ RUN go mod download
COPY . .

# Build
RUN \
go mod download \
&& make build
ARG TARGETOS TARGETARCH
# Leverage mounts to cache relevant Go paths
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
GOOS=$TARGETOS GOARCH=$TARGETARCH make build

# Base image for build
FROM debian:bookworm
Expand Down

0 comments on commit d64579b

Please sign in to comment.