Skip to content

webdavis/docker-raspios-lite

Repository files navigation

Repo Icon

docker-raspios-lite

CD - Deploy images to Docker Hub

This project builds and publishes Docker images for Raspberry Pi OS Lite on Docker Hub.

Table of Contents

Supported Architectures

Images are published as multi-arch manifests. Use the table below to choose the right tag for your device:

Device Type Recommended Tag Alternative Tags (aliases) Available Platforms Notes
Raspberry Pi 3, 4, 400, 5 (64-bit OS) arm64 arm64-<date>,
64-bit,
64-bit-<date>
linux/arm64 Best performance on modern Pis
Raspberry Pi 2, 3, 4, Zero 2 (32-bit OS) armhf armhf-<date>,
32-bit,
32-bit-<date>
linux/arm/v7,
linux/arm64
Default choice for 32-bit systems
Raspberry Pi Zero (v1), Pi 1 armhf armhf-<date>,
32-bit,
32-bit-<date>
linux/arm/v6 Legacy devices (32-bit armel)

Tip

  • Use arm64 if your OS is 64-bit and you’re on a newer Pi.
  • Use armhf for 32-bit compatibility or older boards.
  • (Pro Tip: The arch-YYYYMMDD tag aliases are immutable and built from the official Raspberry Pi OS Lite root filesystems published on that specific date. These will never change. Choose these to ensure reproducibility.)

Usage

This section explains how to set up Docker on your machine and work with the Raspberry Pi OS Lite images provided by this project. Follow the steps below to get started.

Docker Setup/Installation

On macOS, you can install Docker Desktop (which includes Buildx) via Homebrew:

brew install --cask docker-desktop

After installation, launch Docker Desktop complete the setup (accepting licenses, etc.), before building any images.

Running the Images

These images can be used as a base for Raspberry Pi OS Lite-specific containers:

FROM webdavis/raspios-lite:arm64-20250513

# Add your own layers here...

Or run a container directly, like so:

docker run --rm -it --platform linux/arm64 webdavis/raspios-lite:arm64

Note

To run ARM containers on an x86_64 (Intel/AMD) host, QEMU emulation must be enabled (see below).

Running ARM Containers on x86_64 Hosts (QEMU Setup)

Install QEMU and enable binfmt support via your system’s package manager:

Debian/Ubuntu:

sudo apt install qemu-user-static binfmt-support

NixOS:

Add the following to your NixOS config (/etc/nixos/configuration.nix):

environment.systemPackages = with pkgs; [
  qemu_user_static
  binfmt
];

Then run the following:

sudo nixos-rebuild switch

Fedora:

sudo dnf install qemu-user-static binfmt-support

Arch Linux:

sudo pacman -S qemu-user-static binfmt-support

Dev Setup (How to Work on this Project)

This project requires Docker and Buildx.

Again, assuming you're on macOS, you will need to install Docker Desktop (which comes with Buildx) via Homebrew:

brew install --cask docker-desktop

Download this repo:

git clone git@github.com:webdavis/docker-raspios-lite.git

Then switch into the project directory:

cd docker-raspios-lite

Building Images Locally

Use the docker-wrapper.sh script to build and inspect project images on your dev machine.

docker-wrapper.sh is a convenience script that makes working on this project a tad easier.

Building 64-bit (arm64) Compatible Images

To build the 64-bit variant for an arm64 architecture, run the following command:

./docker-wrapper.sh -a -o

Note: The -o option will append the --load flag to the docker command, which loads the built image into Docker so that you can run it locally.

Building 32-bit (armhf/armel) Compatible Images

When building a 32-bit image with the -h flag, you must specify which Platform the image should be built for, for example armv7 or armv6. The following table will help you:

  • armv7linux/arm/v7 (most models: Pi 2, 3, 4, Zero 2)
  • armv6linux/arm/v6 (Pi Zero v1, Pi 1, legacy)
  • arm64linux/arm64 (32-bit on 64-bit hardware)

For example, run the following command to build and load a 32-bit image for Pi 2/3/4/Zero 2:

./docker-wrapper.sh -h armv7 -o

List Local Project Architectures

The following command lists the architectures this project has built locally on your machine:

./docker-wrapper.sh -l

List Remote Image Architectures (Docker Hub Manifests)

The command below lists the image manifests from Docker Hub that are tracked by this project, which shows all available platforms (architectures/OS variants) that the image supports.

Note

Commands that access Docker Hub require you to be logged in via docker login.

./docker-wrapper.sh -r

Linting

This project uses Hadolint to enforce Dockerfile best practices.

Hadolint can be installed using Homebrew:

brew install hadolint

Running Hadolint

To lint the Dockerfile, run:

hadolint Dockerfile

Linting rules for this project are defined in the .hadolint.yaml file.

Raspberry Pi OS Lite Root File System

The latest root file system for Raspberry Pi OS Lite is provided as root.tar.xz in Raspberry Pi's official downloads archive.

Just click on the latest version (or most recent date).

Justfile

This project provides a justfile for ease-of-use.

Install it like so:

brew install just

just is a handy way to run project-specific commands.

For example, instead of typing in ./docker-wrapper.sh --arm64 --push, you can simply run:

just A

Instead of using docker image ls -a to list all Docker images, you can simply run:

just c

And then delete them all with:

just C

About

Deploys "Raspberry Pi OS Lite" images to Docker Hub.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors