Description
When attempting to run the TurtleBot3 demo with NVIDIA GPU acceleration using docker compose --profile nvidia up, Docker fails with a port binding error because both the default CPU service and the NVIDIA service try to bind to port 8080 simultaneously.
Steps to Reproduce
- Navigate to
demos/turtlebot3_integration/
- Run:
./run-demo.sh --nvidia
OR
docker compose --profile nvidia up
- Observe error
Expected vs Actual Behavior
Expected:
- NVIDIA GPU-accelerated demo starts successfully on port 8080
- Only the nvidia-profile service runs
Actual:
- Error:
ports are not available: exposing port TCP 0.0.0.0:8080 -> 127.0.0.1:0: listen tcp 0.0.0.0:8080: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted
- Both services attempt to start, causing port conflict
Root Cause
The default turtlebot3-demo service had no profile assigned, so it started automatically along with the turtlebot3-demo-nvidia service when using --profile nvidia. Both services tried to bind to port 8080.
Environment
- OS: Linux (Docker host)
- Docker Compose: v2.x
- NVIDIA GPU: Required for reproduction
Solution
Assign profile cpu to the default service and update run-demo.sh to use --profile cpu by default. This ensures only one service runs at a time based on the specified profile.
Description
When attempting to run the TurtleBot3 demo with NVIDIA GPU acceleration using
docker compose --profile nvidia up, Docker fails with a port binding error because both the default CPU service and the NVIDIA service try to bind to port 8080 simultaneously.Steps to Reproduce
demos/turtlebot3_integration/./run-demo.sh --nvidiaOR
docker compose --profile nvidia upExpected vs Actual Behavior
Expected:
Actual:
ports are not available: exposing port TCP 0.0.0.0:8080 -> 127.0.0.1:0: listen tcp 0.0.0.0:8080: bind: Only one usage of each socket address (protocol/network address/port) is normally permittedRoot Cause
The default
turtlebot3-demoservice had no profile assigned, so it started automatically along with theturtlebot3-demo-nvidiaservice when using--profile nvidia. Both services tried to bind to port 8080.Environment
Solution
Assign profile
cputo the default service and updaterun-demo.shto use--profile cpuby default. This ensures only one service runs at a time based on the specified profile.