Theme
Stage 1 · lesson 1 of 5 · 40 min

Docker, and nothing else

You will: Run a complete robotics toolchain without installing any of it.

Most robotics tutorials begin with twenty apt install lines and end with a machine nobody can reproduce. Six months later something breaks and nobody knows which of those lines did it.

You already solve this problem at work. The environment is a build artefact: declared in a file, built from that file, identical for everyone. Robotics gets no exemption, so the first thing this project builds is not a robot — it is an image.

The image is built from ros:jazzy-ros-base, not from a ready-made community image that already has Gazebo in it. That would have been quicker on day one and wrong for a course: nobody stands behind it, its layers cannot be audited for licences, and a course about owning your environment should not begin by handing you a black box.

make doctor runs before anything else because the most common failure here is not a bug. Docker Desktop ships with less memory than Gazebo needs, and when the simulator is killed for being too large, what you see looks like a Gazebo crash. So doctor checks memory, architecture, disk and the port, and every failure prints the fix rather than a diagnosis.

Read its output even when it passes. What it checks is a list of what usually goes wrong.

In the simulation

The arm in this page is drawn from the same SO-101 description make so101-fetch downloads: its links, meshes and joint limits. The page is a kinematic drawing, not the container; drive it to see what the fetched file says the arm can do.

Kinematic: joints move at their real speed limit, but there is no gravity, no load and no physics. That is what the steps below are for.

The SO-101 loads as you reach it.

In this lesson

  1. Drag shoulder_pan to its upper limit. The slider stops at +110°, the limit written in the URDF you fetched.
  2. Now drag shoulder_lift to its lower limit, −100°.
  3. Press h (or the home button) to put every joint back at 0.

Do it

  1. Get the code, and work from inside it for the rest of the course.

    git clone https://github.com/narsi97/3vn-robotics.git && cd 3vn-robotics
    

    Expect: A 3vn-robotics folder with a Makefile at the top.

  2. See what the project can do. The Makefile is the interface; nothing below needs typing twice.

    make
    

    Expect: A list of the everyday targets, from doctor and setup at the top to clean and nuke at the bottom. It is not every target: later tiers bring their own, such as make train.

  3. Check the machine before building anything.

    make doctor
    

    Expect: A line per check — daemon, architecture, memory, CPUs, free disk, port 8106, git, gh. Any failure names the exact setting to change. A yellow warn is not a failure. Without the GitHub CLI the gh line is one, and nothing in this stage uses it.

  4. If memory failed, fix it now: Docker Desktop → Settings → Resources → Memory, 6 GB or more. Then run make doctor again.

  5. Build the image and the ROS workspace. The first run downloads several gigabytes; later runs are cached.

    make setup
    

    Expect: The build ends with colcon reporting every package finished.

  6. Confirm the image is native to your machine rather than emulated.

    docker image inspect threevn-robotics-dev:local --format '{{.Architecture}}'
    

    Expect: arm64 on Apple Silicon, amd64 on most other machines. No platform is pinned anywhere, so neither is emulated.

  7. Fetch the robot. The SO-101's description is TheRobotStudio's, Apache-2.0, and it is not committed here: it is downloaded at one pinned upstream commit, checksummed, into vendor/, which git ignores. Everything that draws or simulates the arm needs it.

    make so101-fetch
    

    Expect: A line per file fetched, the URDF and thirteen meshes, then 13 meshes in .../vendor/so101/assets and ok.

You will know it worked when: make doctor prints no FAIL line and ends with Environment looks good, make setup finishes with a built workspace, and make so101-fetch ends with ok.

When it goes wrong

make setup fails partway with "no space left on device".

Why: The image is 5–6 GB, and build volumes and cache come on top. Budget about 10 GB.

Fix: docker system df shows where the space went. make nuke removes this project's container, image and volumes, and prunes Docker's build cache, which every project on the machine shares.

Everything works, but builds and runs are several times slower than expected.

Why: The image is being emulated — an amd64 image on an Apple Silicon Mac, usually because of a DOCKER_DEFAULT_PLATFORM setting.

Fix: Unset the override and rebuild. The base image publishes a native arm64 manifest; pinning a platform would force emulation on whichever architecture it does not match.

Terms

Dev container
The development environment as a build artefact — declared in a Dockerfile, rebuilt identically by every developer and by CI.
Preflight check
A script that verifies the environment before any real work starts, so a resource problem fails clearly instead of masquerading as a bug later. Here, make doctor.
Architecture decision record (ADR)
A short document recording one decision: its context, the choice, the alternatives rejected and why, and the consequences. This project's are in docs/decisions/.

Every term in the course: glossary.

Check yourself

Answer in your head first, then open it.

Why does make doctor check Docker's memory before anything else?

Because the commonest failure is not a bug. An undersized Docker VM OOM-kills Gazebo, and the symptom looks like a simulator crash. Checking first turns a misleading failure into a clear one with a known fix.

The image is built from ros:jazzy-ros-base rather than a community image with Gazebo already installed. Give two reasons.

Any two of: no stability contract behind a paid course; layers that cannot be audited for licences; no room for the toolchain layers later phases add; and a course about owning your environment should not start with a black box. See ADR-0002.

Stretch

Before reading scripts/doctor.sh, write down the five things you would expect to go wrong with a robotics environment on a laptop. Then read the script and compare. Which of yours does it not check, and is that an omission or something that cannot be checked in advance?

Going deeper