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: 2 additions & 14 deletions 6-next/alpine3.23/Dockerfile

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

27 changes: 4 additions & 23 deletions 6-next/bookworm/Dockerfile

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

25 changes: 3 additions & 22 deletions Dockerfile-next.template
Original file line number Diff line number Diff line change
Expand Up @@ -76,30 +76,11 @@ RUN set -eux; \
{{ if is_alpine then "" else ( -}}
savedAptMark="$(apt-mark showmanual)"; \
apt-get update; \
apt-get install -y --no-install-recommends \
ca-certificates \
wget \
# only arm32v7 needs these: it has no prebuilt better-sqlite3 or re2, so they fall back to node-gyp
g++ \
make \
python3 \
; \
apt-get install -y --no-install-recommends ca-certificates wget; \
\
{{ ) end -}}
# 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; \
# Ghost pins its pnpm by hash in "packageManager", so corepack fetches exactly that one
corepack enable; \
\
# 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
10 changes: 2 additions & 8 deletions versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"arches": [
"amd64",
"arm32v7",
"arm64v8",
"s390x"
"arm64v8"
],
"from": "node:22-bookworm-slim"
},
Expand All @@ -39,16 +38,11 @@
"node": {
"version": "22"
},
"pnpm": {
"fallbackVersion": "11.26.0"
},
"variants": {
"bookworm": {
"arches": [
"amd64",
"arm32v7",
"arm64v8",
"s390x"
"arm64v8"
],
"from": "node:22-bookworm-slim"
},
Expand Down
15 changes: 10 additions & 5 deletions versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ fi
# 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.
# Only the Ghost-CLI image needs it: "-next" does not build arm32v7 at all (see below).
pnpmFallbackVersion="$(
fetch 'https://registry.npmjs.org/pnpm' '."dist-tags"."latest-11" // empty' \
| jq --raw-output '."dist-tags"."latest-11"'
Expand Down Expand Up @@ -153,7 +154,7 @@ for version in "${versions[@]}"; do
x64: "amd64",
arm64: "arm64v8",
arm: "arm32v7",
s390x: "s390x",
# no s390x: sharp ships a prebuilt for it, but the node:22 images publish none to build on
}[.] // empty) # TODO maybe warn/error on unexpected values?
| sort
)
Expand Down Expand Up @@ -206,21 +207,25 @@ for version in "${versions[@]}"; do
'{ cli: { version: $version, sha: $sha } }')"
fi

export fullVersion nodeVersion pnpmFallbackVersion
export fullVersion nodeVersion pnpmFallbackVersion isNext
json="$(jq <<<"$json" --compact-output --argjson doc "$doc" --argjson source "$sourceJson" '
env.nodeVersion as $nodeVersion
| .[env.version] = (
{ version: env.fullVersion }
+ $source
+ { node: { version: $nodeVersion } }
+ (if env.isNext == "" then { pnpm: { fallbackVersion: env.pnpmFallbackVersion } } else {} end)
+ {
node: { version: $nodeVersion },
pnpm: { fallbackVersion: env.pnpmFallbackVersion },
variants: (
$doc
| with_entries(
# "-next" previews the Ghost 7.0 image, which drops arm32v7: pnpm 12 has no 32-bit ARM
# build, and carrying the pnpm 11 fallback into a new image is not worth it
if env.isNext != "" then .value.arches -= [ "arm32v7" ] else . end

# add image FROM for Dockerfile template and parent arch lookup in generate-stackbrew-library.sh
# e.g. "node:22-alpine3.23" or "node:22-trixie-slim"
.value.from = "node:\($nodeVersion)-\(.key)\(
| .value.from = "node:\($nodeVersion)-\(.key)\(
if .key | startswith("alpine") then "" else "-slim" end
)"
)
Expand Down
Loading