
如果你使用 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 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
!https://gearboxworks.github.io/assets/images/gearbox-logo.png
本文档是为https://github.com/gearboxworks/%E5%AE%9E%E7%8E%B0%E7%9A%84postgresql Docker容器仓库说明。
GitHub提交时间: !commit-date
GitHub最新发布: !last-release-date !last-release-date https://github.com/gearboxworks/docker-postgresql/workflows/release/badge.svg?event=release](https://github.com/gearboxworks/docker-postgresql/actions?query=workflow%3Arelease)
| 服务 | GitHub版本 | Docker版本 | Docker大小 | Docker标签 |
|---|---|---|---|---|
| postgresql | !postgresql | (https://github.com/gearboxworks/docker-postgresql/blob/master/versions/10.12/DockerfileRuntime) | ||
| postgresql | !postgresql | (https://github.com/gearboxworks/docker-postgresql/blob/master/versions/11.7/DockerfileRuntime) | ||
| postgresql | !postgresql | (https://github.com/gearboxworks/docker-postgresql/blob/master/versions/12.2/DockerfileRuntime) | ||
| postgresql | !postgresql | (https://github.com/gearboxworks/docker-postgresql/blob/master/versions/9.4.26/DockerfileRuntime) | ||
| postgresql | !postgresql | (https://github.com/gearboxworks/docker-postgresql/blob/master/versions/9.5.21/DockerfileRuntime) | ||
| postgresql | !postgresql | (https://github.com/gearboxworks/docker-postgresql/blob/master/versions/9.6.17/DockerfileRuntime) |
https://github.com/gearboxworks/%E7%9A%84%E6%A0%B8%E5%BF%83%E9%A9%B1%E5%8A%A8%E5%8A%9B%E4%B9%8B%E4%B8%80%E6%98%AF%E6%8F%90%E5%8D%87%E8%BD%AF%E4%BB%B6%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C%EF%BC%8C%E5%B0%A4%E5%85%B6%E6%98%AF%E9%92%88%E5%AF%B9%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91%E4%BA%BA%E5%91%98%E3%80%82
我们的愿景是让开发者和其他软件用户能够快速轻松地使用几乎任何版本的软件服务、命令行工具或API,而无需先陷入安装和配置的繁琐过程。
换句话说,我们为https://github.com/gearboxworks/%E7%94%A8%E6%88%B7%E8%AE%BE%E5%AE%9A%E7%9A%84%E6%84%BF%E6%99%AF%E6%98%AF%EF%BC%9A%E8%BD%AF%E4%BB%B6%E2%80%9C**%E5%8D%B3%E5%BC%80%E5%8D%B3%E7%94%A8**%E2%80%9D%E3%80%82
此容器设计用于https://github.com/gearboxworks/%E6%A1%86%E6%9E%B6%E5%86%85%EF%BC%8C%E4%BD%86%E7%94%B1%E4%BA%8EGearbox%E7%9A%84%E7%81%B5%E6%B4%BB%E6%80%A7%EF%BC%8C%E4%B9%9F%E5%8F%AF%E5%9C%A8%E6%A1%86%E6%9E%B6%E5%A4%96%E4%BD%BF%E7%94%A8%E3%80%82
有三种使用方法:
launch是专门设计用于与Gearbox Docker容器交互的工具。
它提供三个重要功能区域,无需学习Docker容器知识:
它还提供功能完善的SSH守护进程,用于远程连接,以及一套标准的常用工具和实用程序。
更多launch文档可https://github.com/gearboxworks/docker-template/blob/master/LAUNCH.md%E3%80%82
launch目前处于beta测试阶段,包含在所有Gearbox Docker仓库中。测试结束后,它将包含在Gearbox安装包中。
目前,只需下载适用于您操作系统的独立launch二进制文件:
有多种直接或间接调用launch的方式。此外,所有主机环境变量将无缝导入容器中。这使开发者可以像使用本地安装的软件一样尝试多个版本。
如果容器不存在,将自动下载并创建。多个版本可以共存。
安装、创建并启动postgresql Gearbox容器:
bash./launch install postgresql
创建并启动postgresql Gearbox容器,运行shell:
bash./launch shell postgresql
创建并启动版本为9.5.21的postgresql Gearbox容器,运行shell:
bash./launch shell postgresql:9.5.21
bash./launch shell postgresql:9.5.21 ls -l
bash./launch shell postgresql:9.5.21 ps -eaf
如果postgresql被符号链接到launch,则会自动确定Gearbox容器并运行默认命令。安装后,Gearbox容器的所有可用命令将自动创建符号链接。
bash./postgresql
运行postgresql Gearbox容器的默认命令。如果容器有默认交互命令,可以直接提供参数而无需指定命令:
bash./postgresql -flag1 -flag2 variable
bash./launch postgresql:9.5.21 -flag1 -flag2 variable
Gearbox容器可能有多个可运行的可执行文件。postgresql Gearbox容器具有以下可用命令:
clusterdb - 将在容器内执行/usr/local/bin/clusterdbcreatedb - 将在容器内执行/usr/local/bin/createdbcreatelang - 将在容器内执行/usr/local/bin/createlangcreateuser - 将在容器内执行/usr/local/bin/createuser/usr/local/bin/psqldropdb - 将在容器内执行/usr/local/bin/dropdbdroplang - 将在容器内执行/usr/local/bin/droplangdropuser - 将在容器内执行/usr/local/bin/dropuserecpg - 将在容器内执行/usr/local/bin/ecpginitdb - 将在容器内执行/usr/local/bin/initdbpg_archivecleanup - 将在容器内执行/usr/local/bin/pg_archivecleanuppg_basebackup - 将在容器内执行/usr/local/bin/pg_basebackuppg_config - 将在容器内执行/usr/local/bin/pg_configpg_controldata - 将在容器内执行/usr/local/bin/pg_controldatapg_ctl - 将在容器内执行/usr/local/bin/pg_ctlpg_dump - 将在容器内执行/usr/local/bin/pg_dumppg_dumpall - 将在容器内执行/usr/local/bin/pg_dumpallpg_isready - 将在容器内执行/usr/local/bin/pg_isreadypg_receivexlog - 将在容器内执行/usr/local/bin/pg_receivexlogpg_recvlogical - 将在容器内执行/usr/local/bin/pg_recvlogicalpg_resetxlog - 将在容器内执行/usr/local/bin/pg_resetxlogpg_restore - 将在容器内执行/usr/local/bin/pg_restorepg_standby - 将在容器内执行/usr/local/bin/pg_standbypg_test_fsync - 将在容器内执行/usr/local/bin/pg_test_fsyncpg_test_timing - 将在容器内执行/usr/local/bin/pg_test_timingpg_upgrade - 将在容器内执行/usr/local/bin/pg_upgradepg_xlogdump - 将在容器内执行/usr/local/bin/pg_xlogdumppgbench - 将在容器内执行/usr/local/bin/pgbenchpostmaster - 将在容器内执行/usr/local/bin/postmasterpsql - 将在容器内执行/usr/local/bin/psqlreindexdb - 将在容器内执行/usr/local/bin/reindexdbvacuumdb - 将在容器内执行/usr/local/bin/vacuumdbvacuumlo - 将在容器内执行/usr/local/bin/vacuumlossh - 所有https://github.com/gearboxworks/%E5%AE%B9%E5%99%A8%E9%83%BD%E8%BF%90%E8%A1%8C%E6%9C%89SSH%E5%AE%88%E6%8A%A4%E8%BF%9B%E7%A8%8B%EF%BC%8C%E5%9B%A0%E6%AD%A4%E5%8F%AF%E4%BB%A5%E8%BF%9C%E7%A8%8B%E8%BF%9E%E6%8E%A5%E3%80%82%E8%A6%81%E6%9F%A5%E7%9C%8B%E5%AF%BC%E5%87%BA%E5%88%B0%E4%B8%BB%E6%9C%BA%E7%9A%84%E7%AB%AF%E5%8F%A3%EF%BC%8C%E8%AF%B7%E4%BD%BF%E7%94%A8%E4%BB%A5%E4%B8%8B%E5%91%BD%E4%BB%A4%EF%BC%9A
bash./launch list postgresql
只需将此仓库克隆到本地机器:
bashgit clone https://github.com/gearboxworks/docker-postgresql.git
make build - 构建Docker镜像。从基础目录构建所有版本,或从每个目录构建特定版本。
make list - 列出已构建的Docker镜像。从基础目录列出所有版本,或从每个目录列出特定版本。
make clean - 删除已构建的Docker镜像。从基础目录删除所有版本,或从每个目录删除特定版本。
make push - 将已构建的Docker镜像推送到Docker Hub(仅Gearbox管理员可用)。从基础目录推送所有版本,或从每个目录推送特定版本。
您可以按照上述方法构建容器,或使用以下命令从DockerHub获取:
make start - 使用正确的运行时配置启动Docker容器。
make stop - 停止Docker容器。
make run - 在前台运行Docker容器(所有STDOUT和STDERR将输出到控制台)。容器终止时将被删除。
make shell - 在Docker容器内运行shell(/bin/bash)。
make rm - 删除Docker容器。
make test - 对Docker容器执行stop、rm、clean、build、create和start操作。
简单执行docker pull gearbox/postgresql即可拉取最新版本。
start - 使用正确的运行时配置启动Docker容器:
bashdocker run -d --name postgresql-latest --restart unless-stopped --network gearboxnet gearbox/postgresql:latest
stop - 停止Docker容器:
bashdocker stop postgresql-latest
rm - 删除Docker容器:
bashdocker container rm postgresql-latest
run - 在前台运行Docker容器(所有STDOUT和STDERR将输出到控制台)。容器终止时将被删除:
bashdocker run --rm --name postgresql-latest --network gearboxnet gearbox/postgresql:latest
shell - 在Docker容器内运行shell(/bin/bash):
bashdocker run --rm --name postgresql-latest -i -t --network gearboxnet gearbox/postgresql:latest /bin/bash
ssh - 所有https://github.com/gearboxworks/%E5%AE%B9%E5%99%A8%E9%83%BD%E8%BF%90%E8%A1%8C%E6%9C%89SSH%E5%AE%88%E6%8A%A4%E8%BF%9B%E7%A8%8B%EF%BC%8C%E5%9B%A0%E6%AD%A4%E5%8F%AF%E4%BB%A5%E8%BF%9C%E7%A8%8B%E8%BF%9E%E6%8E%A5%E3%80%82%E5%8F%AF%E4%BD%BF%E7%94%A8%E4%B8%8A%E8%BF%B0%60launch%60%E5%B7%A5%E5%85%B7%E6%88%96%E5%8F%91%E7%8E%B0%E7%AB%AF%E5%8F%A3%E5%90%8E%E7%9B%B4%E6%8E%A5SSH%E8%BF%9E%E6%8E%A5%EF%BC%9A
bashSSH_PORT="$(docker port postgresql-latest 22/tcp | sed 's/0.0.0.0://')" ssh -p ${SSH_PORT} -o StrictHostKeyChecking=no gearbox@localhost
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务
以下是 gearboxworks/postgresql 相关的常用 Docker 镜像,适用于 不同场景 等不同场景: