
如果你使用 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://hub.docker.com/_/couchbase 的 amd64 架构专用版本。Couchbase Server 是一个分布式架构的 NoSQL 文档数据库,具备内存优先架构、地理分布式部署和工作负载隔离等特性,能够在保持亚毫秒级延迟和 99.999% 可用性的同时,支持大规模关键业务应用。通过兼容 SQL 的查询语言(N1QL),可轻松实现从关系型数据库向 Couchbase Server 的迁移。
Couchbase Server 适用于以下场景:
| 标签 | Dockerfile 链接 |
|---|---|
7.6.7, enterprise, enterprise-7.6.7, latest | https://github.com/couchbase/docker/blob/a322cc7110124b2581339f52d88bab80fb50016d/enterprise/couchbase-server/7.6.7/Dockerfile |
7.6.6, enterprise-7.6.6 | https://github.com/couchbase/docker/blob/9ce3cbc835dd4e072943ac7878aa7f87d6b95178/enterprise/couchbase-server/7.6.6/Dockerfile |
7.6.5, enterprise-7.6.5 | https://github.com/couchbase/docker/blob/ec16abff6f0551ced6c771bd5606a4392379dd31/enterprise/couchbase-server/7.6.5/Dockerfile |
7.6.4, enterprise-7.6.4 | https://github.com/couchbase/docker/blob/9990e2cfabc94b37607e5666d9ef1eab69a397a6/enterprise/couchbase-server/7.6.4/Dockerfile |
7.6.3, enterprise-7.6.3 | https://github.com/couchbase/docker/blob/553d1baa4aa90fe506e1d7bcdf4daec387a110fe/enterprise/couchbase-server/7.6.3/Dockerfile |
7.6.2, enterprise-7.6.2 | https://github.com/couchbase/docker/blob/ce13f602d2c95f76835c67a8855d5e73480973a6/enterprise/couchbase-server/7.6.2/Dockerfile |
community, community-7.6.2 | https://github.com/couchbase/docker/blob/3f81af158b7f307e42f8c42ceaf7657b2690bfca/community/couchbase-server/7.6.2/Dockerfile |
7.6.1, enterprise-7.6.1 | https://github.com/couchbase/docker/blob/966143f937bfe6979b7c09b86684004fdd21e5b8/enterprise/couchbase-server/7.6.1/Dockerfile |
community-7.6.1 | https://github.com/couchbase/docker/blob/a***c9b23efba391317fd21f898bf64dff6ec1/community/couchbase-server/7.6.1/Dockerfile |
7.6.0, enterprise-7.6.0 | https://github.com/couchbase/docker/blob/9bdcf41deedd86da4c71347ffeea350a9895d816/enterprise/couchbase-server/7.6.0/Dockerfile |
community-7.6.0 | https://github.com/couchbase/docker/blob/6d669d0e34e6990b43c1b91ea74720235c96c4ac/community/couchbase-server/7.6.0/Dockerfile |
7.2.7, enterprise-7.2.7 | https://github.com/couchbase/docker/blob/23887cae4fd6ce054f383d524a7975d2e3a6b72e/enterprise/couchbase-server/7.2.7/Dockerfile |
7.2.6, enterprise-7.2.6 | https://github.com/couchbase/docker/blob/181af64dcbedc1abf6e0916d9f5373cf1c18cb6e/enterprise/couchbase-server/7.2.6/Dockerfile |
7.2.5, enterprise-7.2.5 | https://github.com/couchbase/docker/blob/94d97d9eea3d4057846be28f319940927d5166cb/enterprise/couchbase-server/7.2.5/Dockerfile |
7.2.4, enterprise-7.2.4 | https://github.com/couchbase/docker/blob/15c1c3c0b4717a8b23ef7962f3fde28fe68e4311/enterprise/couchbase-server/7.2.4/Dockerfile |
community-7.2.4 | https://github.com/couchbase/docker/blob/7c8453ef8584ff18f7b6c052828758693af4f72c/community/couchbase-server/7.2.4/Dockerfile |
7.2.3, enterprise-7.2.3 | https://github.com/couchbase/docker/blob/b54049418018144369816d18c63d9bf76e34bc9f/enterprise/couchbase-server/7.2.3/Dockerfile |
7.2.2, enterprise-7.2.2 | https://github.com/couchbase/docker/blob/3515fb617a469a5f46d492cf6910dddff8efb825/enterprise/couchbase-server/7.2.2/Dockerfile |
community-7.2.2 | https://github.com/couchbase/docker/blob/c7a25ac7f38a81a465aa97f1a1d753a6c579954f/community/couchbase-server/7.2.2/Dockerfile |
7.2.0, enterprise-7.2.0 | https://github.com/couchbase/docker/blob/4e769975179dc4e5bf4138349818bc8a0e191c9f/enterprise/couchbase-server/7.2.0/Dockerfile |
community-7.2.0 | https://github.com/couchbase/docker/blob/71596d088ce2bc0218418187ac40ffccb08dbc36/community/couchbase-server/7.2.0/Dockerfile |
步骤 1:运行 Couchbase Server 容器
bashdocker run -d --name db \ -p 8091-8097:8091-8097 \ -p 9123:9123 \ -p 11207:11207 \ -p 11210:11210 \ -p 11280:11280 \ -p 18091-18097:18091-18097 \ docker.xuanyuan.run/couchbase
端口说明:Couchbase Server 根据使用场景需要暴露多个端口,详细端口用途可参考 https://docs.couchbase.com/server/current/install/install-ports.html%E3%80%82
步骤 2:通过 Web 控制台完成初始化设置
访问主机的 http://localhost:8091,通过设置向导完成集群配置:
N1QL 是 Couchbase 的 SQL 兼容查询语言,可通过 Web 控制台或命令行执行:
Web 控制台方式
http://localhost:8091 并登录sqlSELECT name FROM `beer-sample` WHERE brewery_id="mishawaka_brewing";
命令行方式
bashdocker exec -it db cbq --user Administrator cbq> SELECT name FROM `beer-sample` WHERE brewery_id="mishawaka_brewing";
Couchbase 提供多语言 SDK(C、Go、Java、.NET、Node.js、PHP、Python 等),应用程序可通过 http://localhost:8091/pools 连接到容器化集群。
示例 Java SDK 连接代码:
javaCluster cluster = Cluster.connect("localhost", "Administrator", "password"); Bucket bucket = cluster.bucket("beer-sample"); Collection collection = bucket.defaultCollection();
yamlversion: '3.8' services: couchbase: image: docker.xuanyuan.run/couchbase:latest container_name: couchbase-node1 ports: - "8091:8091" - "8092:8092" - "8093:8093" - "8094:8094" - "8095:8095" - "8096:8096" - "8097:8097" - "9123:9123" - "11207:11207" - "11210:11210" - "11280:11280" - "18091:18091" - "18092:18092" - "18093:18093" - "18094:18094" - "18095:18095" - "18096:18096" - "18097:18097" volumes: - couchbase_data:/opt/couchbase/var ulimits: nofile: soft: 40960 hard: 40960 core: soft: 100000000 hard: 100000000 memlock: soft: 100000000 hard: 100000000 restart: unless-stopped volumes: couchbase_data:
详细系统要求参考 https://docs.couchbase.com/server/current/install/pre-install.html%E3%80%82
Couchbase 容器的持久化数据默认存储在 /opt/couchbase/var,建议通过 -v 参数映射到主机目录:
bashmkdir -p ~/couchbase/data docker run -d --name db \ -v ~/couchbase/data:/opt/couchbase/var \ -p 8091-8097:8091-8097 \ -p 9123:9123 \ -p 11207:11207 \ -p 11210:11210 \ -p 11280:11280 \ -p 18091-18097:18091-18097 \ docker.xuanyuan.run/couchbase
SELinux 环境注意事项:
bashmkdir ~/couchbase/data && chcon -Rt svirt_sandbox_file_t ~/couchbase/data
Couchbase 生产环境需要调整 ulimit 设置以确保性能和稳定性:
bashdocker run -d --name db \ --ulimit nofile=40960:40960 \ --ulimit core=100000000:100000000 \ --ulimit memlock=100000000:100000000 \ -p 8091-8097:8091-8097 \ -p 9123:9123 \ -p 11207:11207 \ -p 11210:11210 \ -p 11280:11280 \ -p 18091-18097:18091-18097 \ docker.xuanyuan.run/couchbase
生产环境建议使用 --net=host 模式避免网络性能损耗和 NAT 问题:
bashdocker run -d --name db --net=host docker.xuanyuan.run/couchbase
所有容器运行在同一物理机,适用于开发和测试环境,但存在资源竞争和单点故障风险:
┌──────────────────────────────────────────────────────────┐ │ 主机 OS (Linux) │ │ │ │ ┌───────────────┐ ┌───────────────┐ ┌───────────────┐ │ │ │ 容器 OS │ │ 容器 OS │ │ 容器 OS │ │ │ │ (Ubuntu) │ │ (Ubuntu) │ │ (Ubuntu) │ │ │ │ ┌───────────┐ │ │ ┌───────────┐ │ │ ┌───────────┐ │ │ │ │ │ Couchbase │ │ │ │ Couchbase │ │ │ │ Couchbase │ │ │ │ │ │ Server │ │ │ │ Server │ │ │ │ Server │ │ │ │ │ └───────────┘ │ │ └───────────┘ │ │ └───────────
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务