{"id":1637,"date":"2022-05-20T15:48:47","date_gmt":"2022-05-20T07:48:47","guid":{"rendered":"https:\/\/www.strongd.net\/?p=1637"},"modified":"2022-05-20T15:48:47","modified_gmt":"2022-05-20T07:48:47","slug":"docker-openwrt-builder","status":"publish","type":"post","link":"https:\/\/www.strongd.net\/?p=1637","title":{"rendered":"Docker OpenWrt Builder"},"content":{"rendered":"<h1 dir=\"auto\">Docker OpenWrt Builder<\/h1>\n<p dir=\"auto\">Build\u00a0<a href=\"https:\/\/openwrt.org\/\" rel=\"nofollow\">OpenWrt<\/a>\u00a0images 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).<\/p>\n<p dir=\"auto\">Build tested:<\/p>\n<ul dir=\"auto\">\n<li>OpenWrt-21.02.2<\/li>\n<li>OpenWrt-19.07.8<\/li>\n<li>OpenWrt-18.06.9<\/li>\n<\/ul>\n<p dir=\"auto\">A smaller container based on Alpine Linux is available in the alpine branch. But it does not build the old LEDE images.<\/p>\n<h2 dir=\"auto\"><a id=\"user-content-prerequisites\" class=\"anchor\" href=\"https:\/\/github.com\/strongkill\/docker-openwrt-builder#prerequisites\" aria-hidden=\"true\"><\/a>Prerequisites<\/h2>\n<ul dir=\"auto\">\n<li>Docker installed<\/li>\n<li>running Docker daemon<\/li>\n<li>build Docker image:<\/li>\n<\/ul>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\">\n<pre class=\"notranslate\"><code>git clone https:\/\/github.com\/strongkill\/docker-openwrt-builder.git\r\ncd docker-openwrt-builder\r\ndocker build -t openwrt_builder .\r\n<\/code><\/pre>\n<\/div>\n<p dir=\"auto\">Now the docker image is available. These steps only need to be done once.<\/p>\n<h2 dir=\"auto\"><a id=\"user-content-usage-gnulinux\" class=\"anchor\" href=\"https:\/\/github.com\/strongkill\/docker-openwrt-builder#usage-gnulinux\" aria-hidden=\"true\"><\/a>Usage GNU\/Linux<\/h2>\n<p dir=\"auto\">Create a build folder and link it into a new docker container:<\/p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\">\n<pre class=\"notranslate\"><code>mkdir ~\/mybuild\r\ndocker run -v ~\/mybuild:\/home\/user -it openwrt_builder \/bin\/bash\r\n<\/code><\/pre>\n<\/div>\n<p dir=\"auto\">In the container console, enter:<\/p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\">\n<pre class=\"notranslate\"><code>git clone https:\/\/git.openwrt.org\/openwrt\/openwrt.git\r\ncd openwrt\r\n.\/scripts\/feeds update -a\r\n.\/scripts\/feeds install -a\r\nmake menuconfig\r\nmake -j4\r\n<\/code><\/pre>\n<\/div>\n<p dir=\"auto\">After the build, the images will be inside\u00a0<code>~\/mybuild\/openwrt\/bin\/target\/<\/code>.<\/p>\n<h2 dir=\"auto\"><a id=\"user-content-usage-macosx\" class=\"anchor\" href=\"https:\/\/github.com\/strongkill\/docker-openwrt-builder#usage-macosx\" aria-hidden=\"true\"><\/a>Usage MacOSX<\/h2>\n<p dir=\"auto\">OpenWrt requires a case-sensitive filesystem while MacOSX uses a case-insensitive filesystem by default.<\/p>\n<p dir=\"auto\">Create a disk image:<\/p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\">\n<pre class=\"notranslate\"><code>hdiutil create -size 20g -fs \"Case-sensitive HFS+\" -volname OpenWrt OpenWrt.dmg \r\nhdiutil attach OpenWrt.dmg\r\n<\/code><\/pre>\n<\/div>\n<p dir=\"auto\">Then run:<\/p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\">\n<pre class=\"notranslate\"><code>docker run -v \/volumes\/openwrt:\/home\/user -it openwrt_builder \/bin\/bash\r\n<\/code><\/pre>\n<\/div>\n<p dir=\"auto\">(<a href=\"https:\/\/openwrt.org\/docs\/guide-developer\/easy.build.macosx\" rel=\"nofollow\">Source<\/a>)<\/p>\n<h2 dir=\"auto\"><a id=\"user-content-usage-windows\" class=\"anchor\" href=\"https:\/\/github.com\/strongkill\/docker-openwrt-builder#usage-windows\" aria-hidden=\"true\"><\/a>Usage Windows<\/h2>\n<p dir=\"auto\">TODO<\/p>\n<h2 dir=\"auto\"><a id=\"user-content-other-projects\" class=\"anchor\" href=\"https:\/\/github.com\/strongkill\/docker-openwrt-builder#other-projects\" aria-hidden=\"true\"><\/a>Other Projects<\/h2>\n<p dir=\"auto\">Other, but very similar projects:<\/p>\n<ul dir=\"auto\">\n<li><a href=\"https:\/\/github.com\/noonien\/docker-openwrt-buildroot\">docker-openwrt-buildroot<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/mchsk\/openwrt-docker-toolchain\">openwrt-docker-toolchain<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Docker OpenWrt Builder Build\u00a0OpenWrt\u00a0images 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). Build tested: OpenWrt-21.02.2 OpenWrt-19.07.8 OpenWrt-18.06.9 A smaller container based on Alpine Linux is available in the alpine branch. But &hellip; <a href=\"https:\/\/www.strongd.net\/?p=1637\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Docker OpenWrt Builder<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[236,6],"tags":[258],"class_list":["post-1637","post","type-post","status-publish","format-standard","hentry","category-iot","category-linux","tag-openwrt"],"_links":{"self":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/1637","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1637"}],"version-history":[{"count":1,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/1637\/revisions"}],"predecessor-version":[{"id":1638,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/1637\/revisions\/1638"}],"wp:attachment":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1637"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1637"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1637"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}