Bake targets
Lint the targets from
docker-bake.hcl or docker-bake.json.Compose services
Lint services with a
build: section from compose.yaml.Build context
Use the orchestrator’s context instead of repeating
--context.Editor context
Attach Bake or Compose context to Dockerfile diagnostics in LSP clients.
Supported entrypoints
tally lint still uses one command. The behavior depends on the explicit path you pass.
| Input | Behavior |
|---|---|
tally lint . | Recursively discovers Dockerfiles and Containerfiles. No orchestrator discovery is performed. |
tally lint Dockerfile | Lints one Dockerfile directly. |
tally lint docker-bake.hcl | Resolves Bake targets and lints each resulting build invocation. |
tally lint docker-bake.json | Resolves Bake JSON targets and lints each resulting build invocation. |
tally lint compose.yaml | Resolves Compose services with build: sections and lints each resulting build invocation. |
tally lint . does not search for compose.yaml or
docker-bake.hcl; pass those files explicitly when they are the build source of truth.
Dockerfile mode and --context
For direct Dockerfile linting, use --context when rules need access to files in the build context:
.dockerignore or on files copied into the image.
When you lint a Bake or Compose entrypoint, do not pass --context. tally derives the primary build context from the selected target or service.
Docker Buildx Bake
Lint all targets in the Bake default group:--target:
docker-bake.hcl
contextbecomes the primary build context.dockerfileselects the file to lint.argswith concrete values are available to Dockerfile analysis.targetselects the effective final stage.platformsare available to platform-aware checks.contextsare preserved as named build contexts.
Bake limitations
| Feature | Behavior |
|---|---|
dockerfile-inline | Error. tally needs a real Dockerfile path for diagnostics and fixes. |
| Multi-file Bake setups | Error when sibling Bake files are detected. Pass one explicit file that contains the full target definition, or lint the resolved Dockerfiles directly. |
| Remote Bake definition URLs | Not supported as lint entrypoints. Pass a local Bake file. |
| Non-local primary contexts | Supported as invocation metadata, but tally cannot inspect remote files or resolve a relative Dockerfile from a remote context. |
Docker Compose
Lint all active services with abuild: section:
--service:
compose.yaml
api and worker produce lint invocations. redis does not, because it has no build: section.
tally preserves both build-time and selected runtime metadata:
build.context,build.dockerfile,build.args,build.platforms,build.target, andbuild.additional_contexts- service
platformwhenbuild.platformsis not set - service
environment,ports,expose,labels,networks,secrets,healthcheck,entrypoint,command,user,working_dir, andstop_signal
Compose limitations
| Feature | Behavior |
|---|---|
build.dockerfile_inline | Error. tally needs a real Dockerfile path. |
| Profile-gated build services | Error. tally does not guess which non-default profiles should be active. |
Selected service without build: | Error. --service must name a buildable service. |
| Image-only services | Allowed, but they do not produce lint invocations. |
| Unsaved Compose file edits in an editor | Ignored until the file is saved. |
Build contexts
The primary context is the context used for regularCOPY and ADD sources.
| Context kind | Example | Local file inspection |
|---|---|---|
| Local directory | context = ".", build.context: ./app | Yes |
| Local tar archive | context = "./context.tar" | No |
| Git repository | context = "https://github.com/acme/app.git" | No |
| Remote URL | context = "https://example.com/context" | No |
| Empty context | context = "-" | No |
| Named image context | docker-image://alpine:3.20 | No |
| Bake target context | target:base | No local file inspection |
| Compose service context | service:base | No local file inspection |
.dockerignore and read files copied by COPY or ADD. Remote and non-directory contexts are
valid invocation metadata, but tally does not fetch them during linting.
Named contexts are tracked separately from the primary context. They are available to rules that need to know that a name was declared, but they do
not make files locally readable unless a future rule explicitly supports that context kind.
Output and attribution
When an orchestrator produces more than one invocation, tally keeps diagnostics separate even if multiple invocations point at the same Dockerfile. Text output groups findings by invocation:Invocation column.
Fixes
--fix is not supported when the lint entrypoint is a Bake or Compose file:
2. A single Dockerfile can be linted under multiple invocation contexts, and applying one text edit through an orchestrator
entrypoint could be wrong for another target or service.
To apply fixes, lint the Dockerfile directly:
LSP and editor use
The LSP server remains Dockerfile-document-centric. To attach orchestrator context to Dockerfile diagnostics, configure invocation entrypoints in your editor or LSP client. User-facing setting:tally/bake:api or tally/compose:worker.
Mutating code actions are only shown when the requested diagnostic or range belongs to one invocation context. Broad fix-all actions are disabled
when the selected diagnostics span multiple invocation contexts.
Exit codes
Orchestrator entrypoints use the same exit-code family as Dockerfile linting:| Code | Orchestrator meaning |
|---|---|
0 | Clean run, or a valid Bake/Compose file with no lintable invocations. |
1 | Violations were found at or above --fail-level. |
2 | CLI misuse, parse/load failure, unsupported orchestrator feature, or invalid target/service selection. |
4 | A referenced Dockerfile has fatal syntax errors. |
3 remains the Dockerfile discovery “no files found” case for directory and glob inputs. A valid orchestrator file with zero buildable
targets or services exits 0, not 3.