-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
needs-kindIndicates a PR lacks a `kind/foo` label and requires one.Indicates a PR lacks a `kind/foo` label and requires one.needs-priorityIndicates an issue lacks a `priority/foo` label and requires one.Indicates an issue lacks a `priority/foo` label and requires one.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.Indicates an issue or PR lacks a `triage/foo` label and requires one.
Description
The release-binary Makefile target currently uses /tmp/ as the GOCACHE directory inside the Docker container, which means the build cache is discarded after every run. This results in slower builds since Go has to recompile everything from scratch each time.
The make target release-binaries build the clusterctl binary for each architecture by calling the release-binary target. Therefore, the same go packages are installed each and every time and recompilation from scratch occurs every time which is bit inefficient.
Changes proposed:
- Set
GOCACHEto/go/build-cache/instead of/tmp/ - Mount the host's
GOMODCACHEinto the container at/go/pkg/modto reuse downloaded modules. - Mount the host's
GOCACHEinto the container at/go/build-cacheto persist the build cache across runs.
These volume mounts allow the Docker build to leverage caches from the host machine, significantly speeding up incremental builds.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
needs-kindIndicates a PR lacks a `kind/foo` label and requires one.Indicates a PR lacks a `kind/foo` label and requires one.needs-priorityIndicates an issue lacks a `priority/foo` label and requires one.Indicates an issue lacks a `priority/foo` label and requires one.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.Indicates an issue or PR lacks a `triage/foo` label and requires one.