Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Docker Container for ROS Development

A Docker containerized ROS Humble development environment with NiceGUI support for building web-based UIs for robotics applications.

Prerequisites

  • Docker Desktop installed and running
  • Git (for cloning repositories)
  • A terminal/PowerShell

Quick Setup

1. Clone This Repository

git clone https://github.com/yourusername/docker-container.git
cd docker-container

2. Clone the Basestation NiceGUI Project

Clone the project you want to work on into your desired location:

git clone https://github.com/yourusername/Basestation-nicegui.git

3. Mount the Project in Docker

The container uses a relative mount path (.:/ws), so you have two options:

Option A: Mount from Docker Compose Directory (Recommended)

Place your project in the same directory as docker-compose.yml:

# Copy/move your Basestation-nicegui into the docker-container folder
cp -r ../Basestation-nicegui ./Basestation-nicegui

# Then run from the docker-container directory
cd docker-container
docker compose up --build

Option B: Modify docker-compose.yml

Update the volume mount in docker-compose.yml to point to your project:

volumes:
  - "../Basestation-nicegui:/ws"  # Relative path to your project
  # OR absolute path (cross-platform):
  - "/path/to/your/Basestation-nicegui:/ws"

Running the Container

Start the Container with Build

docker compose up --build

Pull the Latest ROS Base Image (Optional)

docker pull ros:humble-ros-base
docker compose up --build

Stop the Container

docker compose down

Working Inside the Container

Open an Interactive Shell

docker compose exec ros-dev bash

Build ROS Workspace

source /opt/ros/humble/setup.bash
colcon build --symlink-install
source install/setup.bash

Run NiceGUI Application

cd /ws
python3 rover_ui.py

Or if your app is in a subdirectory:

cd /ws/nicegui_test
python3 rover_ui.py

Access the Web UI

After starting the NiceGUI application, open your browser and navigate to:

http://localhost:8080

Project Structure

docker-container/
├── Dockerfile           # ROS + Python environment
├── docker-compose.yml   # Container orchestration
├── requirements.txt     # Python dependencies
├── README.md           # This file
└── [mounted project]/  # Your Basestation-nicegui project mounts to /ws

Dependencies

The container includes:

  • Base: ROS Humble
  • System Packages:
    • python3-pip
    • python3-colcon-common-extensions
    • git
  • Python Packages (from requirements.txt):
    • nicegui

Add more Python dependencies by editing requirements.txt and rebuilding the container.

Troubleshooting

Container fails to build

docker compose up --build --no-cache

Permission denied in container

Ensure Docker Desktop has adequate permissions and try restarting it.

Port 8080 already in use

Modify the port mapping in docker-compose.yml:

ports:
  - "8081:8080"  # Host port 8081 → Container port 8080

Changes not reflected in container

Rebuild the container:

docker compose down
docker compose up --build

Development Workflow

  1. Clone your project locally
  2. Mount it in the docker-compose.yml
  3. Start the container (docker compose up --build)
  4. Connect to container (docker compose exec ros-dev bash)
  5. Build ROS workspace (colcon build --symlink-install)
  6. Run your application (python3 rover_ui.py)
  7. Access via browser (http://localhost:8080)

Adding More Python Dependencies

Edit requirements.txt and add your package:

nicegui
numpy
requests

Then rebuild:

docker compose up --build

Additional Resources

About

The dockerfile and docker compose, will be integrated with the central ros node once ready, for now just integrated with nicegui

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages