Skip to content

Build libcurl and OpenSSL from source in the toolchain - #106

Merged
beetlebugorg merged 3 commits into
mainfrom
build/libcurl-from-source
Aug 28, 2026
Merged

Build libcurl and OpenSSL from source in the toolchain#106
beetlebugorg merged 3 commits into
mainfrom
build/libcurl-from-source

Conversation

@beetlebugorg

@beetlebugorg beetlebugorg commented Aug 28, 2026

Copy link
Copy Markdown
Owner

What

The builder compiles libcurl and OpenSSL from source into the ImageMagick prefix, with pinned versions and checksums, the same way every image delegate is already built: OpenSSL 3.5.8, nghttp2 1.70.0, and libcurl 8.21.0. The module and libcurl both link this OpenSSL, so the process has one libcrypto. The runtime image copies the prefix. The Debian libcurl and libssl dev packages are dropped, and the health check uses the compiled curl.

Why

libcurl fetches every source image. OpenSSL provides the TLS, the signature check, and the eurl encryption. Both are a security surface, and the base image ships older versions. The Dockerfile pins each version and its checksum. libcurl gains HTTP/2 through nghttp2. It drops every protocol the module does not use, so a request for another scheme, such as ftp, fails.

Verify

make -C test test passes all 267 cases. ldd on the module shows libcurl.so.4, libcrypto.so.3, libssl.so.3, and libnghttp2.so.14, all under /usr/local/imagemagick/lib. The /dims5/ eurl case uses AES-GCM from the source OpenSSL. A request to /dims-status/ on the production image returns 200. The libraries change the fetch and the signature, not the pixels, so the golden files do not change.

Breaking

The builder revision moves to r4, and the images use the new tag. Publish the toolchain with make builder so CI pulls it. Until then CI builds it locally, which is slow.

- Compile libcurl 8.21.0 and nghttp2 1.70.0 from source into the ImageMagick
  prefix, with pinned versions and checksums, so the fetch library is current
  and controlled rather than whatever the base image ships.
- Drop the Debian libcurl dev package; the module links the source build.
- Turn off every protocol the module does not use.
- Point the health check at the curl the builder compiled.
- Raise BUILDER_REVISION and the builder image tag the images name.
- Compile OpenSSL 3.5.8 from source into the ImageMagick prefix, with a pinned
  version and checksum.
- Link libcurl and the module against it, so one libcrypto is in the process.
- Drop the Debian OpenSSL dev package.
@beetlebugorg beetlebugorg changed the title Build libcurl from source in the toolchain Build libcurl and OpenSSL from source in the toolchain Aug 28, 2026
The prefix holds the curl and magick the builder compiled. A plain `curl`
inside the container, such as `docker exec dims curl`, must resolve to it now
that no distribution curl is installed.
@beetlebugorg
beetlebugorg merged commit 9a79e97 into main Aug 28, 2026
5 checks passed
@beetlebugorg
beetlebugorg deleted the build/libcurl-from-source branch August 28, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant