PostgreSQL是一款开源的对象关系型数据库,它功能强大、稳定性高,广泛应用于各类企业级应用和数据管理场景,支持复杂查询、事务处理及高级数据类型,其长期版本由Canonical负责维护,为用户提供持续的技术支持与更新服务,确保数据库系统在长期使用中的可靠性与安全性,是全球众多开发者和企业信赖的主流数据库解决方案之一。
ubuntu/postgres is a rock for postgres maintained by https://canonical.com/.
PostgreSQL is a powerful, open source object-relational database system. It has more than 20 years of active development and a proven architecture that has earned it a strong reputation for reliability, data integrity, and correctness.
\https://www.postgresql.org/\]
Tags and Architectures
NOTE: These tags follow a specific naming convention that respects the concept of channels.
| Tags | Supported until | Version | Base | Architectures | |
|---|---|---|---|---|---|
14-22.04_beta | aliases14-22.04_edge, edge, latest | - | 14 | 22.04 | s390x, amd64, ppc64le, arm64 |
13-21.10_beta | aliases13-21.10_edge | - | 13 | 21.10 | amd64, s390x, arm64, ppc64le |
13-21.04_beta | aliases13-21.04_edge | - | 13 | 21.04 | s390x, ppc64le, amd64, arm64 |
12-20.04_beta | aliases12-20.04_edge | - | 12 | 20.04 | s390x, arm64, ppc64le, amd64 |
18-26.04_edge | aliases18-26.04_edge | 04/2031 | 18 | 26.04 | arm64, amd64 |
16-24.04_edge | aliases16-24.04_edge | 04/2029 | 16 | 24.04 | amd64, arm64 |
Get started
This rock's entrypoint is Pebble, a container-optimized init process that enables the orchestration of a collection of local service processes as an organized set.
\https://documentation.ubuntu.com/pebble/\]
Inspect
To view the https://documentation.ubuntu.com/rockcraft/en/latest/reference/rockcraft-yaml/#services and https://documentation.ubuntu.com/rockcraft/latest/reference/rockcraft-yaml/#checks defined in this rock:
shdocker run --rm ubuntu/postgres:14-22.04_beta plan
Run
To run this rock, use any of the usual container runtimes, for example, docker:
shdocker run --name postgres-container \ -d -e TZ=UTC -e POSTGRES_PASSWORD=My:S3cr3t -p 30432:5432 \ ubuntu/postgres:14-22.04_beta
Access your PostgreSQL server at localhost:30432.
Get logs
To view the logs of the running container, run:
shdocker exec postgres-container pebble logs
Or, for a specific service:
shdocker exec postgres-container pebble logs <service>
Monitor health checks
Rocks may have predefined health checks that you can list by running:
shdocker exec postgres-container pebble checks
The overall health of your container can be inspected via:
shdocker exec postgres-container pebble health
Configuration
Environment variables
| Option | Description | Default |
|---|---|---|
| TZ | Timezone. | UTC |
| POSTGRES_PASSWORD | Set the password for the superuser (postgres by default). This option is mandatory and must not be empty. Required to connect from external hosts, e.g., my_secret_password. | None |
| POSTGRES_USER | Create a new user with superuser privileges, e.g., john. Used in conjunction with POSTGRES_PASSWORD. | None |
| POSTGRES_DB | Set the name of the default database, e.g., db_test. | None |
| POSTGRES_INITDB_ARGS | Pass arguments to the postgres initdb call, e.g., --data-checksums. | None |
| POSTGRES_INITDB_WALDIR | Set the location of the Postgres transaction log. By default it is stored in a subdirectory of the main Postgres data folder (PGDATA). | None |
| POSTGRES_HOST_AUTH_METHOD | Set the auth-method for host connections for all databases, all users, and all addresses. The following will be added to the pg_hba.conf if this option is passed 'host all all all $POSTGRES_HOST_AUTH_METHOD'. | None |
| PGDATA | Set the location of the database files. | /var/lib/postgresql/data |
Volumes
| Option | Description | Default |
|---|---|---|
-v <path>:/etc/postgresql/postgresql.conf | Local configuration file postgresql.conf. | None |
-v <path>:/var/lib/postgresql/data | Persist data instead of initializing a new database every time you launch a new container. | None |
Ports
| Option | Description | Default |
|---|---|---|
-p <port>:5432 | Expose the container's port 5432 on the host's <port>. | None |
\https://github.com/canonical/postgresql-rock/issues\] \https://github.com/canonical/postgresql-rock\]
Canonical is the provider of this container image. It is the user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within, as well as with https://canonical.com/legal/intellectual-property-policy.
ubuntu 命名空间的其他可用镜像:
镜像拉取方式
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
DockerHub 原生拉取命令
用户好评
来自真实用户的反馈,见证轩辕镜像的优质服务