Skip to content

Cache Go dependency downloads in cli.Dockerfile#387

Open
lilydoar wants to merge 1 commit into
lilydoar/stack/18from
lilydoar/stack/19
Open

Cache Go dependency downloads in cli.Dockerfile#387
lilydoar wants to merge 1 commit into
lilydoar/stack/18from
lilydoar/stack/19

Conversation

@lilydoar
Copy link
Copy Markdown
Contributor

@lilydoar lilydoar commented May 29, 2026

Stacked PRs:


Cache Go dependency downloads in cli.Dockerfile

Previously the Dockerfile copied source then go.mod/go.sum and built in one
shot, so any source change invalidated the layer and re-downloaded every
module. Copy go.mod/go.sum (plus the workers/go/harness/api replace target,
required for the module graph to resolve) first and run go mod download as
its own layer, then copy source and build. Dependency downloads now cache
independently of source edits. Verified by building the CLI image with podman.

@lilydoar lilydoar requested review from a team as code owners May 29, 2026 21:13
Previously the Dockerfile copied source then go.mod/go.sum and built in one
shot, so any source change invalidated the layer and re-downloaded every
module. Copy go.mod/go.sum (plus the workers/go/harness/api replace target,
required for the module graph to resolve) first and run `go mod download` as
its own layer, then copy source and build. Dependency downloads now cache
independently of source edits. Verified by building the CLI image with podman.

stack-info: PR: #387, branch: lilydoar/stack/19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant