From 2537dd1bc36c089777da999c9b1eb097c49b10c0 Mon Sep 17 00:00:00 2001 From: Simon Zeyer Date: Tue, 25 Aug 2026 14:56:45 +0200 Subject: [PATCH] move build to buildscript since in docker build folders are not mapped --- Dockerfile | 32 ++++++++++++++++---------------- build.sh | 19 +++++++++++++++++++ docker-compose.yaml | 3 +++ 3 files changed, 38 insertions(+), 16 deletions(-) create mode 100755 build.sh diff --git a/Dockerfile b/Dockerfile index fb1f15e..86ac8da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,23 +49,23 @@ RUN git clone --depth 1 -b ${OPENWRT_BRANCH} https://git.openwrt.org/openwrt/ope WORKDIR /home/builduser/openwrt -RUN echo "src-git ha_cluster https://github.com/pgaufillet/openwrt-ha-feed.git" >> feeds.conf.default +#RUN echo "src-git ha_cluster https://github.com/pgaufillet/openwrt-ha-feed.git" >> feeds.conf.default -# Update and install default package feeds -RUN ./scripts/feeds update -a && \ - ./scripts/feeds install -a +## Update and install default package feeds +#RUN ./scripts/feeds update -a && \ +# ./scripts/feeds install -a -RUN echo "CONFIG_TARGET_x86=y" > .config && \ - echo "CONFIG_TARGET_x86_64=y" >> .config && \ - echo "CONFIG_PACKAGE_dnsmasq-ha=y" >> .config && \ - echo "CONFIG_PACKAGE_lease-sync=y" >> .config && \ - echo "CONFIG_PACKAGE_owsync=y" >> .config && \ - echo "CONFIG_PACKAGE_ha-cluster=y" >> .config && \ - echo "CONFIG_PACKAGE_luci-app-ha-cluster=y" >> .config && \ - sed -i 's/CONFIG_PACKAGE_dnsmasq=y/# CONFIG_PACKAGE_dnsmasq is not set/' .config && \ - make defconfig +#RUN echo "CONFIG_TARGET_x86=y" > .config && \ +# echo "CONFIG_TARGET_x86_64=y" >> .config && \ +# echo "CONFIG_PACKAGE_dnsmasq-ha=y" >> .config && \ +# echo "CONFIG_PACKAGE_lease-sync=y" >> .config && \ +# echo "CONFIG_PACKAGE_owsync=y" >> .config && \ +# echo "CONFIG_PACKAGE_ha-cluster=y" >> .config && \ +# echo "CONFIG_PACKAGE_luci-app-ha-cluster=y" >> .config && \ +# sed -i 's/CONFIG_PACKAGE_dnsmasq=y/# CONFIG_PACKAGE_dnsmasq is not set/' .config && \ +# make defconfig -RUN make -j$(nproc) download -RUN make -j$(nproc) V=s +#RUN make -j$(nproc) download +#RUN make -j$(nproc) V=s -CMD ["/bin/bash"] +#CMD ["/bin/bash"] diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..888fa57 --- /dev/null +++ b/build.sh @@ -0,0 +1,19 @@ +#!/bin/bash +echo "src-git ha_cluster https://github.com/pgaufillet/openwrt-ha-feed.git" >> feeds.conf.default + +# Update and install default package feeds +./scripts/feeds update -a && \ +./scripts/feeds install -a + +echo "CONFIG_TARGET_x86=y" > .config && \ +echo "CONFIG_TARGET_x86_64=y" >> .config && \ +echo "CONFIG_PACKAGE_dnsmasq-ha=y" >> .config && \ +echo "CONFIG_PACKAGE_lease-sync=y" >> .config && \ +echo "CONFIG_PACKAGE_owsync=y" >> .config && \ +echo "CONFIG_PACKAGE_ha-cluster=y" >> .config && \ +echo "CONFIG_PACKAGE_luci-app-ha-cluster=y" >> .config && \ +sed -i 's/CONFIG_PACKAGE_dnsmasq=y/# CONFIG_PACKAGE_dnsmasq is not set/' .config && \ +make defconfig + +make -j$(nproc) download +make -j$(nproc) V=s diff --git a/docker-compose.yaml b/docker-compose.yaml index a3735fb..a9de5d8 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -10,6 +10,7 @@ services: user: "1000:1000" tty: true stdin_open: true + command: bash /home/builduser/build.sh volumes: # Firmware outputs mapped directly to host filesystem - ./bin:/home/builduser/openwrt/bin @@ -17,6 +18,8 @@ services: - ./dl:/home/builduser/openwrt/dl # Persistent build configuration file (.config) - ./.config:/home/builduser/openwrt/.config + # build script + - ./build.sh:/home/builduser/build.sh # Named volumes for heavy build artifacts (maximizes I/O performance) - openwrt-build-dir:/home/builduser/openwrt/build_dir - openwrt-staging-dir:/home/builduser/openwrt/staging_dir