1
0
mirror of https://github.com/docker-library/postgres.git synced 2025-11-10 04:42:21 +03: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
2025-05-30 14:09:41 -07:00
2025-05-30 14:09:41 -07:00
2025-05-30 14:09:41 -07:00
2025-05-30 14:09:41 -07:00
2025-05-30 14:09:41 -07:00
2024-06-03 13:57:56 -07:00
2014-09-04 17:43:59 -07:00
2018-07-30 09:15:32 -07:00
2024-11-21 10:50:21 -08:00
2025-06-04 15:38:23 -07:00

https://github.com/docker-library/postgres

Maintained by: the PostgreSQL Docker Community

This is the Git repo of the Docker "Official Image" for postgres (not to be confused with any official postgres image provided by postgres upstream). See the Docker Hub page for the full readme on how to use this Docker image and for information regarding contributing and issues.

The full image description on Docker Hub is generated/maintained over in the docker-library/docs repository, specifically in the postgres directory.

See a change merged here that doesn't show up on Docker Hub yet?

For more information about the full official images change lifecycle, see the "An image's source changed in Git, now what?" FAQ entry.

For outstanding postgres image PRs, check PRs with the "library/postgres" label on the official-images repository. For the current "source of truth" for postgres, see the library/postgres file in the official-images repository.

Description
Официальный образ Docker для Postgres
Readme MIT 176 MiB
Languages
Shell 56.5%
Dockerfile 43.5%