From 694cbe519b7ab963802f008c7cecf5b611a07a90 Mon Sep 17 00:00:00 2001 From: Oleksii Orel Date: Fri, 22 Mar 2024 21:10:13 +0200 Subject: [PATCH] fix: Dockerfile Signed-off-by: Oleksii Orel --- .devfile.Dockerfile | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.devfile.Dockerfile b/.devfile.Dockerfile index 78b589e..aff2e7e 100644 --- a/.devfile.Dockerfile +++ b/.devfile.Dockerfile @@ -10,6 +10,31 @@ RUN dnf -y update && dnf -y install \ dnf -y clean all --enablerepo='*' RUN npm install -g http-server - # Switch back to default user USER 10001 + +ARG OPENWRT_BASE_URL='https://github.com/openwrt/openwrt' +ARG OPENWRT_VERSION='23.05.0-rc1' + +COPY ${PWD}/package/helloworld /tmp/helloworld +COPY ${PWD}/configs/.x86-generic.config /tmp/.config + +RUN mkdir -p /tmp/pre-install /tmp/pre-install/openwrt /tmp/pre-install/openwrt/${OPENWRT_VERSION} \ + && curl "${OPENWRT_BASE_URL}/archive/refs/tags/v${OPENWRT_VERSION}.zip" -L -o "/tmp/pre-install/openwrt-${OPENWRT_VERSION}.zip" \ + && unzip "/tmp/pre-install/openwrt-${OPENWRT_VERSION}.zip" -d /tmp/pre-install \ + && rm -rf /tmp/pre-install/openwrt-${OPENWRT_VERSION}.zip \ + && cd /tmp/pre-install/openwrt-${OPENWRT_VERSION} \ + && scripts/feeds update -a -f \ + && scripts/feeds install -a -f \ + && cp /tmp/.config /tmp/pre-install/openwrt-${OPENWRT_VERSION}/.config \ + && cp -r /tmp/helloworld /tmp/pre-install/openwrt-${OPENWRT_VERSION}/package/helloworld \ + && cd /tmp/pre-install/openwrt-${OPENWRT_VERSION} \ + && make defconfig \ + && make -j1 \ + && mv bin /tmp/pre-install/openwrt/${OPENWRT_VERSION}/bin \ + && mv build_dir /tmp/pre-install/openwrt/${OPENWRT_VERSION}/build_dir \ + && mv dl /tmp/pre-install/openwrt/${OPENWRT_VERSION}/dl \ + && mv feeds /tmp/pre-install/openwrt/${OPENWRT_VERSION}/feeds \ + && mv staging_dir /tmp/pre-install/openwrt/${OPENWRT_VERSION}/staging_dir \ + && mv tmp /tmp/pre-install/openwrt/${OPENWRT_VERSION}/tmp \ + && rm -rf /tmp/pre-install/openwrt-${OPENWRT_VERSION}