You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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]>
Copy file name to clipboardExpand all lines: dev/Dockerfile
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,8 @@ RUN ls -al
11
11
ARG CGO_ENABLED=0
12
12
# `skaffold debug` sets SKAFFOLD_GO_GCFLAGS to disable compiler optimizations
13
13
ARG SKAFFOLD_GO_GCFLAGS
14
-
RUN go build -gcflags="$SKAFFOLD_GO_GCFLAGS" -o hcloud-cloud-controller-manager.bin github.com/hetznercloud/hcloud-cloud-controller-manager
14
+
ENV GOCACHE=/cache
15
+
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
0 commit comments