Skip to content

fix(images): support Docker Engine gateway builds - #7622

Merged
apurvvkumaria merged 5 commits into
mainfrom
codex/7611-docker-engine-compat
Jul 27, 2026
Merged

fix(images): support Docker Engine gateway builds#7622
apurvvkumaria merged 5 commits into
mainfrom
codex/7611-docker-engine-compat

Conversation

@apurvvkumaria

@apurvvkumaria apurvvkumaria commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Managed OpenClaw and Hermes onboarding can now complete on Docker Engine when OpenShell uses its gateway builder. The gateway-bound Dockerfiles use legacy-compatible grouped COPY payloads instead of BuildKit-only bind mounts while retaining the measured cold-onboard layer budget.

Related Issue

Fixes #7611

Changes

  • Stage repository-owned OpenClaw and Hermes files in scratch payload images, then apply each group with a legacy-compatible cross-stage root COPY.
  • Preserve the existing cache order, ownership fixes, integrity checks, completed-image scans, and four/five grouped payload-layer boundaries.
  • Restore gateway fallback after a host-side Hermes prebuild failure because the managed Dockerfile no longer requires the BuildKit parser.
  • Add source contracts that reject RUN --mount, pin the grouped copy counts and order, and keep package-remediation scans attached to the completed final images.
  • Remove obsolete Hermes fail-fast troubleshooting text and document the Docker Engine compatibility fix in the v0.0.96 release entry.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification:
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: Codex Desktop reviewed the exact 8593925bc diff across all nine security categories. No findings were found. The change adds no inputs, dependencies, privileges, credentials, or network access; exact production-image builds preserve the final ownership, integrity, and package-scan assertions.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Documentation Writer Review

  • Documentation writer subagent reviewed the completed changes
  • Result: docs-updated
  • Evidence: docs/changelog/2026-07-25.mdx and docs/reference/troubleshooting.mdx; the exact-head layer-grouping follow-up required no additional docs and passed changelog validation 6/6
  • Agent: Codex Desktop

DGX Station Hardware Evidence

  • Tested on DGX Station
  • Tested commit:
  • Station profile/scenario:
  • Result:
  • Supporting evidence:

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run check:diff passed when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — exact head: 34/34 layout, completed-image scan, and build-context tests; earlier focused onboarding, permissions, preloads, dependency-review, and docs contracts also passed
  • Applicable broad gate passed — exact head: npm run checks, CLI type-check through pre-push, source-shape, project-membership, test-title, test-size, Biome, hadolint, and secret-scanning checks passed
  • Docker Engine legacy-builder acceptance passed — exact head: complete OpenClaw and Hermes production images built with DOCKER_BUILDKIT=0, including final metadata, integrity, and package-scan assertions
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Apurv Kumaria akumaria@nvidia.com

Summary by CodeRabbit

  • Bug Fixes
    • Improved OpenClaw and Hermes sandbox Docker image builds by switching payload installation to cross-stage copies (avoiding BuildKit-only bind/payload steps).
    • Prebuild/local-build failures now consistently fall back to the OpenShell gateway builder.
    • Updated Hermes onboarding/prebuild failure behavior to remove the special managed BuildKit failure handling path.
  • Documentation
    • Updated the Docker build behavior changelog entry.
    • Removed outdated Hermes troubleshooting guidance for managed local image build failures.
  • Tests
    • Updated final image layout and Dockerfile contract tests to validate legacy-compatible COPY-based payload boundaries.
    • Adjusted sandbox create/prebuild test coverage after the managed Hermes BuildKit failure handling removal.
  • Chores
    • Refreshed source-shape test budget exception text for Hermes and OpenClaw final image layout contracts.

Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

OpenClaw and Hermes Dockerfiles replace BuildKit-only payload mounts with direct COPY instructions. Sandbox prebuilds remove managed Hermes failure preservation and fall back to the gateway builder after local failures. Layout tests and documentation are updated accordingly.

Changes

Docker Engine build compatibility

Layer / File(s) Summary
Direct-copy image assembly
Dockerfile, agents/hermes/Dockerfile
Payloads are copied directly into the final images, replacing bind-mounted tar extraction while retaining subsequent runtime checks.
Generic prebuild fallback
src/lib/onboard/sandbox-prebuild.ts, src/lib/onboard/sandbox-create-launch.ts, src/lib/onboard/*.test.ts
Managed Hermes failure capabilities are removed, and local build failures consistently use the gateway-builder fallback.
Layout contracts and documentation
test/*-final-image-layout.test.ts, test/node-tar-dockerfile-contract.test.ts, ci/source-shape-test-budget.json, docs/...
Tests require direct COPY boundaries and updated ordering, while build documentation reflects the new behavior.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested labels: integration: openclaw, integration: hermes, area: packaging, area: sandbox, bug-fix, platform: container

Suggested reviewers: prekshivyas, senthilr-nv

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed [#7611] The Dockerfiles now replace BuildKit-only bind mounts with COPY and the related tests/docs were updated accordingly.
Out of Scope Changes check ✅ Passed The edits stay focused on Docker Engine build compatibility, gateway fallback, and supporting tests/docs without obvious unrelated scope creep.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: making image builds work on Docker Engine via the gateway builder.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/7611-docker-engine-compat

Comment @coderabbitai help to get the list of available commands.

@github-code-quality

github-code-quality Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit 8593925 in the codex/7611-docker-en... branch remains at 96%, unchanged from commit d7b15dd in the main branch.

TypeScript / code-coverage/cli

The overall coverage in commit 8593925 in the codex/7611-docker-en... branch is 81%. The coverage in commit 921e1b0 in the main branch is 80%.

Show a code coverage summary of the most impacted files.
File main 921e1b0 codex/7611-docker-en... 8593925 +/-
src/lib/onboard/docker-cdi.ts 80% 70% -10%
src/lib/shields/index.ts 71% 67% -4%
src/lib/onboard...host-anchors.ts 94% 90% -4%
src/lib/actions...e-validation.ts 81% 84% +3%
src/lib/actions...x/mcp-bridge.ts 35% 41% +6%
src/lib/actions...lution-probe.ts 88% 95% +7%
src/lib/actions...-add-restart.ts 10% 19% +9%
src/lib/actions...confirmation.ts 69% 79% +10%
src/lib/actions...ocker-health.ts 65% 82% +17%
src/lib/onboard...box-prebuild.ts 73% 92% +19%

Updated July 27, 2026 09:33 UTC

@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/lib/onboard/sandbox-create-launch.test.ts (1)

397-401: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider keeping a managed-Hermes case for this fallback.

Switching agent from the OpenClaw agent to null makes this the generic path only. The behavior actually being retired is Hermes-specific fail-fast, so a case with the managed Hermes agent would directly prove the cutover — that a local build failure now falls back to the gateway builder instead of throwing.

As per path instructions, "Tests must prove that public entrypoints reach the new path and that the old path is deleted or cannot execute."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/onboard/sandbox-create-launch.test.ts` around lines 397 - 401, Extend
the fallback test in prepareSandboxCreateLaunchWithPrebuild to use the managed
Hermes agent, not only agent: null. Assert that a local build failure reaches
the gateway builder and returns the original Dockerfile without throwing,
directly covering removal of the Hermes-specific fail-fast path.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Dockerfile`:
- Around line 95-106: The copied scripts lack the executable modes required by
the metadata checks. In Dockerfile lines 95-106, add a chmod 755 step for both
patch-bundled npm scripts and the node-tar image scan script copied at line
1616; in agents/hermes/Dockerfile lines 324 and 693, chmod hermes-wrapper.py and
node-tar-image-scan.mts to 755 before their respective checks.

In `@test/hermes-final-image-layout.test.ts`:
- Around line 161-185: Add a shared indexOfRequired helper that asserts each
searched needle exists before returning its index, then use it for every COPY
needle and comparison anchor in test/hermes-final-image-layout.test.ts lines
161-185, the dependency/plugin/patch/runtime lookups and anchors in
test/openclaw-final-image-layout.test.ts lines 46-49, and the RUN
check_metadata() anchor at line 74; preserve the existing ordering assertions
while preventing missing anchors from producing valid comparisons.

---

Nitpick comments:
In `@src/lib/onboard/sandbox-create-launch.test.ts`:
- Around line 397-401: Extend the fallback test in
prepareSandboxCreateLaunchWithPrebuild to use the managed Hermes agent, not only
agent: null. Assert that a local build failure reaches the gateway builder and
returns the original Dockerfile without throwing, directly covering removal of
the Hermes-specific fail-fast path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 043ea2a4-acc7-4e11-a945-566aae5674ff

📥 Commits

Reviewing files that changed from the base of the PR and between 77e6e38 and 5620acf.

📒 Files selected for processing (11)
  • Dockerfile
  • agents/hermes/Dockerfile
  • ci/source-shape-test-budget.json
  • docs/changelog/2026-07-25.mdx
  • docs/reference/troubleshooting.mdx
  • src/lib/onboard/sandbox-create-launch.test.ts
  • src/lib/onboard/sandbox-create-launch.ts
  • src/lib/onboard/sandbox-prebuild.test.ts
  • src/lib/onboard/sandbox-prebuild.ts
  • test/hermes-final-image-layout.test.ts
  • test/openclaw-final-image-layout.test.ts
💤 Files with no reviewable changes (2)
  • src/lib/onboard/sandbox-create-launch.ts
  • docs/reference/troubleshooting.mdx

Comment thread Dockerfile Outdated
Comment thread test/hermes-final-image-layout.test.ts Outdated
@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Informational

Advisor assessment: Informational / low confidence
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions
Status: Same-session synthesis validation failed; the advisor result is incomplete.

Model lanes

  • GPT-5.6 Terra (primary): Completed · low confidence · 0 blockers · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 0 blockers · 2 warnings · 0 suggestions
  • Model comparison: normalized findings differ; normalized E2E selections differ; Nemotron reported the same number of blockers, 2 more warnings, the same number of suggestions.

Nemotron output stays in workflow artifacts and does not change the assessment above.

E2E guidance

Advisory only. E2E / PR Gate selects and runs jobs independently.

Recommended E2E: cloud-onboard, full-e2e, hermes-e2e, security-posture, onboard-repair, onboard-resume, state-backup-restore, upgrade-stale-sandbox

1 optional E2E recommendation
  • onboard-negative-paths

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/lib/onboard/sandbox-create-launch.test.ts (1)

397-401: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Avoid bypassing the agent type in this regression test.

as any allows this test to keep passing if the Hermes agent contract gains required fields. Use the repository’s typed Hermes fixture/factory, or construct a value that satisfies the actual agent type, so contract changes fail during type-checking instead of silently reducing test confidence.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/onboard/sandbox-create-launch.test.ts` around lines 397 - 401,
Replace the `agent: { name: "hermes" } as any` value in the `renders the
original Dockerfile for Hermes after a local build failure` test with the
repository’s typed Hermes fixture or factory, or construct a fully valid value
matching the actual agent type. Preserve the test setup while ensuring future
required Hermes agent fields produce type-checking failures.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/lib/onboard/sandbox-create-launch.test.ts`:
- Around line 397-401: Replace the `agent: { name: "hermes" } as any` value in
the `renders the original Dockerfile for Hermes after a local build failure`
test with the repository’s typed Hermes fixture or factory, or construct a fully
valid value matching the actual agent type. Preserve the test setup while
ensuring future required Hermes agent fields produce type-checking failures.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 63ae7c54-f89c-4d2d-8da9-ee2405bb6f5a

📥 Commits

Reviewing files that changed from the base of the PR and between 5620acf and 9f146f2.

📒 Files selected for processing (3)
  • src/lib/onboard/sandbox-create-launch.test.ts
  • test/hermes-final-image-layout.test.ts
  • test/openclaw-final-image-layout.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • test/hermes-final-image-layout.test.ts
  • test/openclaw-final-image-layout.test.ts

Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
@apurvvkumaria
apurvvkumaria enabled auto-merge (squash) July 27, 2026 07:40
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/hermes-final-image-layout.test.ts`:
- Around line 164-165: Update the dockerfile assertion in the final image layout
test to normalize line continuations and detect RUN instructions
case-insensitively despite repeated whitespace. Replace the literal substring
check with instruction-level parsing or an equivalent regex that reliably
rejects any BuildKit-only mount syntax.
- Around line 151-170: Update the payload assertions in the final-stage layout
test to validate the exact approved COPY source and destination for each payload
stage, not just the count returned by stage.match. Define the expected COPY
lines or source/destination pairs alongside payloads, then assert the stage’s
COPY entries and finalStage contents match those expectations exactly while
preserving the existing per-stage copy counts.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: d4350674-3faf-469e-b468-5286cd9537bd

📥 Commits

Reviewing files that changed from the base of the PR and between 4f4aace and 8593925.

📒 Files selected for processing (6)
  • Dockerfile
  • agents/hermes/Dockerfile
  • ci/source-shape-test-budget.json
  • test/hermes-final-image-layout.test.ts
  • test/node-tar-dockerfile-contract.test.ts
  • test/openclaw-final-image-layout.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • ci/source-shape-test-budget.json
  • agents/hermes/Dockerfile

Comment thread test/hermes-final-image-layout.test.ts
Comment thread test/hermes-final-image-layout.test.ts
@apurvvkumaria
apurvvkumaria merged commit a47ddd8 into main Jul 27, 2026
100 of 102 checks passed
@apurvvkumaria
apurvvkumaria deleted the codex/7611-docker-engine-compat branch July 27, 2026 09:51
@cv cv mentioned this pull request Jul 27, 2026
23 tasks
cv added a commit that referenced this pull request Jul 27, 2026
<!-- markdownlint-disable MD041 -->
## Summary

`docs/changelog/2026-07-25.mdx` now includes the user-facing fixes that
merged after #7607 and before the v0.0.96 tag.
The follow-up covers safer bulk backup and clone restore behavior,
policy and inference repairs, cleaner onboarding diagnostics, and
OpenClaw base-image validation while leaving test-only and
maintainer-internal merges out of the release entry.

## Changes

- Document the Shields-safe `backup-all` flow from #7557 and the
clone-specific restore pairing publication from #7608.
- Record the Claude Code resolved-launcher policy repair from #7581,
Hermes namespaced-model handling from #7604, and persisted Ollama
proxy-token reuse from #7620.
- Record OpenClaw immutable base-inventory validation from #7606, hidden
route-only reservations from #7621, and clean invalid gateway-management
errors from #7630.
- Link the gateway lifecycle and snapshot authorities, retain #7622's
already-merged Docker Engine wording, and exclude internal or test-only
merges from the release entry.

## Type of Change

- [ ] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [x] Doc only (prose changes, no code sample modifications)
- [ ] Doc only (includes code sample changes)

## Quality Gates

- [ ] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [x] Tests not applicable — justification: This PR changes
release-entry prose only. The changelog contract test and Fern
validation cover the dated entry, published routes, and rendering
requirements.
- [x] Docs updated for user-facing behavior changes
- [ ] Docs not applicable — justification:
- [ ] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [ ] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification:
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Documentation Writer Review

- [x] Documentation writer subagent reviewed the completed changes
- Result: `docs-updated`
- Evidence: At exact PR head `29316da26`, a Codex Desktop documentation
writer reviewed `docs/changelog/2026-07-25.mdx` against `AGENTS.md`,
`WRITING.md`, and `docs/CONTRIBUTING.md`. The review confirmed that the
full entry accurately reflects the merged user-visible behavior, retains
#7622's existing wording, appropriately excludes internal and test-only
PRs, and uses conforming terminology, structure, links, and release
classification. It also confirmed that the review follow-ups use active
third-person release-entry voice, name the actor and recovery
requirement directly, and accurately preserve the trusted-backup,
cached-release refresh, and local-build fallback constraints. The
changelog test passed 6/6, and the docs build completed with 0 errors
and 2 pre-existing hidden warnings.
- Agent: Codex Desktop
<!-- docs-review-head-sha: 29316da -->
<!-- docs-review-agents-blob-sha: be20a09 -->

## DGX Station Hardware Evidence

- [ ] Tested on DGX Station
- Tested commit:
- Station profile/scenario:
- Result:
- Supporting evidence:

## Verification

- [x] PR description includes a `Signed-off-by:` line and every commit
appears as `Verified` in GitHub
- [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or
`npm run check:diff` passed when hooks were skipped or unavailable
- [x] Targeted behavior tests pass for the current change set, or tests
are marked not applicable above — command/result or justification: `npx
vitest run test/changelog-docs.test.ts` passed 6/6 tests after the final
review fix.
- [ ] Applicable broad gate passed — `npm test` for broad
runtime/test-harness changes; `npm run check` for repo-wide
validation/coverage changes — command/result: Not applicable to this
prose-only changelog change.
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only) — exited
0 with 0 errors and 2 pre-existing hidden warnings after the final
review fix.
- [x] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

---
Signed-off-by: Carlos Villela <cvillela@nvidia.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Expanded the changelog to clarify persistent `policy exclude`/`policy
restore` behavior across rebuilds and snapshot restores, including
reporting on removed endpoints and exclusion consistency.
* Updated `claude-code` preset guidance to allow the npm-installed
OpenShell launcher path while maintaining endpoint/HTTP method scope.
* Documented hardened handling for invalid gateway-management
declarations, improved gateway/agent-version diagnostics scope, and
clarified onboarding/restore credential and reasoning precedence.
* Tightened bulk backup/restore guidance (safety windows, approval
limits, and failure recovery) and refined OpenClaw base selection to
avoid incompatible cached releases and `:latest` fallback.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
prekshivyas pushed a commit that referenced this pull request Jul 28, 2026
<!-- markdownlint-disable MD041 -->
## Summary

Hardens the Docker Engine compatibility regression tests added in #7622.
The tests now reject BuildKit-only `RUN --mount` instructions across
case, whitespace, line-continuation, and preceding RUN-flag variants,
and pin every approved scratch-payload COPY source and destination for
both OpenClaw and Hermes.

## Related Issue

Follow-up to #7622.
Relates to #7611.

## Changes

- Parse logical Dockerfile instructions before checking for forbidden
BuildKit mount syntax.
- Detect `--mount` when it follows valid preceding RUN flags such as
`--network` or `--security`.
- Assert the exact approved COPY boundaries for every OpenClaw scratch
payload stage.
- Assert the exact approved COPY boundaries for every Hermes scratch
payload stage.

## Type of Change

- [x] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [ ] Doc only (includes code sample changes)

## Quality Gates

- [x] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [ ] Tests not applicable — justification:
- [ ] Docs updated for user-facing behavior changes
- [x] Docs not applicable — justification: Test-only hardening;
Dockerfiles, runtime behavior, configuration, and supported platforms
are unchanged.
- [x] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [x] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification: Codex exact-head
security review PASS across all nine categories with no findings at
candidate 354e7de; diff fingerprint
`fcc6d7ec877ec1402b4397e2100cc80d647e883bdc621cb0b14ca647e3795606`. The
diff changes only regression tests and does not change runtime or
final-image bytes.
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Documentation Writer Review

- [x] Documentation writer subagent reviewed the completed changes
- Result: `no-docs-needed`
- Evidence: the exact candidate 354e7de changes only the OpenClaw and
Hermes final-image regression tests. It strengthens detection of
forbidden BuildKit `RUN --mount` syntax after preceding RUN flags and
pins approved scratch-payload COPY boundaries. Existing Docker Engine
compatibility documentation remains accurate; production Dockerfiles,
runtime behavior, configuration, supported platforms, and final-image
contents do not change.
- Agent: Codex Desktop documentation writer subagent
<!-- docs-review-head-sha: 354e7de -->
<!-- docs-review-agents-blob-sha: be20a09 -->

## DGX Station Hardware Evidence

- [ ] Tested on DGX Station
- Tested commit:
- Station profile/scenario:
- Result:
- Supporting evidence:

## Verification

- [x] PR description includes a `Signed-off-by:` line and every commit
appears as `Verified` in GitHub
- [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or
`npm run check:diff` passed when hooks were skipped or unavailable
- [x] Targeted behavior tests pass for the current change set, or tests
are marked not applicable above — command/result or justification: `npx
vitest run --project integration test/hermes-final-image-layout.test.ts
test/openclaw-final-image-layout.test.ts` — 15/15 passed at exact head
`354e7de4`.
- [x] Applicable broad gate passed — `npm test` for broad
runtime/test-harness changes; `npm run check` for repo-wide
validation/coverage changes — command/result: Not applicable to this
narrow test-only contract hardening; repository checks, source-shape
budget, test-size budget, Biome, secret scan, CLI typecheck, and CLI
build passed.
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only)
- [ ] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

---
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Tests**
  * Strengthened validation of final Docker image layouts.
* Added detection to prevent unsupported BuildKit `RUN --mount` usage,
including handling line continuations.
* Improved verification of payload stages by asserting the exact `COPY`
instruction lines and their order (not just counts).
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Co-authored-by: cjagwani <cjagwani@nvidia.com>
@wscurran wscurran added area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow area: packaging Packages, images, registries, installers, or distribution bug-fix PR fixes a bug or regression integration: hermes Hermes integration behavior integration: openclaw OpenClaw integration behavior platform: container Affects Docker, containerd, Podman, or images labels Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow area: packaging Packages, images, registries, installers, or distribution bug-fix PR fixes a bug or regression integration: hermes Hermes integration behavior integration: openclaw OpenClaw integration behavior platform: container Affects Docker, containerd, Podman, or images

Projects

None yet

3 participants