{"id":13471247,"url":"https://github.com/mwarning/docker-openwrt-build-env","last_synced_at":"2025-03-26T13:30:55.846Z","repository":{"id":41745921,"uuid":"164486356","full_name":"mwarning/docker-openwrt-build-env","owner":"mwarning","description":"A Docker container to build OpenWrt images","archived":false,"fork":false,"pushed_at":"2025-03-15T19:50:44.000Z","size":17,"stargazers_count":167,"open_issues_count":1,"forks_count":57,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-15T20:27:15.669Z","etag":null,"topics":["build","docker","openwrt"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mwarning.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-01-07T20:00:48.000Z","updated_at":"2025-03-15T19:50:47.000Z","dependencies_parsed_at":"2024-10-30T01:51:54.303Z","dependency_job_id":null,"html_url":"https://github.com/mwarning/docker-openwrt-build-env","commit_stats":null,"previous_names":["mwarning/docker-openwrt-builder"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwarning%2Fdocker-openwrt-build-env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwarning%2Fdocker-openwrt-build-env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwarning%2Fdocker-openwrt-build-env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwarning%2Fdocker-openwrt-build-env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mwarning","download_url":"https://codeload.github.com/mwarning/docker-openwrt-build-env/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245662777,"owners_count":20652081,"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":["build","docker","openwrt"],"created_at":"2024-07-31T16:00:42.185Z","updated_at":"2025-03-26T13:30:55.831Z","avatar_url":"https://github.com/mwarning.png","language":"Dockerfile","funding_links":[],"categories":["Dockerfile"],"sub_categories":[],"readme":"# Docker OpenWrt Build Environment\n\nBuild [OpenWrt](https://openwrt.org/) images in a Docker container. This is sometimes necessary when building OpenWrt on the host system fails, e.g. when some dependency is too new. The docker image is based on Debian 10 (Buster).\n\nBuild tested:\n\n- Openwrt-24.10.0\n- Openwrt-23.05.4\n- OpenWrt-22.03.5\n- OpenWrt-21.02.2\n- OpenWrt-19.07.8\n- OpenWrt-18.06.9\n\nA smaller container based on Alpine Linux is available in the alpine branch. But it does not build the old LEDE images.\n\n## Prerequisites\n\n* Docker installed\n* running Docker daemon\n* build Docker image:\n\n```shell\ngit clone https://github.com/mwarning/docker-openwrt-builder.git\ncd docker-openwrt-builder\ndocker build -t openwrt_builder .\n```\n\nNow the docker image is available. These steps only need to be done once.\n\n## Usage GNU/Linux\n\nCreate a build folder and link it into a new docker container:\n```shell\nmkdir ~/mybuild\ndocker run -v ~/mybuild:/home/user -it openwrt_builder /bin/bash\n```\n\nIn the container console, enter:\n```shell\ngit clone https://git.openwrt.org/openwrt/openwrt.git\ncd openwrt\n./scripts/feeds update -a\n./scripts/feeds install -a\nmake menuconfig\nmake -j4\n```\n\nAfter the build, the images will be inside `~/mybuild/openwrt/bin/target/`.\n\n## Usage MacOSX\n\nOpenWrt requires a case-sensitive filesystem while MacOSX uses a case-insensitive filesystem by default.\n\nCreate a sparse disk image (to limit space usage):\n```zsh\nmkdir ~/Documents/openwrt\ncd ~/Documents/openwrt\nhdiutil create -size 64g -fs \"Case-sensitive HFS+\" -type SPARSEBUNDLE -volname openwrt-dev-env openwrt-dev-env.dmg \nhdiutil attach openwrt-dev-env.dmg\n```\n\nThen run:\n```zsh\ndocker run -v /Volumes/openwrt-dev-env:/home/user -it openwrt_builder /bin/bash\n```\n\nInside the container shell create a image file that will be formatted in ext4 then mounted (thanks to [HowellBP](https://github.com/HowellBP/ext4-on-macos-using-docker) for the inspiration):\n\n```shell\ncd /home/user # not really needed\ndd if=/dev/zero of=ext4openwrtfs.img bs=1G count=0 seek=60 # set \"seek=\" to however many gigabytes you want, always less than the created dmg image\nmkfs.ext4 ext4openwrtfs.img # create filesystem\n\nmkdir ./openwrt-fs # create mount folder\nlosetup -fP --show ext4openwrtfs.img # this will return a /dev/loop ID, e.g. /dev/loop1, change line below with the correct one\nsudo mount /dev/loop1 ./openwrt-fs # mount support folder\nsudo chown -R user:user ./openwrt-fs # change ownership to user\ncd ./openwrt-fs # $(pwd) should be /home/user/openwrt-fs\n```\n\nAt this point you can proceed with the same commands of the Linux usage:\n\n```shell\ngit clone https://git.openwrt.org/openwrt/openwrt.git # repo will be in /home/user/openwrt-fs/openwrt\ncd openwrt\n./scripts/feeds update -a\n./scripts/feeds install -a\nmake menuconfig\nmake -j4 # adapt to the number of cores you want to use \n```\n\nAfter the build, the images will be inside `/home/user/openwrt-fs/openwrt/bin/target/` in the container, **inside the .img file**. To export them to your Mac you need to copy/move them in `/home/user` then you'll be able to access them from outside the container, in `/Volumes/openwrt-dev-env/`\n\n([Source](https://openwrt.org/docs/guide-developer/easy.build.macosx))\n\n## Usage Windows\n\nTODO\n\n## Other Projects\n\nOther, but very similar projects:\n\n* [openwrt-docker](https://github.com/openwrt/docker) Official Docker containers to build OpenWrt!\n* [openwrt-imagebuilder-action](https://github.com/izer-xyz/openwrt-imagebuilder-action)\n* [docker-openwrt-buildroot](https://github.com/noonien/docker-openwrt-buildroot)\n* [openwrt-docker-toolchain](https://github.com/mchsk/openwrt-docker-toolchain)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwarning%2Fdocker-openwrt-build-env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmwarning%2Fdocker-openwrt-build-env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwarning%2Fdocker-openwrt-build-env/lists"}