Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (58 loc) · 2.97 KB
/
Copy pathDockerfile
File metadata and controls
62 lines (58 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# syntax=docker/dockerfile:1
ARG SDK_TAG=bcm27xx-bcm2712
FROM openwrt/sdk:${SDK_TAG}
# Install gperf (needed by libseccomp which is a runc dependency)
# Cache mounts keep the apt package cache between builds, skipping re-downloads
# when only the SDK tag changes.
USER root
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update -qq && apt-get install -y -qq --no-install-recommends gperf
USER buildbot
WORKDIR /builder
# Copy only the version update script (the only custom script needed)
COPY --chown=buildbot:buildbot scripts/update_versions.sh /scripts/update_versions.sh
RUN chmod +x /scripts/update_versions.sh
# Build following the official SDK pattern:
# https://github.com/openwrt/docker#sdk-example
# Note: Feed URLs are replaced with GitHub mirrors for improved reliability
# Git buffer size increased to 500MB to handle large repository clones
CMD ["bash", "-c", "\
cd /builder && \
if [ ! -d ./scripts ]; then bash ./setup.sh; fi && \
git config --global http.postBuffer 524288000 && \
sed -i -e 's|https://git.openwrt.org/feed/packages.git|https://github.com/openwrt/packages.git|g' \
-e 's|https://git.openwrt.org/project/luci.git|https://github.com/openwrt/luci.git|g' \
-e 's|https://git.openwrt.org/feed/luci.git|https://github.com/openwrt/luci.git|g' \
-e 's|https://git.openwrt.org/feed/routing.git|https://github.com/openwrt/routing.git|g' \
-e 's|https://git.openwrt.org/feed/telephony.git|https://github.com/openwrt/telephony.git|g' \
feeds.conf.default && \
./scripts/feeds update packages && \
make defconfig && \
bash /scripts/update_versions.sh && \
./scripts/feeds install docker dockerd containerd runc docker-compose libseccomp && \
if ./scripts/feeds install tini 2>/dev/null; then \
echo 'tini package found and installed'; \
TINI_AVAILABLE=1; \
else \
echo 'tini package not available, skipping'; \
TINI_AVAILABLE=0; \
fi && \
make defconfig && \
make package/libseccomp/compile -j$(nproc) V=s && \
if [ \"$TINI_AVAILABLE\" = \"1\" ]; then \
make package/tini/compile -j$(nproc) V=s || echo 'tini compilation failed, continuing'; \
fi && \
make package/containerd/compile -j$(nproc) IGNORE_ERRORS=m V=s && \
make package/runc/compile -j$(nproc) IGNORE_ERRORS=m V=s && \
make package/docker/compile -j$(nproc) IGNORE_ERRORS=m V=s && \
make package/dockerd/compile -j$(nproc) IGNORE_ERRORS=m V=s && \
make package/docker-compose/compile -j$(nproc) IGNORE_ERRORS=m V=s && \
mkdir -p /output && \
for ext in ipk apk; do \
find bin/packages -name \"docker*.$ext\" -exec cp {} /output/ \\; ; \
find bin/packages -name \"dockerd*.$ext\" -exec cp {} /output/ \\; ; \
find bin/packages -name \"containerd*.$ext\" -exec cp {} /output/ \\; ; \
find bin/packages -name \"runc*.$ext\" -exec cp {} /output/ \\; ; \
find bin/packages -name \"docker-compose*.$ext\" -exec cp {} /output/ \\; ; \
done"]