Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified build/imagemagick.tar.bz2
Binary file not shown.
27 changes: 19 additions & 8 deletions container/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
FROM heroku/heroku:20-build
FROM heroku/heroku:24-build

ARG DEBIAN_FRONTEND=noninteractive

ARG COMPILE_VERSION_LIBDE265=1.0.8
ARG COMPILE_VERSION_LIBHEIF=1.12.0
ARG COMPILE_VERSION_LIBWEBP=1.2.1-rc2
ARG COMPILE_VERSION_IMAGEMAGICK=7.1.0-4
ARG COMPILE_VERSION_LIBDE265=1.0.15
ARG COMPILE_VERSION_LIBHEIF=1.18.2
ARG COMPILE_VERSION_LIBWEBP=1.3.2
ARG COMPILE_VERSION_IMAGEMAGICK=7.1.1-39

USER root

RUN apt-get -yq update \
&& apt-get install -yq \
build-essential \
pkg-config \
autotools-dev \
automake \
libtool \
curl \
cmake \
&& apt-get -yq update \
# Install install the latest libde265 library
Comment on lines 12 to 22
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Refactor: Consolidate and clean up apt operations
The second apt-get update is redundant, and the apt cache isn’t cleared. Combine update+install into one step, use --no-install-recommends, and remove /var/lib/apt/lists/* to shrink the image:

-RUN apt-get -yq update \
-  && apt-get install -yq \
+RUN apt-get update -qq \
+  && apt-get install -yqq --no-install-recommends \
       build-essential pkg-config autotools-dev automake libtool curl cmake \
+  && rm -rf /var/lib/apt/lists/*

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In container/Dockerfile around lines 12 to 22, remove the redundant second
apt-get update and consolidate the update and install commands into a single RUN
step. Add the --no-install-recommends flag to the apt-get install command to
avoid unnecessary packages, and clear the apt cache by deleting
/var/lib/apt/lists/* at the end of the RUN step to reduce image size.

&& curl -sSL --retry 3 https://github.com/strukturag/libde265/releases/download/v$COMPILE_VERSION_LIBDE265/libde265-$COMPILE_VERSION_LIBDE265.tar.gz | tar zx \
&& cd libde265-$COMPILE_VERSION_LIBDE265 \
Expand All @@ -18,8 +29,8 @@ RUN apt-get -yq update \
# Install install the latest libheif library
&& curl -sSL --retry 3 https://github.com/strukturag/libheif/releases/download/v$COMPILE_VERSION_LIBHEIF/libheif-$COMPILE_VERSION_LIBHEIF.tar.gz | tar zx \
&& cd libheif-$COMPILE_VERSION_LIBHEIF \
&& ./autogen.sh \
&& ./configure \
&& mkdir build && cd build \
&& cmake --preset=release .. \
&& make -j$(nproc) \
&& make install \
# Install install the latest libwebp library
Expand All @@ -30,7 +41,7 @@ RUN apt-get -yq update \
&& make -j$(nproc) \
&& make install \
# Get, configure and install imagemagick
&& curl -sSL https://imagemagick.org/download/releases/ImageMagick-$COMPILE_VERSION_IMAGEMAGICK.tar.bz2 | tar jx \
&& curl -sSL https://imagemagick.org/archive/releases/ImageMagick-$COMPILE_VERSION_IMAGEMAGICK.tar.xz | tar Jx \
&& cd ImageMagick-$COMPILE_VERSION_IMAGEMAGICK \
&& ./configure --prefix=/usr/src/imagemagick --with-heic=yes --with-webp=yes --with-openexr=no --with-x=no --disable-docs \
&& make -j$(nproc) \
Expand Down