Fix Docker build: Download libvips tarball to temporary file first

- Modified the Dockerfile to download the libvips tarball to a temporary file (vips.tar.gz) using curl -o, then extract from that file.
- Added 'set -eux' to the RUN command for better debugging output.
- This addresses the 'gzip: stdin: not in gzip format' error by ensuring a complete download before extraction.
This commit is contained in:
denshooter
2026-02-22 01:45:16 +01:00
parent 48411e432a
commit a6b211a749
+10 -8
View File
@@ -29,14 +29,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
ARG LIBVIPS_VERSION=8.16.2
WORKDIR /tmp
RUN curl -L https://github.com/libvips/libvips/releases/download/v${LIBVIPS_VERSION}/vips-${LIBVIPS_VERSION}.tar.gz | tar xz --strip-components=1 \
&& cd vips-${LIBVIPS_VERSION} \
&& meson setup build --prefix=/usr --buildtype=release \
&& ninja -C build \
&& ninja -C build install \
&& ldconfig \
&& cd / \
&& rm -rf /tmp/vips-${LIBVIPS_VERSION}
RUN set -eux; \
curl -L -o vips.tar.gz https://github.com/libvips/libvips/releases/download/v${LIBVIPS_VERSION}/vips-${LIBVIPS_VERSION}.tar.gz; \
tar xz --strip-components=1 -f vips.tar.gz; \
cd vips-${LIBVIPS_VERSION}; \
meson setup build --prefix=/usr --buildtype=release; \
ninja -C build; \
ninja -C build install; \
ldconfig; \
cd /; \
rm -rf /tmp/vips-${LIBVIPS_VERSION} /tmp/vips.tar.gz
# Stage 2: Build the Next.js app
FROM node:22-bullseye-slim AS builder