Skip to content

Conversation

tianon
Copy link
Member

@tianon tianon commented Jun 1, 2022

Changes:

@docker-library-bot docker-library-bot force-pushed the ghost branch 2 times, most recently from 5761004 to 86feb3e Compare June 1, 2022 20:24
Changes:

- docker-library/ghost@819c182: Update to 5.2.1, ghost-cli 1.21.0
- docker-library/ghost@67269d3: Merge pull request docker-library/ghost#312 from infosiftr/virtual
- docker-library/ghost@d934156: Update to 5.2.0, ghost-cli 1.21.0
- docker-library/ghost@ae52dd8: Golf down the virtual declaration to avoid "ERROR: No such package: .build-deps-sharp"
- docker-library/ghost@c91b1df: Merge pull request docker-library/ghost#308 from infosiftr/arm64+
@github-actions
Copy link

github-actions bot commented Jun 2, 2022

Diff for 41ab50c:
diff --git a/_bashbrew-cat b/_bashbrew-cat
index a460ce3..fbaed2a 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -11,12 +11,12 @@ Architectures: amd64, arm32v6, arm32v7, arm64v8
 GitCommit: 1791d76b54348818da6cd4281ea6e2be0b757049
 Directory: 4/alpine
 
-Tags: 5.1.1, 5.1, 5, latest
+Tags: 5.2.1, 5.2, 5, latest
 Architectures: amd64, arm32v7, arm64v8, ppc64le, s390x
-GitCommit: b72aca608fbecd57cf7692b1cbf0786b18403e05
+GitCommit: 819c182bcd91512d5d84201ef01346b2b9f46b5e
 Directory: 5/debian
 
-Tags: 5.1.1-alpine, 5.1-alpine, 5-alpine, alpine
+Tags: 5.2.1-alpine, 5.2-alpine, 5-alpine, alpine
 Architectures: amd64, arm32v6, arm32v7, arm64v8
-GitCommit: b72aca608fbecd57cf7692b1cbf0786b18403e05
+GitCommit: 819c182bcd91512d5d84201ef01346b2b9f46b5e
 Directory: 5/alpine
diff --git a/_bashbrew-list b/_bashbrew-list
index 34cd322..3d69dc2 100644
--- a/_bashbrew-list
+++ b/_bashbrew-list
@@ -6,9 +6,9 @@ ghost:4.48.1
 ghost:4.48.1-alpine
 ghost:5
 ghost:5-alpine
-ghost:5.1
-ghost:5.1-alpine
-ghost:5.1.1
-ghost:5.1.1-alpine
+ghost:5.2
+ghost:5.2-alpine
+ghost:5.2.1
+ghost:5.2.1-alpine
 ghost:alpine
 ghost:latest
diff --git a/ghost_alpine/Dockerfile b/ghost_alpine/Dockerfile
index 75869fc..56547db 100644
--- a/ghost_alpine/Dockerfile
+++ b/ghost_alpine/Dockerfile
@@ -20,13 +20,21 @@ RUN set -eux; \
 ENV GHOST_INSTALL /var/lib/ghost
 ENV GHOST_CONTENT /var/lib/ghost/content
 
-ENV GHOST_VERSION 5.1.1
+ENV GHOST_VERSION 5.2.1
 
 RUN set -eux; \
 	mkdir -p "$GHOST_INSTALL"; \
 	chown node:node "$GHOST_INSTALL"; \
 	\
-	su-exec node ghost install "$GHOST_VERSION" --db sqlite3 --no-prompt --no-stack --no-setup --dir "$GHOST_INSTALL"; \
+	apkDel=; \
+	\
+	installCmd='su-exec node ghost install "$GHOST_VERSION" --db sqlite3 --no-prompt --no-stack --no-setup --dir "$GHOST_INSTALL"'; \
+	if ! eval "$installCmd"; then \
+		virtual='.build-deps-ghost'; \
+		apkDel="$apkDel $virtual"; \
+		apk add --no-cache --virtual "$virtual" g++ make python3; \
+		eval "$installCmd"; \
+	fi; \
 	\
 # Tell Ghost to listen on all ips and not prompt for additional configuration
 	cd "$GHOST_INSTALL"; \
@@ -43,21 +51,39 @@ RUN set -eux; \
 	chown node:node "$GHOST_CONTENT"; \
 	chmod 1777 "$GHOST_CONTENT"; \
 	\
-# force install "sqlite3" manually since it's an optional dependency of "ghost"
+# force install a few extra packages manually since they're "optional" dependencies
 # (which means that if it fails to install, like on ARM/ppc64le/s390x, the failure will be silently ignored and thus turn into a runtime error instead)
 # see https://github.com/TryGhost/Ghost/pull/7677 for more details
 	cd "$GHOST_INSTALL/current"; \
-# scrape the expected version of sqlite3 directly from Ghost itself
-	sqlite3Version="$(node -p 'require("./package.json").optionalDependencies["sqlite3"]')"; \
-	[ -n "$sqlite3Version" ]; \
-	[ "$sqlite3Version" != 'undefined' ]; \
-	if ! su-exec node yarn add "sqlite3@$sqlite3Version" --force; then \
+# scrape the expected versions directly from Ghost/dependencies
+	packages="$(node -p ' \
+		var ghost = require("./package.json"); \
+		var transform = require("./node_modules/@tryghost/image-transform/package.json"); \
+		[ \
+			"sharp@" + transform.optionalDependencies["sharp"], \
+			"sqlite3@" + ghost.optionalDependencies["sqlite3"], \
+		].join(" ") \
+	')"; \
+	if echo "$packages" | grep 'undefined'; then exit 1; fi; \
+	for package in $packages; do \
+		installCmd='su-exec node yarn add "$package" --force'; \
+		if ! eval "$installCmd"; then \
 # must be some non-amd64 architecture pre-built binaries aren't published for, so let's install some build deps and do-it-all-over-again
-		apk add --no-cache --virtual .build-deps g++ gcc libc-dev make python2 vips-dev; \
+			virtualPackages='g++ make python3'; \
+			case "$package" in \
+				# TODO sharp@*) virtualPackages="$virtualPackages pkgconf vips-dev"; \
+				sharp@*) echo >&2 "sorry: libvips 8.12.1 in Alpine 3.15 is not new enough (8.12.2+) for sharp 0.30 😞"; continue ;; \
+			esac; \
+			virtual=".build-deps-${package%%@*}"; \
+			apkDel="$apkDel $virtual"; \
+			apk add --no-cache --virtual "$virtual" $virtualPackages; \
 			\
-		npm_config_python='python2' su-exec node yarn add "sqlite3@$sqlite3Version" --force --build-from-source; \
+			eval "$installCmd --build-from-source"; \
+		fi; \
+	done; \
 	\
-		apk del --no-network .build-deps; \
+	if [ -n "$apkDel" ]; then \
+		apk del --no-network $apkDel; \
 	fi; \
 	\
 	su-exec node yarn cache clean; \
diff --git a/ghost_latest/Dockerfile b/ghost_latest/Dockerfile
index e3444c0..518dc93 100644
--- a/ghost_latest/Dockerfile
+++ b/ghost_latest/Dockerfile
@@ -44,13 +44,22 @@ RUN set -eux; \
 ENV GHOST_INSTALL /var/lib/ghost
 ENV GHOST_CONTENT /var/lib/ghost/content
 
-ENV GHOST_VERSION 5.1.1
+ENV GHOST_VERSION 5.2.1
 
 RUN set -eux; \
 	mkdir -p "$GHOST_INSTALL"; \
 	chown node:node "$GHOST_INSTALL"; \
 	\
-	gosu node ghost install "$GHOST_VERSION" --db sqlite3 --no-prompt --no-stack --no-setup --dir "$GHOST_INSTALL"; \
+	savedAptMark="$(apt-mark showmanual)"; \
+	aptPurge=; \
+	\
+	installCmd='gosu node ghost install "$GHOST_VERSION" --db sqlite3 --no-prompt --no-stack --no-setup --dir "$GHOST_INSTALL"'; \
+	if ! eval "$installCmd"; then \
+		aptPurge=1; \
+		apt-get update; \
+		apt-get install -y --no-install-recommends g++ make python3; \
+		eval "$installCmd"; \
+	fi; \
 	\
 # Tell Ghost to listen on all ips and not prompt for additional configuration
 	cd "$GHOST_INSTALL"; \
@@ -67,26 +76,41 @@ RUN set -eux; \
 	chown node:node "$GHOST_CONTENT"; \
 	chmod 1777 "$GHOST_CONTENT"; \
 	\
-# force install "sqlite3" manually since it's an optional dependency of "ghost"
+# force install a few extra packages manually since they're "optional" dependencies
 # (which means that if it fails to install, like on ARM/ppc64le/s390x, the failure will be silently ignored and thus turn into a runtime error instead)
 # see https://github.com/TryGhost/Ghost/pull/7677 for more details
 	cd "$GHOST_INSTALL/current"; \
-# scrape the expected version of sqlite3 directly from Ghost itself
-	sqlite3Version="$(node -p 'require("./package.json").optionalDependencies["sqlite3"]')"; \
-	[ -n "$sqlite3Version" ]; \
-	[ "$sqlite3Version" != 'undefined' ]; \
-	if ! gosu node yarn add "sqlite3@$sqlite3Version" --force; then \
+# scrape the expected versions directly from Ghost/dependencies
+	packages="$(node -p ' \
+		var ghost = require("./package.json"); \
+		var transform = require("./node_modules/@tryghost/image-transform/package.json"); \
+		[ \
+			"sharp@" + transform.optionalDependencies["sharp"], \
+			"sqlite3@" + ghost.optionalDependencies["sqlite3"], \
+		].join(" ") \
+	')"; \
+	if echo "$packages" | grep 'undefined'; then exit 1; fi; \
+	for package in $packages; do \
+		installCmd='gosu node yarn add "$package" --force'; \
+		if ! eval "$installCmd"; then \
 # must be some non-amd64 architecture pre-built binaries aren't published for, so let's install some build deps and do-it-all-over-again
-		savedAptMark="$(apt-mark showmanual)"; \
+			aptPurge=1; \
 			apt-get update; \
-		apt-get install -y --no-install-recommends g++ gcc libc-dev libvips-dev make python2; \
-		rm -rf /var/lib/apt/lists/*; \
+			apt-get install -y --no-install-recommends g++ make python3; \
+			case "$package" in \
+				# TODO sharp@*) apt-get install -y --no-install-recommends libvips-dev ;; \
+				sharp@*) echo >&2 "sorry: libvips 8.10 in Debian bullseye is not new enough (8.12.2+) for sharp 0.30 😞"; continue ;; \
+			esac; \
 			\
-		npm_config_python='python2' gosu node yarn add "sqlite3@$sqlite3Version" --force --build-from-source; \
+			eval "$installCmd --build-from-source"; \
+		fi; \
+	done; \
 	\
+	if [ -n "$aptPurge" ]; then \
 		apt-mark showmanual | xargs apt-mark auto > /dev/null; \
 		[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \
 		apt-get purge -y --auto-remove; \
+		rm -rf /var/lib/apt/lists/*; \
 	fi; \
 	\
 	gosu node yarn cache clean; \

Relevant Maintainers:

@yosifkit yosifkit merged commit 5b28b37 into docker-library:master Jun 2, 2022
@yosifkit yosifkit deleted the ghost branch June 2, 2022 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants