Imagemagick enable delegate build and disabled using shared libraries (#889)
authorJeff Wong <awole20@gmail.com>
Tue, 17 Dec 2024 05:28:54 +0000 (21:28 -0800)
committerGitHub <noreply@github.com>
Tue, 17 Dec 2024 05:28:54 +0000 (13:28 +0800)
commit5ed07ecc93309003eeca589f7e526f872a098d4a
tree62257cd2fc90d25b115cb2f30af9ed1b48455ad5
parente70c3596b85c00e2191778d19a172f6de0d20286
Imagemagick enable delegate build and disabled using shared libraries (#889)

compiles to a single portable binary

Create a base builder package with compile time dependencies. Create an
imagemagick_builder to build imagemagick.

The base builder can be extended for other builders.

Add imagemagick runtime dependencies to discourse_dependencies image
avoid -dev libs

Statically compile as much as possible with --disable-shared and
--enable-delegate-build flags.
References:
https://stackoverflow.com/questions/47031789/imagemagick-100-static-build-for-linux
https://www.imagemagick.org/discourse-server/viewtopic.php?t=14259

Add fonts-urw-base35 for NimbusSans-Regular, needed for letter avatar generation

Copy over the resulting magick bin, as well as etc and share files from the
compilation. etc is needed for magick to run, share is not, but contains
translations for errors which Discourse tests are dependent on reading from.

Create symlinks for other magick tooling - imagemagick creates symlink tool
names that Discourse uses. These *could* be dropped if Discourse decided to use
`magick {toolname}` rather than `{toolname}`.

Add nginx compile dependency - building nginx still needs libfreetype6
This was implicitly installed previously. Removing the imagemagick build from
base broke the next nginx build. Add this dependency back in. This dependency
can be removed once we build nginx separately as well.
image/base/Dockerfile
image/base/install-imagemagick