diff --git a/14/Dockerfile b/14/Dockerfile index 5cad284..64ee82e 100644 --- a/14/Dockerfile +++ b/14/Dockerfile @@ -1,4 +1,4 @@ -FROM quay.io/bfren/alpine-s6:alpine3.20-7.0.1 +FROM quay.io/bfren/alpine-s6:alpine3.20-7.0.2 LABEL org.opencontainers.image.source="https://github.com/bfren/docker-postgresql" diff --git a/15/Dockerfile b/15/Dockerfile index 69fed05..658b9b4 100644 --- a/15/Dockerfile +++ b/15/Dockerfile @@ -1,4 +1,4 @@ -FROM quay.io/bfren/alpine-s6:alpine3.22-7.0.1 +FROM quay.io/bfren/alpine-s6:alpine3.22-7.0.2 LABEL org.opencontainers.image.source="https://github.com/bfren/docker-postgresql" diff --git a/16/Dockerfile b/16/Dockerfile index 367bfdf..9caeff7 100644 --- a/16/Dockerfile +++ b/16/Dockerfile @@ -1,4 +1,4 @@ -FROM quay.io/bfren/alpine-s6:alpine3.24-7.0.1 +FROM quay.io/bfren/alpine-s6:alpine3.24-7.0.2 LABEL org.opencontainers.image.source="https://github.com/bfren/docker-postgresql" diff --git a/17/Dockerfile b/17/Dockerfile index 2db3976..9f09099 100644 --- a/17/Dockerfile +++ b/17/Dockerfile @@ -1,4 +1,4 @@ -FROM quay.io/bfren/alpine-s6:alpine3.24-7.0.1 +FROM quay.io/bfren/alpine-s6:alpine3.24-7.0.2 LABEL org.opencontainers.image.source="https://github.com/bfren/docker-postgresql" diff --git a/18/Dockerfile b/18/Dockerfile index 8a592b0..59cab6c 100644 --- a/18/Dockerfile +++ b/18/Dockerfile @@ -1,4 +1,4 @@ -FROM quay.io/bfren/alpine-s6:alpine3.24-7.0.1 +FROM quay.io/bfren/alpine-s6:alpine3.24-7.0.2 LABEL org.opencontainers.image.source="https://github.com/bfren/docker-postgresql" diff --git a/CHANGELOG.md b/CHANGELOG.md index c1d6473..a03d33c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [6.0.2] - 2026-11-10 + +### Changed + +- Base image updated to `bfren/alpine-s6` 7.0.2, which updates Nushell to 0.117.0 (your own Nushell scripts may + need changes), keeps the container starting when `BF_TZ` cannot be set, and no longer hides `CURRENT_FILE` and + `FILE_PWD` from services - see the + [Alpine + S6 changelog](https://github.com/bfren/docker-alpine-s6/blob/main/CHANGELOG.md). +- `BF_PG_DATABASE` accepts spaces as well as commas between database names, as `bfren/mariadb` does. +- The README now says to back up before running `pg-restore`: a restore deletes the current data before loading the + dump, and `psql` carries on past errors, so a bad dump leaves a partly restored cluster. Restores work as in 6.0.1. + ## [6.0.1] - 2026-11-06 ### Changed @@ -31,5 +43,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 that much memory to back up. - `pg-export dump` is refused - `/backup/dump.sql` would replace the whole cluster on the next start. +[6.0.2]: https://github.com/bfren/docker-postgresql/compare/v6.0.1...v6.0.2 [6.0.1]: https://github.com/bfren/docker-postgresql/compare/v6.0.0...v6.0.1 [6.0.0]: https://github.com/bfren/docker-postgresql/compare/v5.0.0...v6.0.0 diff --git a/README.md b/README.md index b96f775..5d498bc 100644 --- a/README.md +++ b/README.md @@ -60,9 +60,9 @@ Images are published to Docker Hub (`bfren/postgresql`) and Quay.io (`quay.io/bf | `postgresqlN` | `postgresql18` | You want the latest image for a PostgreSQL version | | `postgresqlN-MAJOR` | `postgresql18-6` | You want updates, but not breaking changes | | `postgresqlN-MINOR` | `postgresql18-6.0` | You want fixes only - **recommended** | -| `postgresqlN-VERSION` | `postgresql18-6.0.1` | You want to pin this image exactly | +| `postgresqlN-VERSION` | `postgresql18-6.0.2` | You want to pin this image exactly | | `postgresqlN.M` | `postgresql18.6` | You want an exact PostgreSQL release | -| `postgresqlN.M-VERSION` | `postgresql18.6-6.0.1` | You want to pin both | +| `postgresqlN.M-VERSION` | `postgresql18.6-6.0.2` | You want to pin both | | PostgreSQL | Release | Alpine | Supported until | | ---------- | ------- | ------ | --------------- | @@ -100,7 +100,7 @@ Everything in the volumes is owned by `postgres` (UID / GID 1000), and only read | `BF_PG_APPLICATION` | string | Default for `BF_PG_USERNAME`, `BF_PG_PASSWORD` and `BF_PG_DATABASE`. | | | `BF_PG_USERNAME` | string | Application user - created on first start. | | | `BF_PG_PASSWORD` | string | Application user's password - set on first start. | | -| `BF_PG_DATABASE` | names | Database(s) created on first start - separate several with commas. | | +| `BF_PG_DATABASE` | names | Database(s) created on first start - separate with commas or spaces. | | | `BF_PG_BACKUP_COMPRESS_FILES` | `0`, `1` | Compress backup files with bzip2. | `0` | | `BF_PG_BACKUP_KEEP_FOR` | [Nu duration](https://www.nushell.sh/book/types_of_data.html#durations) | How long to keep backups, e.g. `14day` or `8wk` (Nu has no months). | `28day` | @@ -142,6 +142,8 @@ At a random minute every eight hours (00:xx, 08:xx and 16:xx in `BF_TZ`), `pg-du `pg-restore ` restores a backup folder's `dump.sql` (or `dump.sql.bz2`), e.g. `pg-restore 202610171608`. It **replaces the whole cluster**: PostgreSQL is stopped, `/data` is emptied, a new cluster is created from the dump, and PostgreSQL starts again. +**Back up first.** The current data is deleted before the dump is loaded, and `psql` carries on past errors - so a bad or incomplete dump leaves a partly restored cluster, with no way back to the data you had. Before restoring, run `pg-dump` (it saves the current cluster in a new backup folder), or stop the container and copy `/data` somewhere safe. The [upgrade steps](#version-check) below do this too. + You can also restore while the container is stopped: put `dump.sql` or `dump.sql.bz2` in the root of `/backup` and start the container. The dump file is renamed `dump.sql.restored` once it has been restored, and `psql`'s errors are saved to `dump.sql.log` - check `docker logs` for a warning that some statements failed. ### Export and import diff --git a/VERSION b/VERSION index 6d54bbd..7a9f89d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.0.1 \ No newline at end of file +6.0.2 \ No newline at end of file diff --git a/generate-dockerfiles.sh b/generate-dockerfiles.sh index 0e4418c..6ee8c3e 100755 --- a/generate-dockerfiles.sh +++ b/generate-dockerfiles.sh @@ -4,7 +4,7 @@ set -euo pipefail docker pull bfren/alpine -BASE_VERSION="7.0.1" +BASE_VERSION="7.0.2" echo "Base: ${BASE_VERSION}" POSTGRESQL_VERSIONS="14 15 16 17 18" diff --git a/overlay/etc/nu/scripts/bf-postgresql/db.nu b/overlay/etc/nu/scripts/bf-postgresql/db.nu index 13397d2..8519d9e 100644 --- a/overlay/etc/nu/scripts/bf-postgresql/db.nu +++ b/overlay/etc/nu/scripts/bf-postgresql/db.nu @@ -32,9 +32,9 @@ export def get_all []: nothing -> list { { ^pg psql -At -c $sql } | bf handle -d "Selecting PostgreSQL databases" db/get_all | lines | without_system } -# Split a comma-separated list of database names (e.g. BF_PG_DATABASE), removing spaces and empty names +# Split a list of database names (e.g. BF_PG_DATABASE) separated by commas and / or spaces, removing empty names export def names []: string -> list { - split row "," | str trim | where {|x| $x != "" } + split row --regex '[\s,]+' | where {|x| $x != "" } } # Remove system databases and empty values from a list of database names diff --git a/overlay/etc/nu/scripts/tests/db.nu b/overlay/etc/nu/scripts/tests/db.nu index c688e2a..669b013 100644 --- a/overlay/etc/nu/scripts/tests/db.nu +++ b/overlay/etc/nu/scripts/tests/db.nu @@ -11,6 +11,10 @@ export def names__splits_on_commas_and_removes_spaces [] { assert equal ["one" "two" "three"] ("one, two ,three" | db names) } +export def names__splits_on_spaces [] { + assert equal ["one" "two" "three"] ("one two three" | db names) +} + export def names__ignores_empty_names [] { assert equal ["one"] ("one,, ," | db names) assert equal [] ("" | db names)