Build libcurl and OpenSSL from source in the toolchain - #106
Merged
Conversation
- 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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
libcurlandlibssldev packages are dropped, and the health check uses the compiledcurl.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 testpasses all 267 cases.lddon the module showslibcurl.so.4,libcrypto.so.3,libssl.so.3, andlibnghttp2.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 builderso CI pulls it. Until then CI builds it locally, which is slow.