Skip to content

Add Docker support for building SD card image#13

Open
kyatsen wants to merge 1 commit into
mainfrom
feat/docker-support
Open

Add Docker support for building SD card image#13
kyatsen wants to merge 1 commit into
mainfrom
feat/docker-support

Conversation

@kyatsen
Copy link
Copy Markdown
Contributor

@kyatsen kyatsen commented Apr 3, 2026

Summary

  • Add Dockerfile, docker-compose.yml, and .dockerignore for building the SD card image without installing dependencies on the host or needing sudo password
  • Fix infinite loop bug where the debootstrap() function shadowed the debootstrap command when running as root in Docker
  • Replace all sudo calls with conditional MAYBE_SUDO (empty when running as root)

Usage

# First run (prefetch debootstrap)
docker compose run build --prefetch-debootstrap

# Build image
docker compose run build --use-prefetch-debootstrap

Tested

Both --prefetch-debootstrap and --use-prefetch-debootstrap complete successfully and produce deploy/sdcard.img.

- Complete Dockerfile with all build dependencies (debootstrap, qemu-user-static)
- Add docker-compose.yml for easy build orchestration with privileged mode
- Add .dockerignore to exclude build outputs from Docker context
- Fix debootstrap function name conflict causing infinite loop in Docker
- Replace sudo calls with MAYBE_SUDO variable (skipped when running as root)
- Update README with Docker build instructions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant