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/2] 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/2] 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: