From 34151627874b722a6cfc029ca60b1f79e90ef299 Mon Sep 17 00:00:00 2001 From: qfl <790872612@qq.com> Date: Fri, 4 Jul 2025 15:18:56 +0800 Subject: [PATCH 1/3] docs(CONTRIBUTING.md): update steps for adding a new extension --- CONTRIBUTING.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a2c0976d3..6907d85ec 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,14 +1,19 @@ # Welcome to Supabase Postgres contributing guide -## Adding a new extension +## Adding a New Extension -Extensions can either be built from source or installed through a debian package. In general, you want to add the installation commands for your extension to the [Dockerfile](Dockerfile) following the steps below. +Supabase Postgres supports multiple Dockerfiles for different versions and deployment scenarios (e.g., `Dockerfile-15`, `Dockerfile-17`, `Dockerfile-kubernetes`, `Dockerfile-orioledb-17`). +**Please add your extension to each relevant Dockerfile according to the images you want to support.** -1. Create a [build stage](Dockerfile#L777) named after your extension. -2. Add build args that specify the extension's [release version](Dockerfile#L37). -3. If your extension is published as a package, download it to `/tmp/.deb` using the [ADD command](Dockerfile#L705). -4. If you need to build the extensions from source, use [checkinstall](Dockerfile#L791) to create a `/tmp/.deb` package. -5. Copy your extension's package from build stage to [extensions stage](Dockerfile#L851). +### Steps + +1. **Add a build stage** for your extension in the target Dockerfile, named after your extension. + _Tip: Search for `FROM base as` in the Dockerfile to find all extension build stages._ +2. **Add build arguments** for your extension's release version if needed. +3. **Download or build the extension package** (`.deb`) in your build stage and place it in `/tmp/`. + - If your extension is published as a `.deb` package, use `ADD` or `COPY`. + - If you need to build from source, use `checkinstall` or a similar tool to create a `.deb` package. +4. **In the `extensions` stage**, use `COPY --from=your_stage` to copy your package into the final image. Here's a minimal example: From 67e817c18d8251b9655857950f4950f699a0c7ba Mon Sep 17 00:00:00 2001 From: qfl <790872612@qq.com> Date: Tue, 8 Jul 2025 18:08:35 +0800 Subject: [PATCH 2/3] docs: update extension addition instructions in CONTRIBUTING.md --- CONTRIBUTING.md | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6907d85ec..3b3c38469 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,17 +3,8 @@ ## Adding a New Extension Supabase Postgres supports multiple Dockerfiles for different versions and deployment scenarios (e.g., `Dockerfile-15`, `Dockerfile-17`, `Dockerfile-kubernetes`, `Dockerfile-orioledb-17`). -**Please add your extension to each relevant Dockerfile according to the images you want to support.** -### Steps - -1. **Add a build stage** for your extension in the target Dockerfile, named after your extension. - _Tip: Search for `FROM base as` in the Dockerfile to find all extension build stages._ -2. **Add build arguments** for your extension's release version if needed. -3. **Download or build the extension package** (`.deb`) in your build stage and place it in `/tmp/`. - - If your extension is published as a `.deb` package, use `ADD` or `COPY`. - - If you need to build from source, use `checkinstall` or a similar tool to create a `.deb` package. -4. **In the `extensions` stage**, use `COPY --from=your_stage` to copy your package into the final image. +> Instructions for [adding extensions](https://github.com/supabase/postgres/blob/develop/nix/docs/adding-new-package.md) Here's a minimal example: From 11b4c771be2cffe65c1158de7132337edfad9953 Mon Sep 17 00:00:00 2001 From: qfl <790872612@qq.com> Date: Thu, 10 Jul 2025 09:50:32 +0800 Subject: [PATCH 3/3] docs: remove pg_graphql extension Dockerfile example from CONTRIBUTING.md --- CONTRIBUTING.md | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3b3c38469..71003f8d8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,29 +6,6 @@ Supabase Postgres supports multiple Dockerfiles for different versions and deplo > Instructions for [adding extensions](https://github.com/supabase/postgres/blob/develop/nix/docs/adding-new-package.md) -Here's a minimal example: - -```dockerfile -ARG pg_graphql_release=1.1.0 - -#################### -# 19-pg_graphql.yml -#################### -FROM base as pg_graphql -# Download package archive -ARG pg_graphql_release -ADD "https://github.com/supabase/pg_graphql/releases/download/v${pg_graphql_release}/pg_graphql-v${pg_graphql_release}-pg${postgresql_major}-${TARGETARCH}-linux-gnu.deb" \ - /tmp/pg_graphql.deb - -#################### -# Collect extension packages -#################### -FROM scratch as extensions -COPY --from=pg_graphql /tmp/*.deb /tmp/ -``` - -Using this process maximises the effectiveness of Docker layer caching, which significantly speeds up our CI builds. - ## Testing an extension Extensions can be tested automatically using pgTAP. Start by creating a new file in [migrations/tests/extensions](migrations/tests/extensions). For example: pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy