Skip to content

Commit

Permalink
chore(dev): improve go build caching (hetznercloud#735)
Browse files Browse the repository at this point in the history
Speed up re-builds of the container image in the dev environment,
by using a buildx cache mount for the go cache.

Co-authored-by: simonhammes <[email protected]>
  • Loading branch information
simonhammes and simonhammes committed Sep 4, 2024
1 parent 4801f0e commit c99a161
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ RUN ls -al
ARG CGO_ENABLED=0
# `skaffold debug` sets SKAFFOLD_GO_GCFLAGS to disable compiler optimizations
ARG SKAFFOLD_GO_GCFLAGS
RUN go build -gcflags="$SKAFFOLD_GO_GCFLAGS" -o hcloud-cloud-controller-manager.bin github.com/hetznercloud/hcloud-cloud-controller-manager
ENV GOCACHE=/cache
RUN --mount=type=cache,target="/cache" go build -gcflags="$SKAFFOLD_GO_GCFLAGS" -o hcloud-cloud-controller-manager.bin github.com/hetznercloud/hcloud-cloud-controller-manager

FROM alpine:3.20

Expand Down

0 comments on commit c99a161

Please sign in to comment.