feat: support newer Alpine-based Supabase Postgres images#58
Open
damlayildiz wants to merge 7 commits into
Open
feat: support newer Alpine-based Supabase Postgres images#58damlayildiz wants to merge 7 commits into
damlayildiz wants to merge 7 commits into
Conversation
Make the published sqlite-sync-supabase images build on Supabase's newer Alpine-userland Postgres bases alongside the existing Ubuntu ones. Despite the Alpine userland these images run a glibc Nix postgres, so the same glibc extension artifact is installed - only the build-time tooling (apt-get vs apk) and the pg_config path differ. - Dockerfile.supabase.release: detect apk/apt-get and resolve pg_config dynamically; one file now serves both base families - main.yml: add PG17 Alpine publish row (17.6.1.151) with a -alpine tag suffix so it does not collide with the :17/:15 aliases; bump PG15 base pin 15.8.1.085 -> 15.8.1.135 - docs: document the Ubuntu vs Alpine base split and refresh illustrative PG15 base tags
damlayildiz
marked this pull request as draft
July 22, 2026 16:01
damlayildiz
marked this pull request as ready for review
July 22, 2026 17:03
- workflow: include tag_suffix in the docker-publish job name, so the Ubuntu and Alpine PG17 rows no longer render as the same check name - only remove curl again when it was not already in the base image, and skip installing it entirely when a beta artifact is staged; drop the GNU tar install (busybox tar extracts the release tarball) - CLOUDSYNC_PG_CONFIG is an ARG, so --build-arg actually overrides it and the empty value no longer leaks into the published image - fail with an actionable message when CLOUDSYNC_VERSION is not passed - resolve pg_config from the Nix profiles the Supabase bases ship before falling back to PATH, keeping the Ubuntu images on their previous path Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Also drop the pinned CloudSync version from the Dockerfile usage example so it does not go stale. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Build amd64 natively and load it, then boot the image and run CREATE EXTENSION cloudsync / cloudsync_version() against it. The multi-arch push only runs once that passes, so a broken artifact cannot reach Docker Hub, and amd64 stops being the untested arch. Readiness is probed over TCP because the entrypoint's init-time server listens on the unix socket only. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
5 tasks
Single-Machine Docker-in-Docker image: dockerd plus a pinned copy of the upstream Supabase compose tree, with our overrides layered via COMPOSE_FILE and all state on a Fly volume at /data. No deployment-specific identifier is committed: the app name, region and org are passed to `fly deploy`, the public URLs are derived from FLY_APP_NAME at boot, and the image tag defaults to the released :17-alpine with CLOUDSYNC_IMAGE as the override for beta builds. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- layer docker-compose.envoy.yml so the stack runs Envoy (api-gw) instead of Kong, ahead of upstream making it the default in the ~Aug 2026 release - keep a failed `compose up` from crash-looping the Machine into Fly's restart cap, and bound the Postgres wait so post-init cannot hang - remove containers whose service left the compose config before starting: --remove-orphans ignores profile-disabled services, and the stale supabase-kong container held port 8000 so Envoy could not bind - document the deployment on its own and drop the superseded manual VM guide
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support newer Alpine-based Supabase Postgres images
Summary
Supabase's Postgres images switched their userland from Ubuntu to Alpine for the
current PG17 line (~
17.6.1.084and later). This PR makes the publishedsqlitecloud/sqlite-sync-supabaseimages build cleanly on those newer bases, inparallel with the existing Ubuntu-based images, and refreshes the pinned base tags.
Key finding: despite the Alpine userland, the PostgreSQL that actually runs on
these images is still a Nix-built, glibc-linked binary (every shipped plugin
needs
libc.so.6+ a nix-glibc RUNPATH). So the existing glibc extension artifactis the correct one — no musl build is required. Only the Dockerfile's build-time
userland tooling (
apt-getvsapk) and thepg_configpath differ between bases.Changes
docker/postgresql/Dockerfile.supabase.release— made userland-agnostic:apkvsapt-getto install thecurlused for the download,pg_configdynamically (path differs:/usr/binon Ubuntu vs the Nixdefault profile on Alpine),
NIX_PGLIBDIRinstall logicwas already portable and is unchanged.
One file now serves both base families.
.github/workflows/main.yml— docker-publish matrix:17.6.1.151),tag_suffixmechanism so Alpine publishes under distinct tags(
:17-alpine,:17-alpine-<ver>,:17.6.1.151) with no collision against the:17/:15aliases,15.8.1.085 → 15.8.1.135(latest published 15 build;still Ubuntu — Supabase kept the 15 line on Ubuntu, 20.04→24.04).
docs/postgresql/quickstarts/supabase-self-hosted.md— documented theUbuntu-vs-Alpine base split, added the
:17-alpineimage option, updated thePG15 base reference to
15.8.1.135.docker/README.md— note that the published release image handles both basesautomatically, while the local build-from-source flow currently targets Ubuntu.
docs/internal/supabase-flyio.md— refreshed the illustrative PG15 base tagfrom
15.8.1.085to15.8.1.135throughout.Resulting published tags
17.6.1.071:17,:17-<ver>,:17.6.1.07115.8.1.135:15,:15-<ver>,:15.8.1.13517.6.1.151:17-alpine,:17-alpine-<ver>,:17.6.1.151The shared
:17/:15aliases intentionally stay on the Ubuntu builds for now(non-breaking for existing pins).
Verification (local, arm64)
Built each image with its staged glibc artifact and ran
CREATE EXTENSION cloudsync; SELECT cloudsync_version();→1.1.2:17.6.1.071(Ubuntu / apt branch) — ✅15.8.1.135(Ubuntu 24.04 / apt branch) — ✅17.6.1.151(Alpine / apk branch) — ✅Open points (please check)
:17/:15alias scheme — deferred by design. Alpine is behind explicit-alpine+ exact-base tags. Decide whether/when:17should point at Alpine(matching what current Supabase self-hosting pulls), with the Ubuntu build moved
to e.g.
:17-ubuntu.17.6.1.071) — kept for back-compat. Supabase moved the PG17line to Alpine, so this row is frozen on an old Ubuntu base (nothing newer to
bump to) but still builds and works. Decision: keep it; the only related question
is the
:17alias in point 1 above.is arch-independent and CI builds
linux/amd64,linux/arm64; the first CI run isthe real amd64 proof.
Dockerfile.supabase,make postgres-supabase-build)still targets Ubuntu bases (uses
apt-get+ hardcodedpg_config). Out of scopehere, but if the Supabase CLI bundles an Alpine image, this breaks. Compile-in-image
on Alpine was proven to work — easy follow-up if wanted.
17.6.1.151and15.8.1.135are exact pins and will age;bumping is a manual edit (same as before). Optionally we could resolve the latest
base tag dynamically in CI, at the cost of build reproducibility. Recommend keeping
pins.
Test plan
:17-alpineand:15images load the extension (cloudsync_version()).:17/:15consumers unaffected.Update — review follow-ups
Three commits on top of the original feature commit.
c4faf47— review fixesdocker sqlite-sync-supabase pg17; the job name now includestag_suffix.apk del curlwas a live regression. curl is already present in the real17.6.1.151Alpine base —apk addonly had to installca-certificates— so the previous unconditionalapk del curlwould have stripped curl out of every published Alpine image. It is now removed only if it was not already in the base, and is not installed at all when a beta artifact is staged. The GNUtarinstall was dropped too; busybox tar extracts the release tarball.CLOUDSYNC_PG_CONFIGis anARG, not anENV, so--build-argactually overrides it (it previously could not) and the empty value no longer leaks into the published image.CLOUDSYNC_VERSIONnow fails with an actionable message instead ofunbound variable.pg_configresolution tries the Nix profiles the Supabase bases ship before falling back toPATH, so the Ubuntu images keep the exact path they resolved to before this PR.b5c621e— doc nits:17-alpineadded to the quickstart's "For Existing Deployments" block and to the release-notes body; the pinned CloudSync version in the Dockerfile usage example replaced with a placeholder.1a3e635— CI smoke test before publishEach matrix row now builds amd64 natively, loads it, boots it and runs
CREATE EXTENSION cloudsync; SELECT cloudsync_version();before the multi-arch push, so a broken artifact cannot reach Docker Hub.Measured cost on run 29998811353 — all five rows green:
Workflow wall clock: 778 s vs 738 s (+40 s) —
docker-publishis not on the critical path. The push step dropped 17–22 s on every row, confirming the amd64 layers are reused from the builder cache; the remaining cost is theloadexport, which scales with image size (hence the large Ubuntu Supabase rows).Open points now settled
CREATE EXTENSION→1.1.2on amd64, one second before the push begins. The real17.6.1.151base was additionally verified by hand on arm64 (full container boot +CREATE EXTENSION).:17/:15alias scheme) — stays deferred, now tracked in Ship :17-ubuntu before flipping the :17 Supabase alias to Alpine #59. Recommendation there: do not flip:17until the Alpine image has been exercised inside a full Supabase stack, and ship:17-ubuntuone release ahead of the flip.🤖 Generated with Claude Code