LogoArc Docs

Tutorial 3 - Intro to Docker for Robotics

Learn what ROS 2 is, how workspaces are structured, and how to create your first package.

🎯 Learning Objectives

  • Understand what Docker is and why it's useful in robotics
  • Identify key Docker concepts (images, containers, Dockerfiles)
  • Learn the benefits of using Docker for reproducibility and isolation

What is Docker?

Imagine your laptop is a kitchen. Docker is like having a bunch of meal kits β€” everything you need to cook a specific meal (or run a software project) is packed neatly together. No missing ingredients, no mess.

Docker allows you to package an application and all its dependencies into a container. This container can run on any computer with Docker installed, regardless of the operating system.

πŸ“˜ Learn more: Docker Overview


Why Use Docker in Robotics?

  • βœ… Reproducibility: Everyone on your team runs the same setup.
  • βœ… Isolation: No conflicts between projects.
  • βœ… Portability: Move between laptops, labs, or robots with no reinstallation.

Core Docker Concepts (with Visual Aid)

+--------------------------+
|         Image            | <-- Recipe for your container (like a blueprint)
+--------------------------+
|       Dockerfile         | <-- Instructions to build the image
+--------------------------+
|       Container          | <-- A running instance of the image
+--------------------------+

πŸ“˜ Learn more: Docker Images vs Containers


βœ… Good Habits Checklist

  • Use Dockerfile instead of installing software manually
  • Document what each command does using comments
  • Never hardcode credentials in Dockerfiles
  • Always mount volumes to avoid losing work

πŸŽ₯ Coming Soon: Visual terminal demo β€” docker build and run


2. Getting Hands-On with Docker

πŸŽ₯ Visual: docker run in action (Insert terminal recording GIF)

Installation


Core Commands

# Download an existing image from Docker Hub
docker pull ubuntu

# Build a custom image from a Dockerfile
docker build -t my_image .

# Run an interactive container
docker run -it my_image

# List running containers
docker ps

# Start a container
docker start -ai <container-id>

# Stop a container
docker stop <container-id>

# Remove a container
docker rm <container-id>

πŸ“˜ Learn more: Docker CLI Reference


βœ… Good Habits Checklist

  • Use --rm to clean up containers automatically when testing
  • Clean up regularly using docker system prune
  • Use --name to identify containers more easily