diff --git a/13/alpine3.21/docker-entrypoint.sh b/13/alpine3.21/docker-entrypoint.sh index 5a62870b50..785d0ff6d4 100755 --- a/13/alpine3.21/docker-entrypoint.sh +++ b/13/alpine3.21/docker-entrypoint.sh @@ -168,8 +168,14 @@ docker_error_old_databases() { Counter to that, there appears to be PostgreSQL data in: ${OLD_DATABASES[*]} - This is usually the result of upgrading the Docker image without upgrading - the underlying database using "pg_upgrade" (which requires both versions). + This is usually the result of upgrading the Docker image without + upgrading the underlying database using "pg_upgrade" (which requires both + versions). + + The suggested container configuration for 18+ is to place a single mount + at /var/lib/postgresql which will then place PostgreSQL data in a + subdirectory, allowing usage of "pg_upgrade --link" without mount point + boundary issues. See https://github.com/docker-library/postgres/issues/37 for a (long) discussion around this process, and suggestions for how to do so. @@ -264,6 +270,9 @@ docker_setup_env() { OLD_DATABASES+=( "$d" ) fi done + if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then + OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' ) + fi fi } diff --git a/13/alpine3.22/docker-entrypoint.sh b/13/alpine3.22/docker-entrypoint.sh index 5a62870b50..785d0ff6d4 100755 --- a/13/alpine3.22/docker-entrypoint.sh +++ b/13/alpine3.22/docker-entrypoint.sh @@ -168,8 +168,14 @@ docker_error_old_databases() { Counter to that, there appears to be PostgreSQL data in: ${OLD_DATABASES[*]} - This is usually the result of upgrading the Docker image without upgrading - the underlying database using "pg_upgrade" (which requires both versions). + This is usually the result of upgrading the Docker image without + upgrading the underlying database using "pg_upgrade" (which requires both + versions). + + The suggested container configuration for 18+ is to place a single mount + at /var/lib/postgresql which will then place PostgreSQL data in a + subdirectory, allowing usage of "pg_upgrade --link" without mount point + boundary issues. See https://github.com/docker-library/postgres/issues/37 for a (long) discussion around this process, and suggestions for how to do so. @@ -264,6 +270,9 @@ docker_setup_env() { OLD_DATABASES+=( "$d" ) fi done + if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then + OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' ) + fi fi } diff --git a/13/bookworm/docker-entrypoint.sh b/13/bookworm/docker-entrypoint.sh index 5a62870b50..785d0ff6d4 100755 --- a/13/bookworm/docker-entrypoint.sh +++ b/13/bookworm/docker-entrypoint.sh @@ -168,8 +168,14 @@ docker_error_old_databases() { Counter to that, there appears to be PostgreSQL data in: ${OLD_DATABASES[*]} - This is usually the result of upgrading the Docker image without upgrading - the underlying database using "pg_upgrade" (which requires both versions). + This is usually the result of upgrading the Docker image without + upgrading the underlying database using "pg_upgrade" (which requires both + versions). + + The suggested container configuration for 18+ is to place a single mount + at /var/lib/postgresql which will then place PostgreSQL data in a + subdirectory, allowing usage of "pg_upgrade --link" without mount point + boundary issues. See https://github.com/docker-library/postgres/issues/37 for a (long) discussion around this process, and suggestions for how to do so. @@ -264,6 +270,9 @@ docker_setup_env() { OLD_DATABASES+=( "$d" ) fi done + if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then + OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' ) + fi fi } diff --git a/13/trixie/docker-entrypoint.sh b/13/trixie/docker-entrypoint.sh index 5a62870b50..785d0ff6d4 100755 --- a/13/trixie/docker-entrypoint.sh +++ b/13/trixie/docker-entrypoint.sh @@ -168,8 +168,14 @@ docker_error_old_databases() { Counter to that, there appears to be PostgreSQL data in: ${OLD_DATABASES[*]} - This is usually the result of upgrading the Docker image without upgrading - the underlying database using "pg_upgrade" (which requires both versions). + This is usually the result of upgrading the Docker image without + upgrading the underlying database using "pg_upgrade" (which requires both + versions). + + The suggested container configuration for 18+ is to place a single mount + at /var/lib/postgresql which will then place PostgreSQL data in a + subdirectory, allowing usage of "pg_upgrade --link" without mount point + boundary issues. See https://github.com/docker-library/postgres/issues/37 for a (long) discussion around this process, and suggestions for how to do so. @@ -264,6 +270,9 @@ docker_setup_env() { OLD_DATABASES+=( "$d" ) fi done + if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then + OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' ) + fi fi } diff --git a/14/alpine3.21/docker-entrypoint.sh b/14/alpine3.21/docker-entrypoint.sh index 5a62870b50..785d0ff6d4 100755 --- a/14/alpine3.21/docker-entrypoint.sh +++ b/14/alpine3.21/docker-entrypoint.sh @@ -168,8 +168,14 @@ docker_error_old_databases() { Counter to that, there appears to be PostgreSQL data in: ${OLD_DATABASES[*]} - This is usually the result of upgrading the Docker image without upgrading - the underlying database using "pg_upgrade" (which requires both versions). + This is usually the result of upgrading the Docker image without + upgrading the underlying database using "pg_upgrade" (which requires both + versions). + + The suggested container configuration for 18+ is to place a single mount + at /var/lib/postgresql which will then place PostgreSQL data in a + subdirectory, allowing usage of "pg_upgrade --link" without mount point + boundary issues. See https://github.com/docker-library/postgres/issues/37 for a (long) discussion around this process, and suggestions for how to do so. @@ -264,6 +270,9 @@ docker_setup_env() { OLD_DATABASES+=( "$d" ) fi done + if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then + OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' ) + fi fi } diff --git a/14/alpine3.22/docker-entrypoint.sh b/14/alpine3.22/docker-entrypoint.sh index 5a62870b50..785d0ff6d4 100755 --- a/14/alpine3.22/docker-entrypoint.sh +++ b/14/alpine3.22/docker-entrypoint.sh @@ -168,8 +168,14 @@ docker_error_old_databases() { Counter to that, there appears to be PostgreSQL data in: ${OLD_DATABASES[*]} - This is usually the result of upgrading the Docker image without upgrading - the underlying database using "pg_upgrade" (which requires both versions). + This is usually the result of upgrading the Docker image without + upgrading the underlying database using "pg_upgrade" (which requires both + versions). + + The suggested container configuration for 18+ is to place a single mount + at /var/lib/postgresql which will then place PostgreSQL data in a + subdirectory, allowing usage of "pg_upgrade --link" without mount point + boundary issues. See https://github.com/docker-library/postgres/issues/37 for a (long) discussion around this process, and suggestions for how to do so. @@ -264,6 +270,9 @@ docker_setup_env() { OLD_DATABASES+=( "$d" ) fi done + if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then + OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' ) + fi fi } diff --git a/14/bookworm/docker-entrypoint.sh b/14/bookworm/docker-entrypoint.sh index 5a62870b50..785d0ff6d4 100755 --- a/14/bookworm/docker-entrypoint.sh +++ b/14/bookworm/docker-entrypoint.sh @@ -168,8 +168,14 @@ docker_error_old_databases() { Counter to that, there appears to be PostgreSQL data in: ${OLD_DATABASES[*]} - This is usually the result of upgrading the Docker image without upgrading - the underlying database using "pg_upgrade" (which requires both versions). + This is usually the result of upgrading the Docker image without + upgrading the underlying database using "pg_upgrade" (which requires both + versions). + + The suggested container configuration for 18+ is to place a single mount + at /var/lib/postgresql which will then place PostgreSQL data in a + subdirectory, allowing usage of "pg_upgrade --link" without mount point + boundary issues. See https://github.com/docker-library/postgres/issues/37 for a (long) discussion around this process, and suggestions for how to do so. @@ -264,6 +270,9 @@ docker_setup_env() { OLD_DATABASES+=( "$d" ) fi done + if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then + OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' ) + fi fi } diff --git a/14/trixie/docker-entrypoint.sh b/14/trixie/docker-entrypoint.sh index 5a62870b50..785d0ff6d4 100755 --- a/14/trixie/docker-entrypoint.sh +++ b/14/trixie/docker-entrypoint.sh @@ -168,8 +168,14 @@ docker_error_old_databases() { Counter to that, there appears to be PostgreSQL data in: ${OLD_DATABASES[*]} - This is usually the result of upgrading the Docker image without upgrading - the underlying database using "pg_upgrade" (which requires both versions). + This is usually the result of upgrading the Docker image without + upgrading the underlying database using "pg_upgrade" (which requires both + versions). + + The suggested container configuration for 18+ is to place a single mount + at /var/lib/postgresql which will then place PostgreSQL data in a + subdirectory, allowing usage of "pg_upgrade --link" without mount point + boundary issues. See https://github.com/docker-library/postgres/issues/37 for a (long) discussion around this process, and suggestions for how to do so. @@ -264,6 +270,9 @@ docker_setup_env() { OLD_DATABASES+=( "$d" ) fi done + if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then + OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' ) + fi fi } diff --git a/15/alpine3.21/docker-entrypoint.sh b/15/alpine3.21/docker-entrypoint.sh index 5a62870b50..785d0ff6d4 100755 --- a/15/alpine3.21/docker-entrypoint.sh +++ b/15/alpine3.21/docker-entrypoint.sh @@ -168,8 +168,14 @@ docker_error_old_databases() { Counter to that, there appears to be PostgreSQL data in: ${OLD_DATABASES[*]} - This is usually the result of upgrading the Docker image without upgrading - the underlying database using "pg_upgrade" (which requires both versions). + This is usually the result of upgrading the Docker image without + upgrading the underlying database using "pg_upgrade" (which requires both + versions). + + The suggested container configuration for 18+ is to place a single mount + at /var/lib/postgresql which will then place PostgreSQL data in a + subdirectory, allowing usage of "pg_upgrade --link" without mount point + boundary issues. See https://github.com/docker-library/postgres/issues/37 for a (long) discussion around this process, and suggestions for how to do so. @@ -264,6 +270,9 @@ docker_setup_env() { OLD_DATABASES+=( "$d" ) fi done + if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then + OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' ) + fi fi } diff --git a/15/alpine3.22/docker-entrypoint.sh b/15/alpine3.22/docker-entrypoint.sh index 5a62870b50..785d0ff6d4 100755 --- a/15/alpine3.22/docker-entrypoint.sh +++ b/15/alpine3.22/docker-entrypoint.sh @@ -168,8 +168,14 @@ docker_error_old_databases() { Counter to that, there appears to be PostgreSQL data in: ${OLD_DATABASES[*]} - This is usually the result of upgrading the Docker image without upgrading - the underlying database using "pg_upgrade" (which requires both versions). + This is usually the result of upgrading the Docker image without + upgrading the underlying database using "pg_upgrade" (which requires both + versions). + + The suggested container configuration for 18+ is to place a single mount + at /var/lib/postgresql which will then place PostgreSQL data in a + subdirectory, allowing usage of "pg_upgrade --link" without mount point + boundary issues. See https://github.com/docker-library/postgres/issues/37 for a (long) discussion around this process, and suggestions for how to do so. @@ -264,6 +270,9 @@ docker_setup_env() { OLD_DATABASES+=( "$d" ) fi done + if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then + OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' ) + fi fi } diff --git a/15/bookworm/docker-entrypoint.sh b/15/bookworm/docker-entrypoint.sh index 5a62870b50..785d0ff6d4 100755 --- a/15/bookworm/docker-entrypoint.sh +++ b/15/bookworm/docker-entrypoint.sh @@ -168,8 +168,14 @@ docker_error_old_databases() { Counter to that, there appears to be PostgreSQL data in: ${OLD_DATABASES[*]} - This is usually the result of upgrading the Docker image without upgrading - the underlying database using "pg_upgrade" (which requires both versions). + This is usually the result of upgrading the Docker image without + upgrading the underlying database using "pg_upgrade" (which requires both + versions). + + The suggested container configuration for 18+ is to place a single mount + at /var/lib/postgresql which will then place PostgreSQL data in a + subdirectory, allowing usage of "pg_upgrade --link" without mount point + boundary issues. See https://github.com/docker-library/postgres/issues/37 for a (long) discussion around this process, and suggestions for how to do so. @@ -264,6 +270,9 @@ docker_setup_env() { OLD_DATABASES+=( "$d" ) fi done + if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then + OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' ) + fi fi } diff --git a/15/trixie/docker-entrypoint.sh b/15/trixie/docker-entrypoint.sh index 5a62870b50..785d0ff6d4 100755 --- a/15/trixie/docker-entrypoint.sh +++ b/15/trixie/docker-entrypoint.sh @@ -168,8 +168,14 @@ docker_error_old_databases() { Counter to that, there appears to be PostgreSQL data in: ${OLD_DATABASES[*]} - This is usually the result of upgrading the Docker image without upgrading - the underlying database using "pg_upgrade" (which requires both versions). + This is usually the result of upgrading the Docker image without + upgrading the underlying database using "pg_upgrade" (which requires both + versions). + + The suggested container configuration for 18+ is to place a single mount + at /var/lib/postgresql which will then place PostgreSQL data in a + subdirectory, allowing usage of "pg_upgrade --link" without mount point + boundary issues. See https://github.com/docker-library/postgres/issues/37 for a (long) discussion around this process, and suggestions for how to do so. @@ -264,6 +270,9 @@ docker_setup_env() { OLD_DATABASES+=( "$d" ) fi done + if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then + OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' ) + fi fi } diff --git a/16/alpine3.21/docker-entrypoint.sh b/16/alpine3.21/docker-entrypoint.sh index 5a62870b50..785d0ff6d4 100755 --- a/16/alpine3.21/docker-entrypoint.sh +++ b/16/alpine3.21/docker-entrypoint.sh @@ -168,8 +168,14 @@ docker_error_old_databases() { Counter to that, there appears to be PostgreSQL data in: ${OLD_DATABASES[*]} - This is usually the result of upgrading the Docker image without upgrading - the underlying database using "pg_upgrade" (which requires both versions). + This is usually the result of upgrading the Docker image without + upgrading the underlying database using "pg_upgrade" (which requires both + versions). + + The suggested container configuration for 18+ is to place a single mount + at /var/lib/postgresql which will then place PostgreSQL data in a + subdirectory, allowing usage of "pg_upgrade --link" without mount point + boundary issues. See https://github.com/docker-library/postgres/issues/37 for a (long) discussion around this process, and suggestions for how to do so. @@ -264,6 +270,9 @@ docker_setup_env() { OLD_DATABASES+=( "$d" ) fi done + if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then + OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' ) + fi fi } diff --git a/16/alpine3.22/docker-entrypoint.sh b/16/alpine3.22/docker-entrypoint.sh index 5a62870b50..785d0ff6d4 100755 --- a/16/alpine3.22/docker-entrypoint.sh +++ b/16/alpine3.22/docker-entrypoint.sh @@ -168,8 +168,14 @@ docker_error_old_databases() { Counter to that, there appears to be PostgreSQL data in: ${OLD_DATABASES[*]} - This is usually the result of upgrading the Docker image without upgrading - the underlying database using "pg_upgrade" (which requires both versions). + This is usually the result of upgrading the Docker image without + upgrading the underlying database using "pg_upgrade" (which requires both + versions). + + The suggested container configuration for 18+ is to place a single mount + at /var/lib/postgresql which will then place PostgreSQL data in a + subdirectory, allowing usage of "pg_upgrade --link" without mount point + boundary issues. See https://github.com/docker-library/postgres/issues/37 for a (long) discussion around this process, and suggestions for how to do so. @@ -264,6 +270,9 @@ docker_setup_env() { OLD_DATABASES+=( "$d" ) fi done + if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then + OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' ) + fi fi } diff --git a/16/bookworm/docker-entrypoint.sh b/16/bookworm/docker-entrypoint.sh index 5a62870b50..785d0ff6d4 100755 --- a/16/bookworm/docker-entrypoint.sh +++ b/16/bookworm/docker-entrypoint.sh @@ -168,8 +168,14 @@ docker_error_old_databases() { Counter to that, there appears to be PostgreSQL data in: ${OLD_DATABASES[*]} - This is usually the result of upgrading the Docker image without upgrading - the underlying database using "pg_upgrade" (which requires both versions). + This is usually the result of upgrading the Docker image without + upgrading the underlying database using "pg_upgrade" (which requires both + versions). + + The suggested container configuration for 18+ is to place a single mount + at /var/lib/postgresql which will then place PostgreSQL data in a + subdirectory, allowing usage of "pg_upgrade --link" without mount point + boundary issues. See https://github.com/docker-library/postgres/issues/37 for a (long) discussion around this process, and suggestions for how to do so. @@ -264,6 +270,9 @@ docker_setup_env() { OLD_DATABASES+=( "$d" ) fi done + if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then + OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' ) + fi fi } diff --git a/16/trixie/docker-entrypoint.sh b/16/trixie/docker-entrypoint.sh index 5a62870b50..785d0ff6d4 100755 --- a/16/trixie/docker-entrypoint.sh +++ b/16/trixie/docker-entrypoint.sh @@ -168,8 +168,14 @@ docker_error_old_databases() { Counter to that, there appears to be PostgreSQL data in: ${OLD_DATABASES[*]} - This is usually the result of upgrading the Docker image without upgrading - the underlying database using "pg_upgrade" (which requires both versions). + This is usually the result of upgrading the Docker image without + upgrading the underlying database using "pg_upgrade" (which requires both + versions). + + The suggested container configuration for 18+ is to place a single mount + at /var/lib/postgresql which will then place PostgreSQL data in a + subdirectory, allowing usage of "pg_upgrade --link" without mount point + boundary issues. See https://github.com/docker-library/postgres/issues/37 for a (long) discussion around this process, and suggestions for how to do so. @@ -264,6 +270,9 @@ docker_setup_env() { OLD_DATABASES+=( "$d" ) fi done + if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then + OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' ) + fi fi } diff --git a/17/alpine3.21/docker-entrypoint.sh b/17/alpine3.21/docker-entrypoint.sh index 5a62870b50..785d0ff6d4 100755 --- a/17/alpine3.21/docker-entrypoint.sh +++ b/17/alpine3.21/docker-entrypoint.sh @@ -168,8 +168,14 @@ docker_error_old_databases() { Counter to that, there appears to be PostgreSQL data in: ${OLD_DATABASES[*]} - This is usually the result of upgrading the Docker image without upgrading - the underlying database using "pg_upgrade" (which requires both versions). + This is usually the result of upgrading the Docker image without + upgrading the underlying database using "pg_upgrade" (which requires both + versions). + + The suggested container configuration for 18+ is to place a single mount + at /var/lib/postgresql which will then place PostgreSQL data in a + subdirectory, allowing usage of "pg_upgrade --link" without mount point + boundary issues. See https://github.com/docker-library/postgres/issues/37 for a (long) discussion around this process, and suggestions for how to do so. @@ -264,6 +270,9 @@ docker_setup_env() { OLD_DATABASES+=( "$d" ) fi done + if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then + OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' ) + fi fi } diff --git a/17/alpine3.22/docker-entrypoint.sh b/17/alpine3.22/docker-entrypoint.sh index 5a62870b50..785d0ff6d4 100755 --- a/17/alpine3.22/docker-entrypoint.sh +++ b/17/alpine3.22/docker-entrypoint.sh @@ -168,8 +168,14 @@ docker_error_old_databases() { Counter to that, there appears to be PostgreSQL data in: ${OLD_DATABASES[*]} - This is usually the result of upgrading the Docker image without upgrading - the underlying database using "pg_upgrade" (which requires both versions). + This is usually the result of upgrading the Docker image without + upgrading the underlying database using "pg_upgrade" (which requires both + versions). + + The suggested container configuration for 18+ is to place a single mount + at /var/lib/postgresql which will then place PostgreSQL data in a + subdirectory, allowing usage of "pg_upgrade --link" without mount point + boundary issues. See https://github.com/docker-library/postgres/issues/37 for a (long) discussion around this process, and suggestions for how to do so. @@ -264,6 +270,9 @@ docker_setup_env() { OLD_DATABASES+=( "$d" ) fi done + if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then + OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' ) + fi fi } diff --git a/17/bookworm/docker-entrypoint.sh b/17/bookworm/docker-entrypoint.sh index 5a62870b50..785d0ff6d4 100755 --- a/17/bookworm/docker-entrypoint.sh +++ b/17/bookworm/docker-entrypoint.sh @@ -168,8 +168,14 @@ docker_error_old_databases() { Counter to that, there appears to be PostgreSQL data in: ${OLD_DATABASES[*]} - This is usually the result of upgrading the Docker image without upgrading - the underlying database using "pg_upgrade" (which requires both versions). + This is usually the result of upgrading the Docker image without + upgrading the underlying database using "pg_upgrade" (which requires both + versions). + + The suggested container configuration for 18+ is to place a single mount + at /var/lib/postgresql which will then place PostgreSQL data in a + subdirectory, allowing usage of "pg_upgrade --link" without mount point + boundary issues. See https://github.com/docker-library/postgres/issues/37 for a (long) discussion around this process, and suggestions for how to do so. @@ -264,6 +270,9 @@ docker_setup_env() { OLD_DATABASES+=( "$d" ) fi done + if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then + OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' ) + fi fi } diff --git a/17/trixie/docker-entrypoint.sh b/17/trixie/docker-entrypoint.sh index 5a62870b50..785d0ff6d4 100755 --- a/17/trixie/docker-entrypoint.sh +++ b/17/trixie/docker-entrypoint.sh @@ -168,8 +168,14 @@ docker_error_old_databases() { Counter to that, there appears to be PostgreSQL data in: ${OLD_DATABASES[*]} - This is usually the result of upgrading the Docker image without upgrading - the underlying database using "pg_upgrade" (which requires both versions). + This is usually the result of upgrading the Docker image without + upgrading the underlying database using "pg_upgrade" (which requires both + versions). + + The suggested container configuration for 18+ is to place a single mount + at /var/lib/postgresql which will then place PostgreSQL data in a + subdirectory, allowing usage of "pg_upgrade --link" without mount point + boundary issues. See https://github.com/docker-library/postgres/issues/37 for a (long) discussion around this process, and suggestions for how to do so. @@ -264,6 +270,9 @@ docker_setup_env() { OLD_DATABASES+=( "$d" ) fi done + if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then + OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' ) + fi fi } diff --git a/18/alpine3.21/docker-entrypoint.sh b/18/alpine3.21/docker-entrypoint.sh index 5a62870b50..785d0ff6d4 100755 --- a/18/alpine3.21/docker-entrypoint.sh +++ b/18/alpine3.21/docker-entrypoint.sh @@ -168,8 +168,14 @@ docker_error_old_databases() { Counter to that, there appears to be PostgreSQL data in: ${OLD_DATABASES[*]} - This is usually the result of upgrading the Docker image without upgrading - the underlying database using "pg_upgrade" (which requires both versions). + This is usually the result of upgrading the Docker image without + upgrading the underlying database using "pg_upgrade" (which requires both + versions). + + The suggested container configuration for 18+ is to place a single mount + at /var/lib/postgresql which will then place PostgreSQL data in a + subdirectory, allowing usage of "pg_upgrade --link" without mount point + boundary issues. See https://github.com/docker-library/postgres/issues/37 for a (long) discussion around this process, and suggestions for how to do so. @@ -264,6 +270,9 @@ docker_setup_env() { OLD_DATABASES+=( "$d" ) fi done + if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then + OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' ) + fi fi } diff --git a/18/alpine3.22/docker-entrypoint.sh b/18/alpine3.22/docker-entrypoint.sh index 5a62870b50..785d0ff6d4 100755 --- a/18/alpine3.22/docker-entrypoint.sh +++ b/18/alpine3.22/docker-entrypoint.sh @@ -168,8 +168,14 @@ docker_error_old_databases() { Counter to that, there appears to be PostgreSQL data in: ${OLD_DATABASES[*]} - This is usually the result of upgrading the Docker image without upgrading - the underlying database using "pg_upgrade" (which requires both versions). + This is usually the result of upgrading the Docker image without + upgrading the underlying database using "pg_upgrade" (which requires both + versions). + + The suggested container configuration for 18+ is to place a single mount + at /var/lib/postgresql which will then place PostgreSQL data in a + subdirectory, allowing usage of "pg_upgrade --link" without mount point + boundary issues. See https://github.com/docker-library/postgres/issues/37 for a (long) discussion around this process, and suggestions for how to do so. @@ -264,6 +270,9 @@ docker_setup_env() { OLD_DATABASES+=( "$d" ) fi done + if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then + OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' ) + fi fi } diff --git a/18/bookworm/Dockerfile b/18/bookworm/Dockerfile index ba1bbe9fa7..12fdb0c3a9 100644 --- a/18/bookworm/Dockerfile +++ b/18/bookworm/Dockerfile @@ -189,7 +189,6 @@ RUN install --verbose --directory --owner postgres --group postgres --mode 3777 # NOTE: in 18+, PGDATA has changed to match the pg_ctlcluster standard directory structure, and the VOLUME has moved from /var/lib/postgresql/data to /var/lib/postgresql # ENV PGDATA /var/lib/postgresql/18/docker -RUN ln -svT . /var/lib/postgresql/data # https://github.com/docker-library/postgres/pull/1259#issuecomment-2215477494 VOLUME /var/lib/postgresql # ("/var/lib/postgresql" is already pre-created with suitably usable permissions above) diff --git a/18/bookworm/docker-entrypoint.sh b/18/bookworm/docker-entrypoint.sh index 5a62870b50..785d0ff6d4 100755 --- a/18/bookworm/docker-entrypoint.sh +++ b/18/bookworm/docker-entrypoint.sh @@ -168,8 +168,14 @@ docker_error_old_databases() { Counter to that, there appears to be PostgreSQL data in: ${OLD_DATABASES[*]} - This is usually the result of upgrading the Docker image without upgrading - the underlying database using "pg_upgrade" (which requires both versions). + This is usually the result of upgrading the Docker image without + upgrading the underlying database using "pg_upgrade" (which requires both + versions). + + The suggested container configuration for 18+ is to place a single mount + at /var/lib/postgresql which will then place PostgreSQL data in a + subdirectory, allowing usage of "pg_upgrade --link" without mount point + boundary issues. See https://github.com/docker-library/postgres/issues/37 for a (long) discussion around this process, and suggestions for how to do so. @@ -264,6 +270,9 @@ docker_setup_env() { OLD_DATABASES+=( "$d" ) fi done + if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then + OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' ) + fi fi } diff --git a/18/trixie/Dockerfile b/18/trixie/Dockerfile index 7c5ef69f35..6868de2d35 100644 --- a/18/trixie/Dockerfile +++ b/18/trixie/Dockerfile @@ -189,7 +189,6 @@ RUN install --verbose --directory --owner postgres --group postgres --mode 3777 # NOTE: in 18+, PGDATA has changed to match the pg_ctlcluster standard directory structure, and the VOLUME has moved from /var/lib/postgresql/data to /var/lib/postgresql # ENV PGDATA /var/lib/postgresql/18/docker -RUN ln -svT . /var/lib/postgresql/data # https://github.com/docker-library/postgres/pull/1259#issuecomment-2215477494 VOLUME /var/lib/postgresql # ("/var/lib/postgresql" is already pre-created with suitably usable permissions above) diff --git a/18/trixie/docker-entrypoint.sh b/18/trixie/docker-entrypoint.sh index 5a62870b50..785d0ff6d4 100755 --- a/18/trixie/docker-entrypoint.sh +++ b/18/trixie/docker-entrypoint.sh @@ -168,8 +168,14 @@ docker_error_old_databases() { Counter to that, there appears to be PostgreSQL data in: ${OLD_DATABASES[*]} - This is usually the result of upgrading the Docker image without upgrading - the underlying database using "pg_upgrade" (which requires both versions). + This is usually the result of upgrading the Docker image without + upgrading the underlying database using "pg_upgrade" (which requires both + versions). + + The suggested container configuration for 18+ is to place a single mount + at /var/lib/postgresql which will then place PostgreSQL data in a + subdirectory, allowing usage of "pg_upgrade --link" without mount point + boundary issues. See https://github.com/docker-library/postgres/issues/37 for a (long) discussion around this process, and suggestions for how to do so. @@ -264,6 +270,9 @@ docker_setup_env() { OLD_DATABASES+=( "$d" ) fi done + if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then + OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' ) + fi fi } diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index dded17e0d6..764166cd3d 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -190,7 +190,6 @@ RUN install --verbose --directory --owner postgres --group postgres --mode 3777 # NOTE: in 18+, PGDATA has changed to match the pg_ctlcluster standard directory structure, and the VOLUME has moved from /var/lib/postgresql/data to /var/lib/postgresql # ENV PGDATA /var/lib/postgresql/{{ .major | tostring }}/docker -RUN ln -svT . /var/lib/postgresql/data # https://github.com/docker-library/postgres/pull/1259#issuecomment-2215477494 VOLUME /var/lib/postgresql # ("/var/lib/postgresql" is already pre-created with suitably usable permissions above) {{ ) else ( -}} diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 5a62870b50..785d0ff6d4 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -168,8 +168,14 @@ docker_error_old_databases() { Counter to that, there appears to be PostgreSQL data in: ${OLD_DATABASES[*]} - This is usually the result of upgrading the Docker image without upgrading - the underlying database using "pg_upgrade" (which requires both versions). + This is usually the result of upgrading the Docker image without + upgrading the underlying database using "pg_upgrade" (which requires both + versions). + + The suggested container configuration for 18+ is to place a single mount + at /var/lib/postgresql which will then place PostgreSQL data in a + subdirectory, allowing usage of "pg_upgrade --link" without mount point + boundary issues. See https://github.com/docker-library/postgres/issues/37 for a (long) discussion around this process, and suggestions for how to do so. @@ -264,6 +270,9 @@ docker_setup_env() { OLD_DATABASES+=( "$d" ) fi done + if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then + OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' ) + fi fi }