48 lines
1.0 KiB
Docker
48 lines
1.0 KiB
Docker
FROM localhost/openwrt-base:debian AS builder
|
|
|
|
ADD target.config /run/target.config
|
|
RUN cat /run/target.config > .config
|
|
RUN make defconfig
|
|
|
|
RUN make -j$(nproc) V=w download
|
|
|
|
RUN --mount=type=cache,dst=/root/.ccache make -j$(nproc) \
|
|
V=w \
|
|
CONFIG_CCACHE=y \
|
|
CONFIG_CCACHE_DIR=/root/.ccache \
|
|
tools/compile
|
|
|
|
RUN --mount=type=cache,dst=/root/.ccache make -j$(nproc) \
|
|
V=w \
|
|
CONFIG_CCACHE=y \
|
|
CONFIG_CCACHE_DIR=/root/.ccache \
|
|
toolchain/compile
|
|
|
|
ADD config /run/config
|
|
RUN cat /run/target.config /run/config >> .config
|
|
RUN make defconfig
|
|
|
|
RUN --mount=type=cache,dst=/root/.ccache make -j$(nproc) \
|
|
V=wc \
|
|
CONFIG_CCACHE=y \
|
|
CONFIG_CCACHE_DIR=/root/.ccache \
|
|
target/compile
|
|
|
|
RUN --mount=type=cache,dst=/root/.ccache make -j$(nproc) \
|
|
V=wc \
|
|
CONFIG_CCACHE=y \
|
|
CONFIG_CCACHE_DIR=/root/.ccache \
|
|
package/compile
|
|
|
|
RUN --mount=type=cache,dst=/root/.ccache make -j$(nproc) \
|
|
V=wc \
|
|
CONFIG_CCACHE=y \
|
|
CONFIG_CCACHE_DIR=/root/.ccache \
|
|
world
|
|
|
|
RUN --mount=type=cache,dst=/root/.ccache ccache -s
|
|
|
|
FROM scratch
|
|
|
|
COPY --from=builder /root/OpenWRT/bin/ /
|