Docker for Robotics

Docker - What and Why

  • What is Docker?
    • A VM is a way to simulate a computer running inside of a computer
      • Can run 2 or more operating systems, but this is resource heavy
    • Docker is not a VM- it uses containers
      • We keep the core part of the OS, the Kernel (common with all Linux distros), which talks to the hardware
      • Everything else running on top of the Kernel (e.g. software libraries, programs, file systems etc), which differentiate operating systems, will be run in containers
        • Gives us most of the benefits of VMs, and removes most of the cons

picture 0

Images

picture 2

  • We can use Docker images to create containers
    • Docker images are layered, which saves storage space if have similar images (e.g. sharing a layer for Ubuntu)

picture 3

  • We use a Dockerfile to define what’s inside an image
    • A normal workflow is to take an existing image, create a Dockerfile to add custom layers, and make a new Docker image picture 4

Containers

  • We can run an image to create a container, similar to flashing an image to a harddrive

picture 5

  • We can start and stop a container, treating it like a VM
    • But can also destroy and re-run the container, keeping the important data in a shared, persistent location. picture 6

Why Docker for robotics?

picture 7

Using Docker

  • Pull ROS2 image
docker image pull ros:humble from Docker Hub
  • Show images
docker image ls
  • Run container
docker run -it ros:humble
  • Show running container
docker container ls

Docker 101

Crafting your Dockerfile (Docker and Robotics Pt 3)

Devices in Docker - Not so simple! (Docker for Robotics #4)

Dev Containers

https://articulatedrobotics.xyz/tutorials/docker/dev-containers