Skip to content

Commit a914e84

Browse files
miyoungcclaude
andcommitted
fix(docker): clarify HEALTHCHECK override contract and add probe to test image
Address CodeRabbit feedback: expand the Dockerfile.base HEALTHCHECK comment to explicitly document that child images exposing services MUST override the baseline probe, and add an explicit HEALTHCHECK to test/Dockerfile.sandbox so it does not inherit a potentially service-oriented check that would produce false positives. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Miyoung Choi <miyoungc@nvidia.com>
1 parent bb1fc5b commit a914e84

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

Dockerfile.base

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,11 @@ RUN mkdir -p /sandbox/.openclaw-data/agents/main/agent \
128128
RUN npm install -g openclaw@2026.3.11 \
129129
&& pip3 install --no-cache-dir --break-system-packages "pyyaml==6.0.3"
130130

131-
# Basic health check for the base image. The base doesn't run services,
132-
# so just verify the Node.js runtime is functional. The production
133-
# Dockerfile overrides this with a gateway-specific check.
131+
# Baseline health check — validates the Node.js runtime only.
132+
# The base image doesn't run services, so a process-level check is the
133+
# best we can do here. **Child images that expose services MUST override
134+
# this** with a service-specific probe (e.g., curl the gateway /health
135+
# endpoint). The production Dockerfile already does so; any new child
136+
# Dockerfile should add its own HEALTHCHECK instruction as well.
134137
HEALTHCHECK --interval=30s --timeout=5s --start-period=45s --retries=3 \
135138
CMD node -e "process.exit(0)" || exit 1

test/Dockerfile.sandbox

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,9 @@ RUN mkdir -p /sandbox/openclaw-state/extensions /sandbox/openclaw-state/skills /
8686
&& printf '%s\n' '---' 'name: override-hook' 'description: Override hook fixture' '---' > /sandbox/openclaw-state/hooks/demo-hook/HOOK.md \
8787
&& printf '%s\n' 'export default async function overrideHook() {}' > /sandbox/openclaw-state/hooks/demo-hook/handler.js
8888

89+
# Test image: no long-running service, so just verify the runtime works.
90+
# Overrides any inherited HEALTHCHECK to avoid false-positive probes.
91+
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
92+
CMD node -e "process.exit(0)" || exit 1
93+
8994
ENTRYPOINT ["/bin/bash"]

0 commit comments

Comments
 (0)