
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
This image builds upon the stock https://hub.docker.com/postgis/postgis/ and adds https://github.com/wal-g/wal-g and https://github.com/pgbouncer/pgbouncer
Only PostgreSQL 12 and greater will be supported. This is due to the removal of recovery.conf with respective config parameters added to postgresql.conf and use the use of standby.signal.
POSTGRES_RESTORE (default is an empty string) if value is set (not empty string), container is instructed to to download the latest base backup with WAL-G$PGDATA/standby.signal exists. This signals that this PostgreSQL instance is a standby serverPOSTGRES_PRIMARY_CONNINFO (default is an empty string) a valid PostgreSQL connection string https://www.postgresql.org/docs/12/libpq-connect.html#LIBPQ-CONNSTRING. Must be provided if POSTGRES_IS_STANDBY is set so that standby PostgreSQL instance can connect to master (or upstream) PostgreSQL instancePGBOUNCER_LOGFILE (default /var/log/postgresql/pgbouncer.log) path to pgBouncer log filePGBOUNCER_PIDFILE (default /var/run/postgresql/pgbouncer.pid) path to pgBouncer pid filePGBOUNCER_LISTEN_ADDR (default *) IP address to listen onPGBOUNCER_LISTEN_PORT (default 6432) IP Port to listen onPGBOUNCER_CLIENT_TLS_SSLMODE (default allow) allow clients to use SSL when connecting to pgBouncer?PGBOUNCER_CLIENT_TLS_KEY_FILE (default /etc/ssl/private/pgplus.key autogenerated per container creation) SSL private key to use when interacting with clientsPGBOUNCER_CLIENT_TLS_CERT_FILE (default /etc/ssl/certs/pgplus.pem autogenerated per container creation) SSL certificate to provide to clientsPGBOUNCER_SERVER_TLS_SSLMODE (default allow) allow connections to PostgreSQL server to use SSL?PGBOUNCER_AUTH_TYPE (default md5) authentication typePGBOUNCER_POOL_MODE (default session) connection pooling modePGBOUNCER_MAX_CLIENT_CONN (default 100) maximum number of client connectionsPGBOUNCER_DEFAULT_POOL_SIZE (default 20) default number of client connections per poolPGBOUNCER_MIN_POOL_SIZE (default 0) minimum number of client connections per poolPGBOUNCER_RESERVE_POOL_SIZE (default 0) number of connections in the reserve poolPGBOUNCER_RESERVE_POOL_TIMEOUT (default 5) number of seconds where a client is waiting for a connection before a connection from the reserve pool is providedPGBOUNCER_MAX_DB_CONNECTIONS (default 0) maximum number of connections allowed per databasePGBOUNCER_MAX_USER_CONNECTIONS (default 0) maximum number of connections allowed per userComplete details for pgBouncer config parameters can be found in the pgBouncer documention
These are probably the most important variables to set...
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_ENDPOINTAdditional WAL-G config parameters can be found in the https://github.com/wal-g/wal-g
To launch a container from the image, an example workflow may be:
AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY with read/write priviges available. For this example:bucket = mybucket AWS_ACCESS_KEY_ID = myaccesskey AWS_SECRET_ACCESS_KEY = mysecretkey
AWS_ENDPOINT = https://sfo2.digitaloceanspaces.com/
WALG_S3_PREFIX = s3://mybucket/my/custom/prefix/
PGBOUNCER_POOL_MODE = transaction
docker network create -d bridge --subnet 10.100.0.0/24 --gateway 10.100.0.1 mybridge
docker run \ --name 1.db \ --network=mybridge -p 5432:5432 \ -p 6432:6432 \ -e POSTGRES_PRIMARY_CONNINFO="host=1.db port=5432 user=postgres password=mypassword" \ -e POSTGRES_PASSWORD=mypassword \ -e AWS_ACCESS_KEY_ID=myaccesskey \ -e AWS_SECRET_ACCESS_KEY=mysecretkey \ -e AWS_ENDPOINT=https://sfo2.digitaloceanspaces.com/ \ -e WALG_S3_PREFIX=s3://mybucket/my/custom/prefix \ -d dustymugs/pgplus:12-3.0
docker exec 1.db gosu postgres wal-g backup-push /var/lib/postgresql/data
Replace /var/lib/postgresql/data if you are not using the default path for $PGDATA
docker run \ --name 2.db \ --network=mybridge \ -p 5433:5432 \ -p 6433:6432 \ -e POSTGRES_RESTORE=1 \ -e POSTGRES_IS_STANDBY=1 \ -e POSTGRES_PRIMARY_CONNINFO="host=1.db port=5432 user=postgres password=mypassword" \ -e POSTGRES_PASSWORD=mypassword \ -e AWS_ACCESS_KEY_ID=myaccesskey \ -e AWS_SECRET_ACCESS_KEY=mysecretkey \ -e AWS_ENDPOINT=https://sfo2.digitaloceanspaces.com/ \ -e WALG_S3_PREFIX=s3://mybucket/my/custom/prefix \ -d dustymugs/pgplus:12-3.0
The only changes here are:
--name 2.db)-p 5433:5432 and -p 6433:6432)-e POSTGRES_RESTORE=1 to a non-empty value-e POSTGRES_IS_STANDBY=1 to a non-empty valuedocker exec 1.db gosu psql -U postgres -c "SELECT * FROM pg_stat_replication"
We expect one row in the query resultset
https://github.com/dustymugs/pgplus
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务