ghost icon indicating copy to clipboard operation
ghost copied to clipboard

Build sharp for non-amd64 architectures

Open calroth opened this issue 3 years ago • 1 comments

On non-amd64 architectures, the default version of sharp may not automatically install due to a missing copy of libvips. This is referred to in PR #281 and issues #264 and #267. However whilst #281 fixes the images so they build and run, sharp may still not be built. It's an optional dependency and ghost works fine without it.

This PR is to get libvips installed, and sharp installed and built.

On Alpine, we upgrade to 3.15 (was 3.14). This gives us libvips 8.12.1-r0 (link to Alpine package search) which is sufficient to build the current dependency version of sharp (0.29.0).

The main caveat of the Alpine change is, we'll be upgrading from 3.14 to 3.15. This may require across-the-board testing.

On Debian, we currently use the bullseye image version. However the bullseye version of libvips-dev (8.10.5-2) isn't recent enough (link to Debian package search). So we download and build libvips-dev from Debian bookworm, which brings us version 8.12.1-1. (We also download and build libcgif-dev, since that prerequisite isn't available in bullseye.)

Note that on Debian we download and build the packages from source, targeting the bullseye runtime. This is likely to give better compatibility versus simply installing the official bookworm packages, which may require updated components.

I've only tested this on my 32-bit Raspberry Pi (armv7). Happy to take advice on how to get this PR ready for merging. Thanks!

calroth avatar Mar 06 '22 09:03 calroth

Interesting! I like this plan for Alpine (where we've got new enough libvips already), and think updating the Alpine version is reasonably sane, but I'm a bit concerned about compiling libvips from source, especially taking the source from bookworm without a proper Debian backport. :see_no_evil:

tianon avatar Mar 07 '22 19:03 tianon

Hey guys,

I'm running ghost on arm-v7 docker image. And sharp doesn't seem to get installed.

Can we please look into this?

XChikuX avatar Sep 01 '23 20:09 XChikuX

Closing in favor of https://github.com/docker-library/ghost/pull/394 :bow:

tianon avatar Dec 11 '23 22:12 tianon