1
Fork 0
ci-images/images/lua-clib/Dockerfile
Lucas Schwiderski b4ea7d0ab5
Implement custom version checks
Many dependencies are installed manually within the Dockerfiles,
where Renovate cannot determine the version numbers by default.
However, through custom matching, the corresponding data sources
can be invoked, and the version number replaced via regex.
2024-08-24 17:11:03 +02:00

158 lines
4.6 KiB
Docker

ARG LUA_5_1_VERSION=5.1.5
ARG LUA_5_2_VERSION=5.2.4
ARG LUA_5_3_VERSION=5.3.6
ARG LUA_5_4_VERSION=5.4.4
# renovate: datasource=github-tags depName=luarocks packageName=luarocks/luarocks
ARG LUAROCKS_VERSION=3.10.0
# renovate: datasource=github-releases depName=dart-sass packageName=sass/dart-sass
ARG DART_SASS_VERSION=1.71.1
# renovate: datasource=github-tags depName=node packageName=nodejs/node
ARG NODE_VERSION=20.11.1
FROM debian:bookworm-slim AS builder
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /build
RUN --mount=type=cache,target=/var/cache/apt,id=builder-apt \
set -e; \
apt-get update; \
apt-get install -y --no-install-recommends --no-install-suggests \
ca-certificates \
cmake \
gcc \
g++ \
libc-dev \
libreadline-dev \
make \
unzip \
wget \
xz-utils \
; \
mkdir /usr/local/stow;
FROM builder AS lua51
ARG LUA_5_1_VERSION
ADD http://www.lua.org/ftp/lua-${LUA_5_1_VERSION}.tar.gz /build/lua-5.1.tar.gz
RUN set -e; \
tar -xzf /build/lua-5.1.tar.gz; \
cd lua-${LUA_5_1_VERSION}/src; \
make -j $(nproc) all MYCFLAGS="-DLUA_USE_LINUX -fPIC" MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"; \
cd ..; \
make INSTALL_TOP=/usr/local/stow/lua5.1 install;
FROM builder AS lua52
ARG LUA_5_2_VERSION
ADD http://www.lua.org/ftp/lua-${LUA_5_2_VERSION}.tar.gz /build/lua-5.2.tar.gz
RUN set -e; \
tar -xzf /build/lua-5.2.tar.gz; \
cd lua-${LUA_5_2_VERSION}/src; \
make -j $(nproc) linux MYCFLAGS="-fPIC"; \
make -j $(nproc) all MYCFLAGS="-DLUA_USE_LINUX -fPIC" MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"; \
cd ..; \
make INSTALL_TOP=/usr/local/stow/lua5.2 install;
FROM builder AS lua53
ARG LUA_5_3_VERSION
ADD http://www.lua.org/ftp/lua-${LUA_5_3_VERSION}.tar.gz /build/lua-5.3.tar.gz
RUN set -e; \
tar -xzf /build/lua-5.3.tar.gz; \
cd lua-${LUA_5_3_VERSION}/src; \
make -j $(nproc) linux MYCFLAGS="-fPIC"; \
cd ..; \
make INSTALL_TOP=/usr/local/stow/lua5.3 install;
FROM builder AS lua54
ARG LUA_5_4_VERSION
ADD http://www.lua.org/ftp/lua-${LUA_5_4_VERSION}.tar.gz /build/lua-5.4.tar.gz
RUN set -e; \
tar -xzf /build/lua-5.4.tar.gz; \
cd lua-${LUA_5_4_VERSION}/src; \
make -j $(nproc) linux MYCFLAGS="-fPIC"; \
cd ..; \
make INSTALL_TOP=/usr/local/stow/lua5.4 install;
ARG LUAROCKS_VERSION
ADD https://luarocks.org/releases/luarocks-${LUAROCKS_VERSION}.tar.gz /build/luarocks.tar.gz
RUN set -e; \
tar -xzf /build/luarocks.tar.gz; \
cd luarocks-${LUAROCKS_VERSION}; \
./configure --prefix=/usr/local/stow/luarocks --with-lua=/usr/local/stow/lua5.4; \
make -j $(nproc); \
make install;
FROM builder AS sass
ARG DART_SASS_VERSION
ADD https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz /build/sass.tar.gz
RUN tar -xzf /build/sass.tar.gz -C /usr/local/bin --strip-components=1 dart-sass/sass;
FROM builder AS node
ARG NODE_VERSION
ADD https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz /build/node.tar.xz
RUN set -e; \
mkdir -p /usr/local/stow/node; \
tar -xJf /build/node.tar.xz \
-C /usr/local/stow/node \
--strip-components=1 \
--wildcards \
--no-wildcards-match-slash '*/bin/' '*/include/' '*/lib/';
FROM debian:bookworm-slim AS final
ENV DEBIAN_FRONTEND=noninteractive
RUN --mount=type=cache,target=/var/cache/apt,id=apt \
set -e; \
apt-get update; \
apt-get install -y --no-install-recommends --no-install-suggests \
ca-certificates \
cmake \
curl \
gcc \
g++ \
libc-dev \
libreadline-dev \
make \
sudo \
unzip \
wget\
stow \
; \
apt-get remove --auto-remove vim; \
rm -rf \
/usr/share/cmake-*/Help \
/var/lib/apt/lists/* \
/var/log/* \
/usr/local/share/doc/* \
/usr/local/share/man/* \
/usr/share/doc/* \
/usr/share/man/* \
;
COPY --from=lua51 /usr/local /usr/local
COPY --from=lua52 /usr/local /usr/local
COPY --from=lua53 /usr/local /usr/local
COPY --from=lua54 /usr/local /usr/local
COPY --from=node /usr/local /usr/local
COPY --from=sass /usr/local /usr/local
RUN --mount=type=cache,target=/var/cache/luarocks \
set -e; \
stow -d /usr/local/stow -t /usr luarocks; \
stow -d /usr/local/stow -t /usr node; \
luarocks install ldoc; \
luarocks install lua-discount
WORKDIR /
COPY pkgconfig/*.pc /usr/lib/pkgconfig/
COPY enable-lua disable-lua run-with-lua /usr/bin/