luarocks

Details
Source
FROM scratch AS build
ARG VERSION
COPY --from=stagex/core-busybox . /
COPY --from=stagex/core-lua . /
COPY --from=stagex/core-make . /
COPY --from=stagex/core-musl . /
COPY --from=stagex/core-readline . /
COPY --from=stagex/core-ncurses . /


ADD fetch/luarocks-${VERSION}.tar.gz .
WORKDIR /luarocks-${VERSION}
RUN --network=none <<-EOF
  set -eux
  ./configure --prefix=/usr
  make ./build/luarocks ./build/luarocks-admin ./build/config-5.4.lua
  # busybox's wget is not compatible
  echo 'variables.WGET = "/invalid/path"' >> ./build/config-5.4.lua

  make DESTDIR="/rootfs" install
EOF

FROM stagex/core-filesystem AS package
COPY --from=build /rootfs/ /