{"id":22618563,"url":"https://github.com/dokmic/docker-rpi","last_synced_at":"2026-03-16T22:03:28.857Z","repository":{"id":264604727,"uuid":"839006308","full_name":"dokmic/docker-rpi","owner":"dokmic","description":"Yet another unofficial Docker image of Raspberry Pi OS","archived":false,"fork":false,"pushed_at":"2025-01-29T22:18:22.000Z","size":71,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T21:42:34.786Z","etag":null,"topics":["docker","raspberry-pi","raspberry-pi-os"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/dokmic/rpi","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dokmic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-06T19:22:28.000Z","updated_at":"2025-01-29T22:18:26.000Z","dependencies_parsed_at":"2025-01-22T23:22:01.999Z","dependency_job_id":null,"html_url":"https://github.com/dokmic/docker-rpi","commit_stats":null,"previous_names":["dokmic/docker-rpi"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dokmic%2Fdocker-rpi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dokmic%2Fdocker-rpi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dokmic%2Fdocker-rpi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dokmic%2Fdocker-rpi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dokmic","download_url":"https://codeload.github.com/dokmic/docker-rpi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248322600,"owners_count":21084336,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","raspberry-pi","raspberry-pi-os"],"created_at":"2024-12-08T21:08:23.999Z","updated_at":"2026-03-16T22:03:28.843Z","avatar_url":"https://github.com/dokmic.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Raspberry Pi OS Docker Image\n\n[![Version](https://img.shields.io/github/v/release/dokmic/docker-rpi?label=version)](https://github.com/dokmic/docker-rpi/releases/latest)\n[![License][license-image]][license]\n\nThis is an unofficial Docker image of Raspberry Pi OS running in QEMU.\n\nUnlike others, this image is optimized to run inside a container with volumes support.\n\n## Features\n\n- Optimized for Docker Desktop.\n- Volumes support.\n- Power Management support.\n- `cmdline.txt` support.\n\n## Context\n\n### Motivation\n\nSometimes, testing your work on the Raspberry Pi OS is much easier without running it on real hardware.\nThings like Ansible Playbooks or a Kubernetes cluster, in most cases, can be tested in a virtualized environment.\n\nThere are plenty of tutorials and other Docker images running Raspberry Pi OS using QEMU, but all of them extract the OS image at runtime.\nHence, they do not support mounting volumes to share the filesystem.\n\n### Performance Optimization\n\nFirst off, the Docker image is running QEMU using the `virt` generic virtual platform.\nThe QEMU developers [claim](https://www.qemu.org/docs/master/system/arm/virt.html) that it is designed for use in virtual machines.\nAs Docker Desktop is already running on a virtual machine, using the `virt` machine type gives a noticeable performance increase.\n\nAnother optimization is using the [9P passthrough filesystem](https://wiki.qemu.org/Documentation/9p).\nCompared to mounting a binary image, this filesystem significantly improves I/O throughput.\n\n### Power Management Support\n\nThe image has a wrapper that restarts the virtual machine on reboot.\nOn shutdown, the container is exited with a zero exit code.\n\nThe reboot support without stopping the container simulates the `cmdline.txt` behavior.\nThat means the file can be edited, and the Raspberry OS kernel should pick up the updated options after the next reboot, just like the normal Raspberry Pi OS.\n\n## Usage\n\nThe container can be started using the [`run`](https://docs.docker.com/reference/cli/docker/container/run/) command:\n\n```bash\ndocker run -it dokmic/rpi\n```\n\nAfter the boot, it should be possible to log in with the default user `pi` and password `raspberry`.\n\n### SSH\n\nTo access the SSH service, the related port should be forwarded to the host system:\n\n```bash\ndocker run -it -p 2222:22 dokmic/rpi\n```\n\n### Custom Command\n\nTo override the kernel init command, the `command` argument in the `run` command should be specified:\n\n```bash\ndocker run dokmic/rpi init=/bin/bash -c 'echo \"hello world\"'\n```\n\n### Custom Parameters\n\nSome of the parameters can be customized via the environment variables (e.g., CPU, RAM, or user credentials):\n\n```bash\ndocker run -it -e RPI_USER=user -e RPI_PASSWORD=password dokmic/rpi\n```\n\n### Shared Volumes\n\nTo share data from your host with the running Raspberry Pi OS, the [Docker Volumes](https://docs.docker.com/engine/storage/volumes/) should be mounted below `/media/sd`:\n\n```bash\ndocker run -it -v .:/media/sd/root/app dokmic/rpi\n```\n\n### Stopping Container\n\nThe container can be stopped using the [`kill`](https://docs.docker.com/reference/cli/docker/container/kill/) and [`stop`](https://docs.docker.com/reference/cli/docker/container/stop/) commands.\n\nOr within the container using power management commands, e.g.:\n```\nsudo poweroff\n```\n\n### Docker Compose\n\nIt is also possible to create a service using Docker Compose:\n\n```yaml\nservices:\n  rpi:\n    environment:\n      - RPI_CPU\n      - RPI_PASSWORD\n      - RPI_PORT\n      - RPI_RAM\n      - RPI_SSH\n      - RPI_USER\n    image: dokmic/rpi:latest\n    ports:\n      - 2222:22\n```\n\n## Parameters\n\nName | Default | Description\n--- | --- | ---\n`RPI_CPU` | `4` | The number of CPU cores.\n`RPI_RAM` | `1G` | The amount of available RAM.\n`RPI_PORT` | `22/tcp` | The space-separated set of ports forwarded inside the running container (e.g., `22/tcp 80/tcp 53/udp`).\n`RPI_SSH` | `true` | The boolean flag enables the SSH server.\n`RPI_USER` | `pi` | The predefined user.\n`RPI_PASSWORD` | `raspberry` | The predefined user password.\n\n## Tags\n\nThe image tags follow the Raspberry Pi OS release dates and architectures:\n\n- [`latest`](https://hub.docker.com/layers/dokmic/rpi/latest), [`arm64`](https://hub.docker.com/layers/dokmic/rpi/arm64) \u0026mdash; points to the most recent 64-bit ARM build.\n- [`arm`](https://hub.docker.com/layers/dokmic/rpi/arm) \u0026mdash; points to the most recent 32-bit ARM build.\n- `YYYYMMDD`, `YYYYMMDD-arm64` \u0026mdash; points to the specific 64-bit ARM release.\n- `YYYYMMDD-arm` \u0026mdash; points to the specific 32-bit ARM release.\n\nSee all the available tags on [Docker Hub](https://hub.docker.com/r/dokmic/rpi/tags).\n\n## License\n\n[WTFPL 2.0][license]\n\n[license]: http://www.wtfpl.net/\n[license-image]: https://img.shields.io/badge/license-WTFPL-blue\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdokmic%2Fdocker-rpi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdokmic%2Fdocker-rpi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdokmic%2Fdocker-rpi/lists"}