基于上游 stellarlinkco/codex 的 Docker 镜像封装,并通过 GitHub Actions 自动构建并推送到 GHCR(公开镜像)。
拉取镜像(将 ZeroDevi1 替换成你的 GitHub 用户名/组织名):
docker pull ghcr.io/<owner>/codex-docker:latest启动服务示例:
docker run --rm -p 5000:5000 ghcr.io/<owner>/codex-docker:latest默认命令:
codex serve --host 0.0.0.0 --port 5000镜像显式使用 /home/devuser/.version-fox 作为 VFOX_HOME,方便与其他容器共享同一份 Node/Java 运行时缓存。为兼容已有工具,还会创建 /home/devuser/.vfox -> /home/devuser/.version-fox 的软链接。
容器启动时会自动检查并补齐:
nodejs@22.14.0- 全局 npm 包
ace-tool - 全局 npm 包
@upstash/context7-mcp
如果你在 Codex 配置里启用了 MCP,推荐直接调用全局命令,并为 context7 提高启动超时,例如:
[mcp_servers.ace-tool]
command = "ace-tool"
[mcp_servers.context7]
command = "context7-mcp"
startup_timeout_sec = 30由于 GitHub Actions 的 release 事件只能监听“本仓库”的 Release,本仓库采用定时任务轮询上游 stellarlinkco/codex 的 latest release tag:
- Workflow:
.github/workflows/build-and-push-ghcr.yml - 逻辑:每天检查一次上游 latest release tag;若 GHCR 已存在同名 tag 则跳过,否则构建并推送
- 推送触发(本仓库手动更新):每次
push都会重新构建并推送(不做“tag 已存在”跳过判断) - 你也可以在 GitHub Actions 页面手动触发;手动触发同样始终构建当前上游 latest release
- 当前默认仅构建
linux/amd64(如需linux/arm64可再加回 platforms)
镜像 tag 规则:
ghcr.io/<owner>/codex-docker:<上游tag>(例如v1.2.2)ghcr.io/<owner>/codex-docker:latest
- 确保仓库启用了 GitHub Actions(一般默认开启)
- 进入
Settings -> Actions -> General -> Workflow permissions,确保GITHUB_TOKEN至少具备写入 Packages 的权限(workflow 内已声明packages: write) - 首次推送镜像后,到仓库的 Packages 页面把容器包可见性改为
Public(公开镜像)
- 上游项目:
stellarlinkco/codex(本镜像默认拉取其最新 Release 二进制安装 Codex)