{"id":20377767,"url":"https://github.com/rolandjitsu/raspi-cross","last_synced_at":"2026-04-17T12:33:07.629Z","repository":{"id":95766459,"uuid":"300135680","full_name":"rolandjitsu/raspi-cross","owner":"rolandjitsu","description":"Cross-compile for Raspberry Pi with Docker","archived":false,"fork":false,"pushed_at":"2020-10-04T07:08:29.000Z","size":11,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-30T07:59:12.097Z","etag":null,"topics":["cross-compilation","docker","raspberry-pi"],"latest_commit_sha":null,"homepage":"https://rolandsdev.blog/cross-compile-for-raspberry-pi-with-docker","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rolandjitsu.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,"zenodo":null}},"created_at":"2020-10-01T04:00:15.000Z","updated_at":"2025-10-18T09:43:05.000Z","dependencies_parsed_at":"2023-05-22T00:30:22.021Z","dependency_job_id":null,"html_url":"https://github.com/rolandjitsu/raspi-cross","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rolandjitsu/raspi-cross","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rolandjitsu%2Fraspi-cross","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rolandjitsu%2Fraspi-cross/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rolandjitsu%2Fraspi-cross/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rolandjitsu%2Fraspi-cross/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rolandjitsu","download_url":"https://codeload.github.com/rolandjitsu/raspi-cross/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rolandjitsu%2Fraspi-cross/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31929703,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T10:35:34.458Z","status":"ssl_error","status_checked_at":"2026-04-17T10:35:09.472Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cross-compilation","docker","raspberry-pi"],"created_at":"2024-11-15T01:46:26.033Z","updated_at":"2026-04-17T12:33:07.624Z","avatar_url":"https://github.com/rolandjitsu.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Raspi Cross\n\u003e Cross-compile for Raspberry Pi with Docker.\n\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/rolandjitsu/raspi-cross/Test?label=tests\u0026style=flat-square)](https://github.com/rolandjitsu/raspi-cross/actions?query=workflow%3ATest)\n\n## Prerequisites\nInstall the following tools:\n* [Docker](https://docs.docker.com/engine) \u003e= `19.03.13`\n* [buildx](https://github.com/docker/buildx#installing) \u003e= `v0.4.1`\n\n## Setup Docker\nCheck current builder instances:\n```bash\ndocker buildx ls\n```\n\nIf you see an instance that uses the `docker` driver, switch to it (it's usually the `default`):\n```\ndocker buildx use \u003cinstance name\u003e\n```\n\nOtherwise, create a builder:\n```bash\ndocker buildx create --name my-builder --driver docker --use\n```\n**NOTE**: You cannot create more than one instance using the `docker` driver.\n\nThen inspect and bootstrap it:\n```bash\ndocker buildx inspect --bootstrap\n```\n\n## Setup Base Images\nPrepare the base cross-compilation image:\n```bash\ndocker buildx build -f Dockerfile.cross --tag cross-stretch .\n```\n**NOTE**: By default, the image is going to be available to use on the host as `cross-stretch`. If `docker images` doesn't show it, add the `--load` flag when building.\n\n*P.S.* To bust the cache, use `--no-cache`.\n\nPrepare the base image w/ some common libs usually available on the Pi:\n```bash\ndocker buildx build -f Dockerfile.cross-pi --tag cross-pi .\n```\n\n## Compile\nCompile the `hello` binary:\n```bash\ndocker buildx build -f Dockerfile.hello -o type=local,dest=./bin .\n```\n\nCompile the `hello-pi` binary:\n```bash\ndocker buildx build -f Dockerfile.hello-pi -o type=local,dest=./bin .\n```\n\n## Bake\nTo make things easier, you can use the [bake](https://github.com/docker/buildx#buildx-bake-options-target) command.\n\nTo setup the base image:\n```bash\ndocker buildx bake cross-stretch\n```\n\nTo setup the base image w/ goodies:\n```bash\ndocker buildx bake cross-pi\n```\n\nTo compile the binaries:\n```bash\ndocker buildx bake\n```\n\n*P.S.* To bust the cache, you can use `--no-cache`.\n\n## Learning Material\n* [Docker Buildx](https://docs.docker.com/buildx/working-with-buildx/)\n* [Getting started with Docker for ARM on Linux](https://www.docker.com/blog/getting-started-with-docker-for-arm-on-linux/)\n* [Leverage multi-CPU Architectures](https://docs.docker.com/docker-for-mac/multi-arch/)\n* [Best practices for writing Dockerfiles](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frolandjitsu%2Fraspi-cross","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frolandjitsu%2Fraspi-cross","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frolandjitsu%2Fraspi-cross/lists"}