Repository navigation
op: a shell step can run in a container pinned by digest (#4015) - #4176
Merged
Merged
Conversation
shell() takes image (<ref>@sha256:<digest>), mounts and outputs. The local executor runs the command with docker run --rm (or CHANT_CONTAINER_CLI), the working directory read-only at /workspace unless mounts says rw, each output directory mounted writable, and the step's env passed by name. The run ledger keeps the image on the step record. OPS018 refuses an image that is not a literal pinned by digest. TerraformApplyOp and TerraformAdoptOp pass compensate.image through. Docs: the container step in the Ops reference, OPS018, and a pipeline engines section (Dagger, Bazel) in How chant compares, linked from the CI room.
lex00
added a commit
that referenced
this pull request
Oct 21, 2026
…4198) #4190's branch was built on 60faf26 but committed with 32dbb0d as its parent, so its squash replaced the files those four PRs changed with their older copies. This is the difference between 09a88b7 and the merge #4190 should have made (git merge-tree --merge-base 60faf26 0f57507 673cfb9), applied onto main.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds the two "build" items from the #4015 write-up.
A shell step in a container
shell(cmd, { image, mounts?, outputs? }):imagemust be<ref>@sha256:<digest>. The local executor runs the command withdocker run --rm, or the CLICHANT_CONTAINER_CLInames (podman), as the host's uid and gid./workspace, read-only unlessmounts: { workspace: "rw" }.outputsentry is a directory under the working directory. It is created on the host if missing and mounted writable at the same path, so what the command writes stays on the host. A directory the command leaves empty fails a step that otherwise passed. A writable mount inside a read-only bind needs its mountpoint to exist, which is why outputs are directories made beforehand rather than files copied back.envby name and none of chant's environment.okExit,gatedExitandjsonbehave as before.imageon the step record (OpRunStepRecord.image).onFailureand effect steps.TerraformApplyOpandTerraformAdoptOptakecompensate: { command, image }. Their other steps are their own activities, not shell commands, so this is the only shell step those builders write.Gates and
onFailurestay in chant's executor; only the command body moves into the container.Docs
colon-revealinlint-rules/correctness.mdx, from the page's own**Severity:** errorconvention on the new entry (and drops a stale em-dash count incli/import.mdx).Tests
containerCommandlines for ro and rw workspaces, digest checks, refusals before anything runs, the contract, the builder, OPS018, the ledger record and both terraform composites.vitest --project unitoverpackages/core/src/op,packages/core/src/lint,run-ledgerandlexicons/terraform: 3567 passed, 23 skipped.packages/core/src/op/activities/shell-container.e2e.test.tsruns alpine 3.21 by digest. It checks the workspace is read-only, env passes by name only, an output directory lands on the host, an empty output fails, and exit codes andokExithold. It skips when Docker isn't running. Passed locally, and no containers were left.tsc -p packages/core,check-lexicons(terraform 24/24), docs sentence lint, citations, prompts and diataxis checks pass.Refs #4015.