Skip to content

Cache Go dependency downloads in cli.Dockerfile#377

Closed
lilydoar wants to merge 1 commit into
lilydoar/stack/10from
lilydoar/stack/11
Closed

Cache Go dependency downloads in cli.Dockerfile#377
lilydoar wants to merge 1 commit into
lilydoar/stack/10from
lilydoar/stack/11

Conversation

@lilydoar
Copy link
Copy Markdown
Contributor

@lilydoar lilydoar commented May 28, 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 28, 2026 21:54
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: #377, branch: lilydoar/stack/11
@lilydoar lilydoar force-pushed the lilydoar/stack/11 branch from 42bf863 to 9f1faf2 Compare May 28, 2026 21:54
@lilydoar lilydoar force-pushed the lilydoar/stack/10 branch from 4edbef4 to 74ea63d Compare May 28, 2026 21:54
lilydoar added a commit that referenced this pull request May 29, 2026
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: #377, branch: lilydoar/stack/11
lilydoar added a commit that referenced this pull request May 29, 2026
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: #377, branch: lilydoar/stack/11
@lilydoar
Copy link
Copy Markdown
Contributor Author

Closing — the module-organization stack was rebased (devserver move dropped, since devserver must stay exported for temporal to import it). Recreating the stack fresh.

@lilydoar lilydoar closed this May 29, 2026
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