This setup helps to build raspberry pi build in an isolated environment with docker.
This repository does not have Docker environment installation script. Therefore, you need to install Docker first.
There are various methods of installing docker, i.e. by docker script:
If you download the script, make sure you have curl installed:
if curl is not installed, run:
sudo apt install curl
Then download and run the docker installation script:
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
To work better with docker, without sudo, add your user to docker group.
sudo usermod -aG docker <your_user>
Log out and log back in so that your group membership is re-evaluated.
Restart Docker
sudo systemctl daemon-reload
sudo systemctl restart docker
.
├── Ubuntu-24.04-Dockerfile
├── README.md
├── docker-build.sh
├── docker-env.sh
├── docker-run.sh
├── setup-rpi-build.sh
Use docker-env.sh to set variables for your build setup.
Make sure you have created a working directory,
owned by current user, on a larger partition.
Run docker-build.sh with one argument, related to Dockerfile,
corresponding to the operating system,
for example the Dockerfile for Ubuntu version 22.04:
./docker-build.sh Ubuntu-24.04-Dockerfile
Run the setup script to create the Raspberry Pi build environment.
./setup-rpi-build.sh
./docker-run.sh
When running, volumes are used to save the build artifacts on host.
{DOCKER_WORKDIR}as the main workspace{HOME}to mount the current home user, to make available the user settings inside the container (ssh keys, git config, etc){SSTATE_DIR}build cache directory.{DL_DIR}download directory.