docker-library / ghost

Docker Official Image packaging for Ghost
https://hub.docker.com/_/ghost
MIT License
738 stars 313 forks source link

Refactor 5.x installation to allow for building where necessary #308

Closed tianon closed 2 years ago

tianon commented 2 years ago

Closes #307

I don't love how complex this has become, but I do like that it's a lot more resilient? :grimacing: :see_no_evil:

I've tested this successfully on at least arm64v8, s390x, and ppc64le (the latter of which don't get sharp successfully because they don't have pre-built or new enough libvips :disappointed:).

unverbraucht commented 2 years ago

Checked this the other day on a M1 (arm64) macbook, builds and runs great. Currently building on a armv7 Raspi, also seems to be building fine.

tianon commented 2 years ago

Thanks for testing! I guess we'll merge for now and @acburdine can come back with more improvements/adjustments later (if desired!) :heart:

unverbraucht commented 2 years ago

Sure! One thing I realized later: the v5 Alpine version doesn't build on armv7(I only tested the Debian builds) :( It's related to not building Sharp as mentioned in #293. The relevant lines from docker build are:

+ '[' -n ' .build-deps-ghost .build-deps-sharp' ]
+ apk del --no-network .build-deps-ghost .build-deps-sharp
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.15/main: No such file or directory
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.15/community: No such file or directory
ERROR: No such package: .build-deps-sharp
tianon commented 2 years ago

Doh, great catch! Will update shortly.

XChikuX commented 1 year ago

@tianon Hey any update on v7 ?

I don't get sharp installed on my end when attempting this.

pascalandy commented 1 year ago

To fix this, use your own multi stage build. Install sharp normally (debian per example) than copy in within your image v7.

XChikuX commented 1 year ago

@pascalandy Respectfully, that's not a fix. It's a workaround.

yosifkit commented 1 year ago

It looks like vips-dev on Alpine 3.17 (current base) is new enough for sharp now: https://pkgs.alpinelinux.org/packages?name=vips-dev&branch=v3.17&repo=&arch=&maintainer= (I'll make a PR).

When we move to Debian Bookworm, it will also have new enough "libvips": https://packages.debian.org/bookworm/libvips-dev.