tutorial

Building Jetson Nano Images with Docker and GitHub Actions

Automate building re-usable base images for your hobby robots

tutorial

Check out the jetson-nano-image-maker repo to build custom Jetson Nano images with GitHub Actions.

Most hobby robots come with pre-imaged software - often on an SD card. Unfortunately, not all hobby robots make it easy to alter their software or build your own images from scratch. Flashing with a custom image lets you control the software packages on the robot, add your own robot logic, and create new images to suit your specific project requirements.

The Jetson Nano Developer Kit is a popular hobby embedded computer, included in the nanosaur and Yahboom robot kits.

Jetson Nano

Jetson Nano Developer Kit (c) Nvidia

The documentation on how to make your own images from scratch is cumbersome and manual. For my projects, I prefer having automated images - ideally ones I can make from Continuous Integration (CI). Since the Jetson Nano uses an ARM processor, this presents additional challenges for automation if your computer uses an Intel or AMD processor.

Docker has a cool feature called buildx, which can cross-compile arm64 images on Intel/Amd64 hosts. Pairing Docker buildx with GitHub Actions provides a great set of workflows for automating our image building.

Make your own

To make your own images, fork the jetson-nano-image-maker repo and adjust the Dockerfile to suit your needs. You can add more packages to the base install, tweak existing packages, or set various configuration files by editing the Dockerfile at the root of the repo.

Once you are happy with your changes, push them to your repo and GitHub Actions will take it from there. Once the actions run, you’ll be able to access the action artifacts which will contain a .img file.

artifacts

Grab your favorite SD card imaging software (I prefer balenaEtcher), and flash the image.

balenaEtcher

Put the image in your Jetson Nano and boot up!

Depending on your configuration, you’ll probably want to connect a network cable, HDMI cable, and keyboard. You can even choose to configure your image with a Wifi network, so your robot is online when it boots!

Fork and change the jetson-nano-image-maker repo for whatever your robot project might need!

Rinse and repeat

Automating the building of your images helps reproduce consistent and codified images for your robots. They reduce manual setup and give you a re-usable base for building your robot software.

Join our Discord community to ask any questions you may have about this tutorial, or reach out to us directly with any feedback.

Read more

Start building with Foxglove.

Get started for free