This guide helps students and instructors set up the development and simulation environment for the school using Docker and ROS 2. It supports both Linux and non-Linux systems through containerization.
- Students: Use the prepared Docker environment to work on practical exercises.
- Instructors: Customize the base Docker image with your own installation scripts for specific content.
Please, choose one of the following options:
- Option 1: Local installation (Linux only, Ubuntu 24.04)
- Option 2: Docker environment
If you're using Ubuntu 24.04 and prefer to install dependencies without Docker, you can install ROS 2 Jazzy and run the provided setup script to configure the simulator locally.
cd ~/ros2_ws
./docker_infrastructure/docker/installation_scripts/simulator.sh
- Ubuntu users: Follow the official Docker installation guide for Ubuntu: Docker Engine on Ubuntu
- Windows/macOS users (or Ubuntu with GUI): Install Docker Desktop: Docker Desktop
If you are using Docker Desktop, you only need to pull the image by searching for jmguerreroh/school:ubuntu24
in Docker Desktop’s search interface or by running the following command in the Terminal:
docker pull jmguerreroh/school:ubuntu24
When running the image, set 6080 as the host port in the Docker settings. Once it's running, continue with Step 6.
Create a directory for the school environment and clone the repository:
mkdir ~/ros2_ws && cd ~/ros2_ws
git clone https://github.com/IntelligentRoboticsLabs/docker_infrastructure.git
To enable GPU Acceleration (Linux + NVIDIA) usage inside Docker
- Install the NVIDIA drivers.
- Install the NVIDIA Container Toolkit. Execute the script:
cd ~/ros2_ws/docker_infrastructure/docker/
./nvidia_install.sh
- If you have an NVIDIA card in your system and it is configured with the proper drivers, you can execute the following command to switch between the integrated graphics card and the NVIDIA GPU:
sudo prime-select nvidia
- After running prime-select, you will need to restart your system for the changes to take effect:
sudo reboot
There are two ways to get the Docker image:
- 4.1. Option 1: Download Prebuilt Image from Docker Hub (RECOMMENDED):
docker pull jmguerreroh/school:ubuntu24
- 4.2. Option 2: Build image locally Navigate to the Docker directory and build the Docker image:
cd ~/ros2_ws/docker_infrastructure/docker/
sudo docker buildx build --platform=linux/amd64 -t jmguerreroh/school:ubuntu24 -f Dockerfile .
Run the Docker image using the provided script:
./run_docker.sh
**Note: If you run this command without having the image, it will attempt to download it from Docker Hub as in step 4.1.
Open your browser and go to: http://localhost:6080/
You should see a full development desktop environment:
-
7.1. If the container is currently running and you need to stop it, follow these steps:
docker stop school
Your work is preserved unless you explicitly remove the container.
- 7.2. If it's stopped and you want to start it again:
docker start school
Create an installation script with the necessary setup for your course and place it inside the installation_scripts
folder.
- Follow steps 4.2 and 5 again to build the Docker image.
- Execute your script inside the Docker container. Once the Docker container is running, open a terminal inside the container and execute your script:
source /installation_scripts/your_script.sh
If the Docker image is already built and shared:
- Upload your setup script to a public URL.
- Ask students to download it using Firefox inside the Docker desktop and run it in the terminal.