Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions 6-next/alpine3.23/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions 6-next/bookworm/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion 6/alpine3.23/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion 6/bookworm/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions Dockerfile-next.template
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,20 @@ RUN set -eux; \
; \
\
{{ ) end -}}
# Ghost pins its pnpm by hash in "packageManager", so corepack fetches exactly that one
corepack enable; \
# Ghost pins its pnpm by hash in "packageManager", so corepack fetches exactly that one -- except on
# arm32v7, where pnpm 12 is a Rust binary with no 32-bit ARM target and no JavaScript fallback.
# pnpm 11 is the last JavaScript implementation and reads the same lockfile format
if [ "$(node -p 'process.arch')" = 'arm' ]; then \
# yarn still goes to corepack so "rm -rf /opt/yarn-*" below does not leave its symlinks dangling
corepack enable yarn; \
npm install -g 'pnpm@{{ .pnpm.fallbackVersion }}'; \
else \
corepack enable; \
fi; \
\
# pnpm 11 would otherwise honour "packageManager" and switch back to the binary it cannot run.
# Inert under corepack, which owns version switching; exported so it survives the "gosu ghost" drop
export pnpm_config_pm_on_fail=ignore; \
\
# everything under the install dir is created by "ghost" rather than chowned afterwards: a recursive
# chown would copy the whole tree into a new layer
Expand Down
16 changes: 15 additions & 1 deletion Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,18 @@ RUN set -eux; \
apt-get install -y --no-install-recommends ca-certificates git; \
{{ ) end -}}
\
corepack enable; \
# pnpm 12 is a Rust binary with no 32-bit ARM target and no JavaScript fallback, so corepack cannot
# produce the version "packageManager" pins on arm32v7. pnpm 11 is the last JavaScript
# implementation and reads the same lockfile format, so that arch installs with it instead
if [ "$(node -p 'process.arch')" = 'arm' ]; then \
npm install -g 'pnpm@{{ .pnpm.fallbackVersion }}'; \
Comment thread
coderabbitai[bot] marked this conversation as resolved.
else \
corepack enable; \
fi; \
\
# pnpm 11 would otherwise honour "packageManager" and switch back to the binary it cannot run;
# exported because Ghost-CLI spawns pnpm itself. Inert under corepack, which owns version switching
export pnpm_config_pm_on_fail=ignore; \
\
# corepack's downloads, pnpm's metadata cache and pnpm's store all derive their location
# from these, so pointing them at /tmp keeps every throwaway byte in one place
Expand Down Expand Up @@ -125,6 +136,9 @@ RUN set -eux; \
mkdir -p "$GHOST_INSTALL"; \
chown node:node "$GHOST_INSTALL"; \
\
# "ghost install" and "pnpm store prune" below both run pnpm; see the note in the Ghost-CLI stage
export pnpm_config_pm_on_fail=ignore; \
\
{{ if is_alpine then ( -}}
apk add --no-cache --virtual .build-deps-ghost g++ linux-headers make python3 py3-setuptools; \
{{ ) else ( -}}
Expand Down
6 changes: 6 additions & 0 deletions versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"node": {
"version": "22"
},
"pnpm": {
"fallbackVersion": "11.26.0"
},
"variants": {
"bookworm": {
"arches": [
Expand Down Expand Up @@ -36,6 +39,9 @@
"node": {
"version": "22"
},
"pnpm": {
"fallbackVersion": "11.26.0"
},
"variants": {
"bookworm": {
"arches": [
Expand Down
14 changes: 13 additions & 1 deletion versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ if [ -z "$cliSha" ]; then
exit 1
fi

# pnpm 12 is a Rust binary and publishes no 32-bit ARM target, and unlike every pnpm before it
# there is no JavaScript implementation to fall back to -- the npm package is a downloader that
# fetches "@pnpm/exe.<platform>-<arch>". So corepack cannot produce the version "packageManager"
# pins when building for arm32v7. pnpm 11 is the last JavaScript implementation, is still released
# alongside 12 ("latest-11"), and reads the same lockfile format, so that architecture builds with
# it instead. Pinned here so it is refreshed by the update workflow like every other version.
pnpmFallbackVersion="$(
fetch 'https://registry.npmjs.org/pnpm' '."dist-tags"."latest-11" // empty' \
| jq --raw-output '."dist-tags"."latest-11"'
)"

for version in "${versions[@]}"; do
rcVersion="${version%-rc}"
rcGrepV='-v'
Expand Down Expand Up @@ -195,14 +206,15 @@ for version in "${versions[@]}"; do
'{ cli: { version: $version, sha: $sha } }')"
fi

export fullVersion nodeVersion
export fullVersion nodeVersion pnpmFallbackVersion
json="$(jq <<<"$json" --compact-output --argjson doc "$doc" --argjson source "$sourceJson" '
env.nodeVersion as $nodeVersion
| .[env.version] = (
{ version: env.fullVersion }
+ $source
+ {
node: { version: $nodeVersion },
pnpm: { fallbackVersion: env.pnpmFallbackVersion },
variants: (
$doc
| with_entries(
Expand Down
Loading