Dockerfile-2305 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # syntax=docker/dockerfile:1
  2. # OpenWrt 23.05.6 x86_64 testbed image.
  3. #
  4. # Built from the official OpenWrt 23.05.6 rootfs tarball (downloads.openwrt.org)
  5. # + a small set of .ipk packages from the 23.05.6 feeds:
  6. # - lua + liblua5.1.5 (Lua 5.1.5 — OpenWrt's base lua package is
  7. # still 5.1, NOT 5.4)
  8. # - openssl-util + libopenssl3 + ca-bundle (sha256.lua uses `openssl dgst`)
  9. #
  10. # .ipk files are ar archives (busybox tar can't read them), so they are
  11. # pre-extracted on the host into ipk-extract/ (see download-2305.sh) and
  12. # simply COPYed into the image.
  13. #
  14. # Build (from balancer-lite-lua/testbed):
  15. # docker build -f Dockerfile-2305 -t openwrt-testbed-2305:latest .
  16. #
  17. # Run with the standard openwrt-testbed skill scripts via env override:
  18. # OPENWRT_TESTBED_NAME=openwrt-testbed-2305 \
  19. # OPENWRT_TESTBED_IMAGE=openwrt-testbed-2305:latest \
  20. # skills/openwrt-testbed/scripts/start.sh
  21. #
  22. # Note: this image is NOT the skill's default image. The skill's 19.07
  23. # Dockerfile (shellspec/openwrt + luasocket) is left untouched.
  24. FROM scratch
  25. # Official 23.05.6 x86_64 rootfs (pre-extracted on the host; see
  26. # download-2305.sh). Extracted as ./ into the image root.
  27. COPY rootfs/ /
  28. # Pre-extracted package payloads (lua, liblua5.1.5, openssl-util,
  29. # libopenssl3, ca-bundle) from the 23.05.6 feeds.
  30. COPY ipk-extract/ /
  31. # Lua paths + workspace for test fixtures. OpenWrt's Lua binary
  32. # doesn't include versioned paths in its compiled-in package.path,
  33. # so export them via profile.d (the test driver also sets them
  34. # inline in every docker exec).
  35. RUN mkdir -p /var/lock /var/run /tmp /etc/profile.d /testbed \
  36. && rm -rf /var/opkg-lists/* \
  37. && echo 'export LUA_PATH="/usr/share/lua/5.1/?.lua;/usr/share/lua/5.1/?/init.lua;;"' > /etc/profile.d/lua-paths.sh \
  38. && echo 'export LUA_CPATH="/usr/lib/lua/5.1/?.so;/usr/lib/lua/?.so;;"' >> /etc/profile.d/lua-paths.sh
  39. # NB: busybox's `sleep` doesn't understand "infinity" — use 1 year.
  40. CMD ["sleep", "31536000"]