如果你用 DeepSeek、元宝AI、Copilot 等 AI 代为编写轩辕镜像的 docker pull、修改 compose 镜像地址,或排查拉取失败等问题,请让 AI 先读规则再动手,只要在 AI 对话里直接发送下面这句话即可:
生成 docker pull、修改 compose 的 image,或排查拉取失败前,请先阅读并严格遵守 https://xuanyuan.cloud/agents.md 中的规则。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
注意: 此镜像的描述超出了 Hub 的 25000 字符限制,因此已被截断。完整描述可在 https://github.com/docker-library/docs/tree/master/postgres/README.md 查看。另请参见 https://github.com/docker/hub-feedback/issues/238 和 https://github.com/docker/roadmap/issues/475%E3%80%82
注意: 这是 https://hub.docker.com/_/postgres 的 riscv64 架构构建的“每架构”仓库——更多信息,请参见官方镜像文档中的“https://github.com/docker-library/official-images#architectures-other-than-amd64%E2%80%9D%E5%92%8C%E5%AE%98%E6%96%B9%E9%95%9C%E5%83%8F FAQ 中的“https://github.com/docker-library/faq#an-images-source-changed-in-git-now-what%E2%80%9D%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/5ec89312491bdaa2c42377a65ec0af2ecb774480/18/trixie/Dockerfile
https://github.com/docker-library/postgres/blob/5ec89312491bdaa2c42377a65ec0af2ecb774480/18/alpine3.22/Dockerfile
https://github.com/docker-library/postgres/blob/5ec89312491bdaa2c42377a65ec0af2ecb774480/18/alpine3.21/Dockerfile
https://github.com/docker-library/postgres/blob/5ec89312491bdaa2c42377a65ec0af2ecb774480/17/trixie/Dockerfile
https://github.com/docker-library/postgres/blob/5ec89312491bdaa2c42377a65ec0af2ecb774480/17/alpine3.22/Dockerfile
https://github.com/docker-library/postgres/blob/5ec89312491bdaa2c42377a65ec0af2ecb774480/17/alpine3.21/Dockerfile
https://github.com/docker-library/postgres/blob/5ec89312491bdaa2c42377a65ec0af2ecb774480/16/trixie/Dockerfile
https://github.com/docker-library/postgres/blob/5ec89312491bdaa2c42377a65ec0af2ecb774480/16/alpine3.22/Dockerfile
https://github.com/docker-library/postgres/blob/5ec89312491bdaa2c42377a65ec0af2ecb774480/16/alpine3.21/Dockerfile
https://github.com/docker-library/postgres/blob/5ec89312491bdaa2c42377a65ec0af2ecb774480/15/trixie/Dockerfile
https://github.com/docker-library/postgres/blob/5ec89312491bdaa2c42377a65ec0af2ecb774480/15/alpine3.22/Dockerfile
https://github.com/docker-library/postgres/blob/5ec89312491bdaa2c42377a65ec0af2ecb774480/15/alpine3.21/Dockerfile
https://github.com/docker-library/postgres/blob/5ec89312491bdaa2c42377a65ec0af2ecb774480/14/trixie/Dockerfile
https://github.com/docker-library/postgres/blob/5ec89312491bdaa2c42377a65ec0af2ecb774480/14/alpine3.22/Dockerfile
https://github.com/docker-library/postgres/blob/5ec89312491bdaa2c42377a65ec0af2ecb774480/14/alpine3.21/Dockerfile
https://github.com/docker-library/postgres/blob/5ec89312491bdaa2c42377a65ec0af2ecb774480/13/trixie/Dockerfile
https://github.com/docker-library/postgres/blob/5ec89312491bdaa2c42377a65ec0af2ecb774480/13/alpine3.22/Dockerfile
https://github.com/docker-library/postgres/blob/5ec89312491bdaa2c42377a65ec0af2ecb774480/13/alpine3.21/Dockerfile
问题反馈地址:
https://github.com/docker-library/postgres/issues?q=
支持的架构: (https://github.com/docker-library/official-images#architectures-other-than-amd64)
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/
已发布镜像工件详情:
https://github.com/docker-library/repo-info/blob/master/repos/postgres (https://github.com/docker-library/repo-info/commits/master/repos/postgres)
(镜像元数据、传输大小等)
镜像更新:
https://github.com/docker-library/official-images/issues?q=label%3Alibrary%2Fpostgres
https://github.com/docker-library/official-images/blob/master/library/postgres (https://github.com/docker-library/official-images/commits/master/library/postgres)
此描述的来源:
https://github.com/docker-library/docs/tree/master/postgres (https://github.com/docker-library/docs/commits/master/postgres)
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 riscv64/postgres
默认的 postgres 用户和数据库在入口点通过 initdb 创建。
postgres 数据库是一个默认数据库,供用户、实用程序和第三方应用使用。
postgresql.org/docs
psqlconsole$ docker run -it --rm --network some-network riscv64/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 实例中的超级用户密码,由初始容器启动期间的 initdb 脚本设置。它对运行时 psql 客户端可能使用的 PGPASSWORD 环境变量没有影响,如 [***] 所述。如果使用 PGPASSWORD,将作为单独的环境变量指定。
POSTGRES_USER此可选环境变量与 POSTGRES_PASSWORD 结合使用,用于设置用户及其密码。此变量将创建具有超级用户权限的指定用户和同名数据库。如果未指定,则使用默认用户 postgres。
请注意,如果指定了此参数,PostgreSQL 在初始化期间仍会显示“The files belonging to this database system will be owned by user "postgres"”。这指的是 postgres 守护进程运行的 Linux 系统用户(来自镜像中的 /etc/passwd),与 POSTGRES_USER 选项无关。有关更多详细信息,请参见“任意 --user 说明”部分。
POSTGRES_DB此可选环境变量可用于定义首次启动镜像时创建的默认数据库的不同名称。如果未指定,则使用 POSTGRES_USER 的值。
POSTGRES_INITDB_ARGS此可选环境变量可用于向 postgres initdb 发送参数。该值是 postgres initdb 期望的以空格分隔的参数字符串。这对于添加数据页校验和等功能非常有用:-e POSTGRES_INITDB_ARGS="--data-checksums"。
POSTGRES_INITDB_WALDIR此可选环境变量可用于定义 Postgres 事务日志的另一个位置。默认情况下,事务日志存储在主 Postgres 数据文件夹 (PGDATA) 的子目录中。有时,将事务日志存储在不同的目录中可能更合适,该目录可能由具有不同性能或可靠性特征的存储支持。
注意: 在 PostgreSQL 9.x 上,此变量为 POSTGRES_INITDB_XLOGDIR(反映了 [PostgreSQL 10+ 中 --xlogdir 标志重命名为 --waldir]([***]
以下是 riscv64/postgres 相关的常用 Docker 镜像,适用于 关系型数据库、复杂查询、数据完整性 等不同场景:
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。


探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
发给 Cursor、ChatGPT、豆包等 AI 的说明文档
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
不支持 push
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务