Skip to content

Conversation

@hunleyd
Copy link
Contributor

@hunleyd hunleyd commented Dec 3, 2025

Ensure the /etc/postgresql-custom/conf.d directory is correctly created and managed by the entrypoint script in Docker images for PostgreSQL 15, 17, and orioledb-17.

This change adds logic to docker-entrypoint.sh to:

  • Create the /etc/postgresql-custom/conf.d directory if it does not exist.
  • Set the ownership to postgres:postgres.
  • Set the permissions to 0755.

This ensures that custom PostgreSQL configuration files placed in this directory are correctly recognized and loaded by the PostgreSQL server during container startup, improving configuration management and extension support.

Screenshot 2025-12-03 at 11 05 31

Ensure the `/etc/postgresql-custom/conf.d` directory is correctly created and managed by the entrypoint script in Docker images for PostgreSQL 15, 17, and orioledb-17.

This change adds logic to `docker-entrypoint.sh` to:
- Create the `/etc/postgresql-custom/conf.d` directory if it does not exist.
- Set the ownership to `postgres:postgres`.
- Set the permissions to `0755`.

This ensures that custom PostgreSQL configuration files placed in this directory are correctly recognized and loaded by the PostgreSQL server during container startup, improving configuration management and extension support.
@hunleyd hunleyd requested a review from samrose December 3, 2025 16:07
Copy link
Collaborator

@samrose samrose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far when I try to build Dockerfile-17 we're seeing

docker build -f Dockerfile-17 -t supabase-postgres-17 .
[+] Building 1.5s (4/4) FINISHED                                                                                                                      docker:orbstack
 => [internal] load build definition from Dockerfile-17                                                                                                          0.0s
 => => transferring dockerfile: 12.18kB                                                                                                                          0.0s
 => resolve image config for docker-image://docker.io/docker/dockerfile:1.6                                                                                      0.7s
 => [auth] docker/dockerfile:pull token for registry-1.docker.io                                                                                                 0.0s
 => CACHED docker-image://docker.io/docker/dockerfile:1.6@sha256:ac85f380a63b13dfcefa89046420e1781752bab202122f8f50032edf31be0021                                0.0s
Dockerfile-17:257
--------------------
 256 |     RUN sed -i '/03775/a\\
 257 | >>> mkdir -p /etc/postgresql-custom/conf.d\
 258 | >>> chown postgres:postgres /etc/postgresql-custom/conf.d\
 259 | >>> chmod 0755 /etc/postgresql-custom/conf.d' /usr/local/bin/docker-entrypoint.sh
 260 |     
--------------------
ERROR: failed to build: failed to solve: dockerfile parse error on line 257: unknown instruction: mkdir

the problem is these commands need to be prefixed with RUN

@samrose
Copy link
Collaborator

samrose commented Dec 3, 2025

docker build -f Dockerfile-15 -t supabase-postgres-15 .
[+] Building 0.6s (3/3) FINISHED                                                                                                                      docker:orbstack
 => [internal] load build definition from Dockerfile-15                                                                                                          0.0s
 => => transferring dockerfile: 11.50kB                                                                                                                          0.0s
 => resolve image config for docker-image://docker.io/docker/dockerfile:1.6                                                                                      0.3s
 => CACHED docker-image://docker.io/docker/dockerfile:1.6@sha256:ac85f380a63b13dfcefa89046420e1781752bab202122f8f50032edf31be0021                                0.0s
Dockerfile-15:245
--------------------
 244 |     RUN sed -i '/03775/a\\
 245 | >>> mkdir -p /etc/postgresql-custom/conf.d\
 246 | >>> chown postgres:postgres /etc/postgresql-custom/conf.d\
 247 | >>> chmod 0755 /etc/postgresql-custom/conf.d' /usr/local/bin/docker-entrypoint.sh
 248 |     
--------------------
ERROR: failed to build: failed to solve: dockerfile parse error on line 245: unknown instruction: mkdir

@samrose
Copy link
Collaborator

samrose commented Dec 3, 2025

docker build -f Dockerfile-orioledb-17 -t supabase-postgres-orioledb . 

[+] Building 0.5s (3/3) FINISHED                                                                                                                      docker:orbstack
 => [internal] load build definition from Dockerfile-orioledb-17                                                                                                 0.0s
 => => transferring dockerfile: 13.06kB                                                                                                                          0.0s
 => resolve image config for docker-image://docker.io/docker/dockerfile:1.6                                                                                      0.2s
 => CACHED docker-image://docker.io/docker/dockerfile:1.6@sha256:ac85f380a63b13dfcefa89046420e1781752bab202122f8f50032edf31be0021                                0.0s
Dockerfile-orioledb-17:268
--------------------
 267 |     RUN sed -i '/03775/a\\
 268 | >>> mkdir -p /etc/postgresql-custom/conf.d\
 269 | >>> chown postgres:postgres /etc/postgresql-custom/conf.d\
 270 | >>> chmod 0755 /etc/postgresql-custom/conf.d' /usr/local/bin/docker-entrypoint.sh
 271 |     
--------------------
ERROR: failed to build: failed to solve: dockerfile parse error on line 268: unknown instruction: mkdir

- Replaced `nix profile install .#<package>` with `nix profile add path:.#<package>` for installing Nix packages, which is both the recommended command, and allows nix to work with git worktrees when inside Docker.
- Ensured the `conf.d` directory for PostgreSQL configuration is correctly copied.
- Removed redundant `mkdir` and `chown` commands from the `docker-entrypoint.sh` script, as these are now handled by the `COPY` instruction.
@hunleyd hunleyd marked this pull request as ready for review December 4, 2025 16:41
@hunleyd hunleyd requested review from a team as code owners December 4, 2025 16:41
@samrose samrose added this pull request to the merge queue Dec 4, 2025
Merged via the queue into develop with commit 269f137 Dec 4, 2025
14 checks passed
@samrose samrose deleted the INDATA-264 branch December 4, 2025 22:52
hunleyd added a commit that referenced this pull request Dec 5, 2025
* origin:
  feat: Ensure postgres conf.d directory is set up (#1961)
  Multi version ext/pg partman (#1854)
hunleyd added a commit that referenced this pull request Dec 5, 2025
* origin:
  feat: Ensure postgres conf.d directory is set up (#1961)
  Multi version ext/pg partman (#1854)
yvan-sraka pushed a commit that referenced this pull request Dec 7, 2025
* feat: Ensure postgres conf.d directory is set up

Ensure the `/etc/postgresql-custom/conf.d` directory is correctly created and managed by the entrypoint script in Docker images for PostgreSQL 15, 17, and orioledb-17.

This change adds logic to `docker-entrypoint.sh` to:
- Create the `/etc/postgresql-custom/conf.d` directory if it does not exist.
- Set the ownership to `postgres:postgres`.
- Set the permissions to `0755`.

This ensures that custom PostgreSQL configuration files placed in this directory are correctly recognized and loaded by the PostgreSQL server during container startup, improving configuration management and extension support.

* build: Update Nix install command and Dockerfile configs

- Replaced `nix profile install .#<package>` with `nix profile add path:.#<package>` for installing Nix packages, which is both the recommended command, and allows nix to work with git worktrees when inside Docker.
- Ensured the `conf.d` directory for PostgreSQL configuration is correctly copied.
- Removed redundant `mkdir` and `chown` commands from the `docker-entrypoint.sh` script, as these are now handled by the `COPY` instruction.
yvan-sraka pushed a commit that referenced this pull request Dec 8, 2025
* feat: Ensure postgres conf.d directory is set up

Ensure the `/etc/postgresql-custom/conf.d` directory is correctly created and managed by the entrypoint script in Docker images for PostgreSQL 15, 17, and orioledb-17.

This change adds logic to `docker-entrypoint.sh` to:
- Create the `/etc/postgresql-custom/conf.d` directory if it does not exist.
- Set the ownership to `postgres:postgres`.
- Set the permissions to `0755`.

This ensures that custom PostgreSQL configuration files placed in this directory are correctly recognized and loaded by the PostgreSQL server during container startup, improving configuration management and extension support.

* build: Update Nix install command and Dockerfile configs

- Replaced `nix profile install .#<package>` with `nix profile add path:.#<package>` for installing Nix packages, which is both the recommended command, and allows nix to work with git worktrees when inside Docker.
- Ensured the `conf.d` directory for PostgreSQL configuration is correctly copied.
- Removed redundant `mkdir` and `chown` commands from the `docker-entrypoint.sh` script, as these are now handled by the `COPY` instruction.
yvan-sraka pushed a commit that referenced this pull request Dec 8, 2025
* feat: Ensure postgres conf.d directory is set up

Ensure the `/etc/postgresql-custom/conf.d` directory is correctly created and managed by the entrypoint script in Docker images for PostgreSQL 15, 17, and orioledb-17.

This change adds logic to `docker-entrypoint.sh` to:
- Create the `/etc/postgresql-custom/conf.d` directory if it does not exist.
- Set the ownership to `postgres:postgres`.
- Set the permissions to `0755`.

This ensures that custom PostgreSQL configuration files placed in this directory are correctly recognized and loaded by the PostgreSQL server during container startup, improving configuration management and extension support.

* build: Update Nix install command and Dockerfile configs

- Replaced `nix profile install .#<package>` with `nix profile add path:.#<package>` for installing Nix packages, which is both the recommended command, and allows nix to work with git worktrees when inside Docker.
- Ensured the `conf.d` directory for PostgreSQL configuration is correctly copied.
- Removed redundant `mkdir` and `chown` commands from the `docker-entrypoint.sh` script, as these are now handled by the `COPY` instruction.
yvan-sraka pushed a commit that referenced this pull request Dec 8, 2025
* feat: Ensure postgres conf.d directory is set up

Ensure the `/etc/postgresql-custom/conf.d` directory is correctly created and managed by the entrypoint script in Docker images for PostgreSQL 15, 17, and orioledb-17.

This change adds logic to `docker-entrypoint.sh` to:
- Create the `/etc/postgresql-custom/conf.d` directory if it does not exist.
- Set the ownership to `postgres:postgres`.
- Set the permissions to `0755`.

This ensures that custom PostgreSQL configuration files placed in this directory are correctly recognized and loaded by the PostgreSQL server during container startup, improving configuration management and extension support.

* build: Update Nix install command and Dockerfile configs

- Replaced `nix profile install .#<package>` with `nix profile add path:.#<package>` for installing Nix packages, which is both the recommended command, and allows nix to work with git worktrees when inside Docker.
- Ensured the `conf.d` directory for PostgreSQL configuration is correctly copied.
- Removed redundant `mkdir` and `chown` commands from the `docker-entrypoint.sh` script, as these are now handled by the `COPY` instruction.
yvan-sraka pushed a commit that referenced this pull request Dec 8, 2025
* feat: Ensure postgres conf.d directory is set up

Ensure the `/etc/postgresql-custom/conf.d` directory is correctly created and managed by the entrypoint script in Docker images for PostgreSQL 15, 17, and orioledb-17.

This change adds logic to `docker-entrypoint.sh` to:
- Create the `/etc/postgresql-custom/conf.d` directory if it does not exist.
- Set the ownership to `postgres:postgres`.
- Set the permissions to `0755`.

This ensures that custom PostgreSQL configuration files placed in this directory are correctly recognized and loaded by the PostgreSQL server during container startup, improving configuration management and extension support.

* build: Update Nix install command and Dockerfile configs

- Replaced `nix profile install .#<package>` with `nix profile add path:.#<package>` for installing Nix packages, which is both the recommended command, and allows nix to work with git worktrees when inside Docker.
- Ensured the `conf.d` directory for PostgreSQL configuration is correctly copied.
- Removed redundant `mkdir` and `chown` commands from the `docker-entrypoint.sh` script, as these are now handled by the `COPY` instruction.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants