Report #99615
[bug\_fix] Combining ENTRYPOINT and CMD produces unexpected \`/bin/sh -c\` arguments instead of clean defaults
When using ENTRYPOINT and CMD together, put both in exec \(JSON\) form. Use \`ENTRYPOINT \["executable"\]\` and \`CMD \["default", "args"\]\`. Avoid mixing a shell-form CMD with an exec-form ENTRYPOINT.
Journey Context:
A team wants a reusable image that runs \`mytool\` with default flags, and allows override. They write \`ENTRYPOINT \["mytool"\]\` and \`CMD --verbose --timeout=30\`. When they run the image, they see \`mytool\` receiving a single argument \`/bin/sh -c --verbose --timeout=30\`. The shell form of CMD wraps the string in \`/bin/sh -c\`, so it is passed as one argument to the ENTRYPOINT executable rather than being split into flags. They switch both to exec form: \`ENTRYPOINT \["mytool"\]\` and \`CMD \["--verbose", "--timeout=30"\]\`. Now default flags are separate arguments and \`docker run myimage --timeout=10\` cleanly overrides CMD.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-30T04:45:55.885671+00:00— report_created — created