fix/docker: pass args directly to binary instead of shell#407
fix/docker: pass args directly to binary instead of shell#407fuleinist wants to merge 1 commit intoruvnet:mainfrom
Conversation
Problem: Shell-form ENTRYPOINT ["/bin/sh", "-c"] causes Docker to parse args as shell options instead of passing them to the server binary. Users calling 'docker run IMAGE --source wifi' see errors like: wifi: 1: --source: not found (PowerShell parsing) /bin/sh: 0: Illegal option -- (Docker shell dispatch) Fix: Switch to exec-form ENTRYPOINT ["/app/sensing-server"] so that arguments after the image name reach the binary directly. The server already reads CSI_SOURCE from the environment, so -e CSI_SOURCE=esp32 still works for environment-based configuration. Also update docker-compose.yml command to use exec-form JSON array so compose also passes args correctly. Fixes ruvnet#384 References: ruvnet#384 (can't start docker container on windows)
|
Thanks @fuleinist for spotting the shell-form ENTRYPOINT problem and writing a clear root-cause explanation — the PowerShell vs |
|
@ruvnet — recommend closing in favor of #402. Both PRs fix the shell-form ENTRYPOINT (issue #384), and that part of this PR is correct. However, after locally reproducing both against
#402 handles all of the above via a dedicated entrypoint script that injects the correct defaults while letting user flags override through clap last-wins. Thanks again to @fuleinist — the root-cause write-up here is solid and wasn't wasted work; it aligns with the diagnosis in #402. |
Problem
Docker run arguments (e.g.
--source wifi) don't reach thesensing-serverbinary on Windows (and sometimes Linux). Users see:wifi: 1: --source: not found— PowerShell interprets--as a parameter prefix/bin/sh: 0: Illegal option --— Docker dispatches--argsto/bin/sh -cwhich chokes on--Root Cause
The
Dockerfile.rustuses shell-form ENTRYPOINT:With
/bin/sh -c, the entire CMD becomes a shell command string. Any arguments after the container image name are treated asshoptions or extra positional args to the shell — they never reachsensing-server.Fix
Switch to exec-form ENTRYPOINT so arguments pass directly to the binary:
The server already reads
CSI_SOURCEfrom the environment, so-e CSI_SOURCE=simulatedcontinues to work for env-based configuration. Users who prefer CLI args can now write:Also update
docker-compose.ymlcommand to exec-form JSON array.Testing
Fixes #384