Commit Graph

76 Commits

Author SHA1 Message Date
Tianon Gravi 2c751341b6 Add liburing support to 18+
This is a bit complicated to use in Docker (because `io_uring` has a long and storied security story), but it is a new feature of 18+ that we should probably explicitly support for users who want to jump through the hoops to use it despite the security risk.

Additionally, this re-alphabetizes our `--with-xxx` flags.
2025-09-30 11:58:13 -07:00
Tianon Gravi a2433755c7 Update gosu to 1.19 2025-09-23 12:31:05 -07:00
Tianon Gravi a3b3bfabd3 Update gosu to 1.18 2025-09-08 13:04:25 -07:00
Tianon Gravi b9a533c87b Change `PGDATA` in 18+ to `/var/lib/postgresql/MAJOR/docker`
This is a pretty large breaking change, which is why this only makes the change in 18+ (which is currently in pre-release stages, and not due for GA until September, and pre-release `PGDATA` directories are officially *not supported* on the GA release anyhow).

Concretely, this changes `PGDATA` to `/var/lib/postgresql/MAJOR/docker`, which matches the pre-existing convention/standard of the `pg_ctlcluster`/`postgresql-common` set of commands, and frankly is what we should've done to begin with, in a classic case of Chesterton's Fence (https://en.wikipedia.org/wiki/Wikipedia:Chesterton%27s_fence).

This also changes the `VOLUME` to `/var/lib/postgresql`, which should be more reasonable, and make the upgrade constraints more obvious.

For any users who have been testing the pre-releases, the simplest way to keep your existing data directory is going to be to add `PGDATA=/var/lib/postgresql/data` as an environment variable on your container or adjust your bind-mount from `/var/lib/postgresql/data` to `/var/lib/postgresql/18/docker`, but the *best* way is going to be to refactor your host directory such that your data lives at `18/docker` inside and you can then mount directly to `/var/lib/postgresql` (possibly setting `PGDATA=/var/lib/postgresql/MAJOR/docker` as well, if you want to go overboard on being explicit).
2025-06-06 11:27:31 -07:00
Tianon Gravi 172d9e7dbc Add Alpine 3.22 (remove Alpine 3.20) 2025-05-30 14:09:41 -07:00
Tianon Gravi b23470265c Remove explicit config.guess/config.sub updates
When we added these lines, we needed newer files than PostgreSQL had upstream, but the situation has changed and we were pinned to a specific commit from 2017 - the _oldest_ PostgreSQL release version has a file from 2020.
2025-05-08 11:32:48 -07:00
Joseph Ferguson 042d8d043f Remove PostgreSQL 12 since it is end of life 2025-02-03 16:55:44 -08:00
Jeremy Schneider 32b6fcdda7
Remove inaccurate references to corruption, remove SEGTERM suggestion… (#1303)
* Remove inaccurate references to corruption, remove SEGTERM suggestion, update information links to current docs. Postgres is carefully designed such that data is not corrupted on crashes or unclean shutdowns - the main tradeoff is that WAL replay is needed on startup. In practice, SIGTERM can cause unexpected long delays to shutdowns - often during maintenance windows - so best not to actively suggest this. The links back to official Postgres documentation seem sufficient.
2025-01-09 09:56:49 -08:00
Joseph Ferguson 17818f21dc In Alpine 3.21 bump llvm version
Fixes #1296
2024-12-05 16:14:30 -08:00
Tianon Gravi 5db7a178fd Use jq's `IN()` instead of `index()`
The end result is the same, but the construction is more ergonomic.
2024-10-16 14:37:29 -07:00
Tianon Gravi a09f1c441f Use `install` instead of `mkdir && chown && chmod` 2024-07-08 15:18:09 -07:00
Tianon Gravi 3e9b4eaaeb Replace `su-exec` with `gosu`
There's a major issue with `su-exec` whose fix has gone unreleased for 5 years (typos leading to running code as root, the opposite of the purpose of the program).

This also decreases our Debian vs Alpine variance.

Due to user scripts/downstream code potentially using `su-exec`, I have included a compatibility symlink to `su-exec` for all versions less than the 17 pre-release.
2024-06-03 13:57:56 -07:00
Laurent Goderre 3a7be2f321 fixup 2024-05-31 09:43:40 -04:00
Laurent Goderre 41402ac3d1 Add 17 beta1
Fixes #1243
2024-05-29 17:09:26 -04:00
yosifkit 31aed10dbe
Merge pull request #1150 from infosiftr/docker-ensure-initdb
Add new "docker-ensure-initdb.sh" script
2023-12-13 14:17:08 -08:00
Laurent Goderre 1d4651c6c9 Revert "Added inline SBOM for binaries downloaded outside package manager"
This reverts commit 6f4ae83640.
2023-12-11 14:03:58 -05:00
Tianon Gravi c86568af4a Add new "docker-ensure-initdb.sh" script
This mimics the behavior of `docker-entrypoint.sh` before it starts the PostgreSQL server.

It has three main goals/uses:

  1. (most importantly) as an example of how to use "docker-entrypoint.sh" to extend/reuse the initialization behavior

  2. ("docker-ensure-initdb.sh") as a Kubernetes "init container" to ensure the provided database directory is initialized; see also "startup probes" for an alternative solution
       (no-op if database is already initialized)

  3. ("docker-enforce-initdb.sh") as part of CI to ensure the database is fully initialized before use
       (error if database is already initialized)
2023-12-11 10:58:54 -08:00
Tianon Gravi 2468c9d91a Update permissions from 777 to 1777 (redux)
I somehow missed Debian in 25b3034e9b (only updated Alpine), so this updates Debian in the same way.

> This still supports the "arbitrary user" use case but with slightly tighter permissions on the end result.
>
> This one is a little bit more "special" other images (due to the existing runtime/entrypoint modification of the directory modes) so I've tried to pick reasonable values for both halves.
2023-11-29 16:11:07 -08:00
Laurent Goderre 6f4ae83640 Added inline SBOM for binaries downloaded outside package manager 2023-10-04 10:54:45 -04:00
Joseph Ferguson 4fe55381ba Add postgres 16 beta1 2023-05-30 15:12:41 -07:00
Tianon Gravi 5ea98fe00b Add support for multiple (up to two) concurrent Alpine versions 2023-05-17 15:58:36 -07:00
Tianon Gravi fbc438936d Add `--enable-option-checking=fatal` to `configure` flags
Also, remove deprecated/removed `--with-krb5` (deprecated in 8.3, removed in 9.4; 98de86e422).
2023-05-12 16:51:33 -07:00
Joseph Ferguson a3b0bb68fa Downgrade llvm to 15 to fix jit support 2023-05-12 15:21:44 -07:00
Tianon Gravi 25b3034e9b Update permissions from 777 to 1777
This still supports the "arbitrary user" use case but with slightly tighter permissions on the end result.

This one is a little bit more "special" other images (due to the existing runtime/entrypoint modification of the directory modes) so I've tried to pick reasonable values for both halves.
2023-03-10 16:05:33 -08:00
Joe Ferguson 6ee0f2865b Skip unavailable nss_wrapper on ppc64le 2022-12-22 14:28:39 -08:00
Wolfgang Walther a2d5beb991
Add nss_wrapper to alpine images to run container with different user
Signed-off-by: Wolfgang Walther <walther@technowledgy.de>
2022-11-30 21:32:37 +01:00
ImreSamu 7b8a5db552 PG15 alpine: enable Zstandard builds 2022-06-30 15:52:57 -07:00
Tianon Gravi 899a216e56 Add "icu-data-full" to all Alpine images
See https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.16.0#ICU_data_split
2022-06-03 10:11:20 -07:00
Tianon Gravi e483778176 Remove unnecessary comment 2022-03-28 12:18:08 -07:00
Bjoern Hiller b4604f5e16
Fix new zstd support for alpine images
In e8ebf74e50 zstd was installed as build
dependency and thus does not end up in the final image which in turn
renders docker-entrypoint.sh broken when using *.sql.zst files.
2022-03-26 08:20:40 +01:00
Héctor Molinero Fernández e8ebf74e50 Add .sql.zst support to docker-entrypoint-initdb.d 2022-03-04 17:28:24 -08:00
Tianon Gravi 36abfddd6f Remove 9.6 (EOL)
See https://www.postgresql.org/about/news/postgresql-141-135-129-1114-1019-and-9624-released-2349/

> Additionally, this is the final release of PostgreSQL 9.6. If you are running PostgreSQL 9.6 in a production environment, we suggest that you make plans to upgrade.
2022-02-11 17:52:48 -08:00
J0WI 9eaaa05682 Alpine 3.15 2021-11-29 23:27:29 +01:00
Wolfgang Walther e331a5bb8d Build alpine images --with-krb5, --with-gssapi and --with-ldap 2021-11-12 18:12:00 +01:00
Wolfgang Walther 5d9e5a4638 Build plperl, plpython and pltcl in alpine images 2021-11-12 18:09:21 +01:00
Joe Ferguson 90892b6814 Add 14beta2 2021-07-12 15:05:16 -07:00
Tianon Gravi 517c64f87e Add initial jq-based templating engine 2021-06-16 10:36:52 -07:00
J0WI 718c12a2ad Alpine 3.14 2021-06-16 15:58:27 +02:00
Bohdan Kmit 04bf35f0c4 Keep postgres static libraries in Alpine images
Do not remove static postgres libraries from Alpine based images.
This add near 1.4MB to image size, but allow to complie some extentions
like repmgr without errors
2020-09-25 21:58:45 +03:00
Daniel Huhn bfc5d81c8f Change default STOPSIGNAL from SIGTERM to SIGINT 2020-09-18 12:03:49 -07:00
Tianon Gravi 1bddd08358 Replace "&&" chains with ";" in Alpine variants 2020-06-25 14:10:42 -07:00
Tianon Gravi 1d140375b6 Remove (no longer necessary) Alpine fetch-deps 2020-06-25 08:27:27 -07:00
J0WI b1f60bd4f8 Upgrade Alpine to 3.12 2020-06-11 00:19:04 +02:00
Pedro Lucas Farinha f582075c1c Changed default shell for user postgres 2020-02-13 17:16:35 -08:00
J0WI c4b019526a Add home dir 2020-01-01 01:31:50 +01:00
J0WI 52814abac4 Bump LLVM to 9 2019-12-23 19:34:41 +01:00
J0WI ada31ea8dc Add postgres directory and user 2019-12-23 02:21:09 +01:00
Tianon Gravi c8bf23b75f Add JIT support for Alpine on 11+ 2019-11-27 14:55:25 -08:00
Tianon Gravi 5992d8be75 Update "Dockerfile-alpine.template" and apply "update.sh" (after verifying that 12 still builds and works properly without the added "-testing" repository) 2019-05-30 13:17:17 -07:00
Tianon Gravi 03db72ffa6 Remove UUID variability now that 9.3 is gone (per comment in "update.sh") 2019-04-22 16:54:12 -07:00