`docker run` argument is ignored: `docker run image --port 9000` fails with `unknown flag`.
IntermediateTroubleshootingContainers that exit, crash or misbehave
Answer
Likely causes → Args after the image replace CMD entirely (and are appended to ENTRYPOINT).
Diagnose → docker inspect -f '{{.Config.Entrypoint}} {{.Config.Cmd}}' image
Fix → Pass the full command (image app --port 9000) when only CMD is defined; with ENTRYPOINT pass only the extra args; override with --entrypoint.
Prevent → Document the entrypoint contract.
More on Containers that exit, crash or misbehave
Container exits immediately with code 0 right after `docker run -d`.Beginner`Exited (137)` with no OOM flag.Intermediate`Exited (139)` segmentation fault.Advanced`Exited (126)` / `Exited (127)`.Beginner`exec /entrypoint.sh: exec format error`Intermediate`docker run` says `WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8)` and the app is very slow.Beginner