reliant-labs/forge/build-contexts
Claude Code and agent skill by reliant-labs/forge
- community
Checking that the SKILL.md file is still in the repository.
Docker build contexts for a forge build — the MAIN context a DockerBuild sends (DockerBuild.context), the NAMED --build-context entries a Dockerfile COPY --from=s, and which of the two a given Dockerfile actually needs.
Install
npx vskill@latest install reliant-labs/forge/build-contextsSKILL.md
Docker Build Contexts
Two different things share the word "context", and picking the wrong one produces a build failure that names neither.
| what it is | where it is declared | ||
|---|---|---|---|
| MAIN context | the ONE directory docker sends as . — what every un-prefixed COPY resolves against | DockerBuild.context on the workload | |
| NAMED contexts | extra sources a COPY --from=<name> / FROM <name> pulls from | forge.yaml docker.build_contexts, or DockerBuild.build_contexts |
The MAIN context (DockerBuild.context)
A DockerBuild sends the PROJECT ROOT as its context unless the workload says otherwise. context is a directory relative to the project root:
Set it when the Dockerfile was written to be run from its own directory — the giveaway is an un-prefixed copy of a file that is not at the repo root:
Under the default root context that same line fails with
which names the Dockerfile, not the context, and so reads as a Dockerfile bug. A Dockerfile that COPYs repo-root-relative paths (COPY frontends/internal-console/package.json ./) wants the default and should not set context at all.
Two details that trip people up:
- `dockerfile` is always project-root relative, whatever
contextsays,
and it need NOT live under the context. Docker allows -f outside the context and forge does not narrow that.
- A narrower context is not just correctness, it is speed — docker sends
the context to the daemon, so a root context on a large monorepo ships the whole tree for a build that reads one directory.
forge refuses a context that is absolute, escapes the project root, does not exist, or is a file. forge build <env> --plan runs the same check and prints the resolved context in every docker step (docker build -f frontends/internal-console/Dockerfile frontends/internal-console), so a context mistake is a PR-time failure rather than a release-cut one.
NAMED contexts (build_contexts)
When a Dockerfile needs files from OUTSIDE the project tree — a sibling checkout the go.mod replaces against, a shared-libs monorepo sibling, a base image to pin — declare each as a named context. Every entry becomes one docker buildx --build-context name=value:
Consume them via COPY --from=shared or FROM base.
A single workload can declare its own instead, which is the better default once more than one image exists — each Dockerfile then names ONLY what it actually consumes:
DockerBuild.build_contexts REPLACE the project-level ones for that workload rather than merging with them, so a workload that declares any declares all of the ones its Dockerfile needs. Unset, it inherits forge.yaml's.
Named contexts cannot substitute for the main one: a COPY package.json ./ reads the MAIN context, and no --build-context entry changes where that looks.
Base images
forge is base-image-AGNOSTIC. It does not discover, mirror, pin, or inject base images, and the only --build-args on a build are the workload's explicit build_args. A Dockerfile's FROM lines are the whole story — pin them with FROM …@sha256:… if reproducibility matters.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckinginternal/templates/project/skills/forge/deploy/build-contexts/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/reliant-labs/forge/build-contexts)