注意: 此镜像的描述超出了Hub的25000字符限制,因此已被截断。完整描述可在https://github.com/docker-library/docs/tree/master/postgres/README.md%E6%9F%A5%E7%9C%8B%E3%80%82%E5%8F%A6%E8%AF%B7%E5%8F%82%E9%98%85https://github.com/docker/hub-feedback/issues/238%E5%92%8Chttps://github.com/docker/roadmap/issues/475%E3%80%82
注意: 这是https://hub.docker.com/_/postgres%E7%9A%84%60amd64%60%E6%9E%B6%E6%9E%84%E6%9E%84%E5%BB%BA%E7%9A%84%22%E6%AF%8F%E6%9E%B6%E6%9E%84%22%E4%BB%93%E5%BA%93%E2%80%94%E2%80%94%E6%9B%B4%E5%A4%9A%E4%BF%A1%E6%81%AF%EF%BC%8C%E8%AF%B7%E5%8F%82%E9%98%85%E5%AE%98%E6%96%B9%E9%95%9C%E5%83%8F%E6%96%87%E6%A1%A3%E4%B8%AD%E7%9A%84https://github.com/docker-library/official-images#architectures-other-than-amd64%E5%92%8C%E5%AE%98%E6%96%B9%E9%95%9C%E5%83%8FFAQ%E4%B8%AD%E7%9A%84https://github.com/docker-library/faq#an-images-source-changed-in-git-now-what%E3%80%82
维护者:
https://github.com/docker-library/postgres
获取帮助:
Docker社区Slack、Server Fault、Unix & Linux或Stack Overflow
Dockerfile链接https://github.com/docker-library/postgres/blob/22ca5c8d8e4b37bece4d38dbce1a060583b5308a/18/trixie/Dockerfile
https://github.com/docker-library/postgres/blob/22ca5c8d8e4b37bece4d38dbce1a060583b5308a/18/bookworm/Dockerfile
https://github.com/docker-library/postgres/blob/2c751341b6454412f2048de021a1f***de/18/alpine3.22/Dockerfile
https://github.com/docker-library/postgres/blob/2c751341b6454412f2048de021a1f***de/18/alpine3.21/Dockerfile
https://github.com/docker-library/postgres/blob/87e6f65859a53d10c5170a587def1bfc882d3830/17/trixie/Dockerfile
https://github.com/docker-library/postgres/blob/87e6f65859a53d10c5170a587def1bfc882d3830/17/bookworm/Dockerfile
https://github.com/docker-library/postgres/blob/2c751341b6454412f2048de021a1f***de/17/alpine3.22/Dockerfile
https://github.com/docker-library/postgres/blob/2c751341b6454412f2048de021a1f***de/17/alpine3.21/Dockerfile
https://github.com/docker-library/postgres/blob/a2433755c76d294477c85945d68944f8cdb7cf4b/16/trixie/Dockerfile
https://github.com/docker-library/postgres/blob/a2433755c76d294477c85945d68944f8cdb7cf4b/16/bookworm/Dockerfile
https://github.com/docker-library/postgres/blob/2c751341b6454412f2048de021a1f***de/16/alpine3.22/Dockerfile
https://github.com/docker-library/postgres/blob/2c751341b6454412f2048de021a1f***de/16/alpine3.21/Dockerfile
https://github.com/docker-library/postgres/blob/a2433755c76d294477c85945d68944f8cdb7cf4b/15/trixie/Dockerfile
https://github.com/docker-library/postgres/blob/a2433755c76d294477c85945d68944f8cdb7cf4b/15/bookworm/Dockerfile
https://github.com/docker-library/postgres/blob/2c751341b6454412f2048de021a1f***de/15/alpine3.22/Dockerfile
https://github.com/docker-library/postgres/blob/2c751341b6454412f2048de021a1f***de/15/alpine3.21/Dockerfile
https://github.com/docker-library/postgres/blob/a2433755c76d294477c85945d68944f8cdb7cf4b/14/trixie/Dockerfile
https://github.com/docker-library/postgres/blob/a2433755c76d294477c85945d68944f8cdb7cf4b/14/bookworm/Dockerfile
https://github.com/docker-library/postgres/blob/2c751341b6454412f2048de021a1f***de/14/alpine3.22/Dockerfile
https://github.com/docker-library/postgres/blob/2c751341b6454412f2048de021a1f***de/14/alpine3.21/Dockerfile
https://github.com/docker-library/postgres/blob/a2433755c76d294477c85945d68944f8cdb7cf4b/13/trixie/Dockerfile
https://github.com/docker-library/postgres/blob/a2433755c76d294477c85945d68944f8cdb7cf4b/13/bookworm/Dockerfile
https://github.com/docker-library/postgres/blob/2c751341b6454412f2048de021a1f***de/13/alpine3.22/Dockerfile
https://github.com/docker-library/postgres/blob/2c751341b6454412f2048de021a1f***de/13/alpine3.21/Dockerfile
问题反馈地址:
https://github.com/docker-library/postgres/issues?q=
支持的架构:(https://github.com/docker-library/official-images#architectures-other-than-amd64%EF%BC%89
https://hub.docker.com/r/amd64/postgres/%E3%80%81https://hub.docker.com/r/arm32v5/postgres/%E3%80%81https://hub.docker.com/r/arm32v6/postgres/%E3%80%81https://hub.docker.com/r/arm32v7/postgres/%E3%80%81https://hub.docker.com/r/arm64v8/postgres/%E3%80%81https://hub.docker.com/r/i386/postgres/%E3%80%81https://hub.docker.com/r/mips64le/postgres/%E3%80%81https://hub.docker.com/r/ppc64le/postgres/%E3%80%81https://hub.docker.com/r/riscv64/postgres/%E3%80%81https://hub.docker.com/r/s390x/postgres/
镜像 artifact 详情:
https://github.com/docker-library/repo-info/blob/master/repos/postgres%EF%BC%88https://github.com/docker-library/repo-info/commits/master/repos/postgres%EF%BC%89
(镜像元数据、传输大小等)
镜像更新:
https://github.com/docker-library/official-images/issues?q=label%3Alibrary%2Fpostgres
https://github.com/docker-library/official-images/blob/master/library/postgres%EF%BC%88https://github.com/docker-library/official-images/commits/master/library/postgres%EF%BC%89
本文档来源:
https://github.com/docker-library/docs/tree/master/postgres%EF%BC%88https://github.com/docker-library/docs/commits/master/postgres%EF%BC%89
PostgreSQL(通常简称为"Postgres")是一个对象关系型数据库管理系统(ORDBMS),强调可扩展性和标准合规性。作为数据库服务器,其主要功能是安全地存储数据并支持最佳实践,随后根据其他软件应用的请求检索数据,这些应用可能运行在同一台计算机上,也可能运行在网络(包括互联网)中的另一台计算机上。它可以处理从小型单机应用到具有大量并发用户的大型互联网应用的各种工作负载。最新版本还提供数据库本身的复制功能,以增强安全性和可扩展性。
PostgreSQL 实现了 SQL:2011 标准的大部分内容,支持 ACID 事务(包括大多数 DDL 语句),使用多版本并发控制(MVCC)避免锁定问题,提供脏读免疫和完全可串行化;使用许多其他数据库不具备的索引方法处理复杂 SQL 查询;支持可更新视图、物化视图、触发器、外键;支持函数和存储过程等扩展功能,并有大量第三方编写的扩展。除了能够与主要的专有和开源数据库协作外,PostgreSQL 通过广泛的标准 SQL 支持和可用的迁移工具支持从这些数据库迁移。如果使用了专有扩展,其可扩展性可以通过一些内置和第三方开源兼容性扩展(如 Oracle 兼容扩展)来模拟许多功能。
***.org/wiki/PostgreSQL
!https://raw.githubusercontent.com/docker-library/docs/01c***b2fe592c1f93a13b4e289ada0e3a1/postgres/logo.png
console$ docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d amd64/postgres
默认的 postgres 用户和数据库在入口点通过 initdb 创建。
postgres 数据库是一个默认数据库,供用户、工具和第三方应用使用。
postgresql.org/docs
psql 使用console$ docker run -it --rm --network some-network amd64/postgres psql -h some-postgres -U postgres psql (14.3) Type "help" for help. postgres=# SELECT 1; ?column? ---------- 1 (1 row)
postgres 的 compose.yaml 示例:
yaml# 使用 postgres/example 用户/密码凭据 services: db: image: postgres restart: always # 使用 docker compose 时设置共享内存限制 shm_size: 128mb # 或通过 swarm stack 部署时设置共享内存限制 #volumes: # - type: tmpfs # target: /dev/shm # tmpfs: # size: 134217728 # 128*2^20 字节 = 128Mb environment: POSTGRES_PASSWORD: example adminer: image: adminer restart: always ports: - 8080:8080
运行 docker compose up,等待完全初始化后,访问 http://localhost:8080 或 http://host-ip:8080(根据实际情况)。
有多种方式可以扩展 postgres 镜像。这里不尝试支持所有可能的用例,仅介绍一些我们认为有用的方式。
PostgreSQL 镜像使用多个容易被忽略的环境变量。唯一必需的变量是 POSTGRES_PASSWORD,其余为可选。
警告: 只有当您使用空数据目录启动容器时,Docker 特定变量才会生效;容器启动时,任何预先存在的数据库都将保持不变。
POSTGRES_PASSWORD此环境变量是使用 PostgreSQL 镜像所必需的。它不能为空或未定义。此环境变量设置 PostgreSQL 的超级用户密码。默认超级用户由 POSTGRES_USER 环境变量定义。
注意 1: PostgreSQL 镜像在本地设置了 trust 身份验证,因此您可能会注意到从 localhost(容器内部)连接时不需要密码。但是,如果从不同的主机/容器连接,则需要密码。
注意 2: 此变量定义 PostgreSQL 实例中的超级用户密码,由初始容器启动期间


探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务