-
Notifications
You must be signed in to change notification settings - Fork 1
Update ImageMagick buildpack for Heroku-24 compatibility #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- Upgrade base image from heroku/heroku:20-build to heroku/heroku:24-build - Update library versions: libde265 1.0.15, libheif 1.18.2, libwebp 1.3.2, ImageMagick 7.1.1-39 - Switch libheif build to cmake (newer versions don't use autogen.sh) - Add required build dependencies and root user permissions - Use .tar.xz format for ImageMagick download - Include compiled binary for Heroku-24 stack Fixes libtiff.so.5 vs libtiff.so.6 compatibility issue preventing ImageMagick from working on Heroku-24. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the WalkthroughThe Dockerfile was updated to use a newer Heroku base image and more recent versions of several image processing libraries. The build process for dependencies was adjusted, including switching libheif to a CMake-based build and updating extraction commands for ImageMagick. Additional build tools were installed, and user switching was made explicit. Changes
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (3)
container/Dockerfile (3)
10-10
: Consider dropping privileges after build
Switching to root is necessary for compilation, but you may want to add aUSER <non-root>
at the end of the RUN chain to revert to a safer, non-root user for subsequent steps.
23-29
: Optional: Remove libde265 source after install
Thelibde265-$COMPILE_VERSION_LIBDE265
directory remains in the final image. Add:&& rm -rf libde265-$COMPILE_VERSION_LIBDE265after
make install
to clean up build artifacts.
44-44
: Nitpick: Use standard tar flags for xz
For clarity when piping from stdin, prefer:- | tar Jx \ + | tar -xJ \This makes the extraction intent explicit.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
container/Dockerfile
(3 hunks)
🔇 Additional comments (3)
container/Dockerfile (3)
1-1
: Approval: Base image upgraded to Heroku-24
Usingheroku/heroku:24-build
aligns with the PR objective to target Heroku-24.
5-8
: Approval: Dependency versions parameterized via ARG
Pinning all compile-time versions as build args enhances maintainability and makes future bumps straightforward.
30-35
: Verify libheif build method
Thecmake --preset=release
invocation requires aCMakePresets.json
in the libheif source. Confirm v1.18.2 includes this file; otherwise switch to a traditional command:- && mkdir build && cd build \ - && cmake --preset=release .. \ + && mkdir build && cd build \ + && cmake -DCMAKE_BUILD_TYPE=Release .. \
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 |
There was a problem hiding this comment.
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.
Updates the compiled ImageMagick binary to include latest dependency versions and compatibility fixes for Heroku-24 stack. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Fixes libtiff.so.5 vs libtiff.so.6 compatibility issue preventing ImageMagick from working on Heroku-24.
🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]
Summary by CodeRabbit