Skip to content

feat(docker): publish official runtime image ghcr.io/objectstack-ai/objectstack - #2952

Merged
os-zhuang merged 2 commits into
mainfrom
claude/objectstack-official-docker-boic56
Jul 15, 2026
Merged

feat(docker): publish official runtime image ghcr.io/objectstack-ai/objectstack#2952
os-zhuang merged 2 commits into
mainfrom
claude/objectstack-official-docker-boic56

Conversation

@os-zhuang

@os-zhuang os-zhuang commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

背景

ObjectStack 此前只提供 examples/docker 里的"复制进你项目"参考 Dockerfile,没有官方镜像。本 PR 发布官方 runtime 镜像 ghcr.io/objectstack-ai/objectstack:面向开发商的通用生产运行时(Node 22 + 锁版本 @objectstack/cli + os start),开发商 FROM 它 + COPY 自己的 artifact 即完成生产部署,甚至可以直接挂载 artifact docker run,主机无需任何 Node 工具链。

变更内容

官方镜像

  • docker/Dockerfile:app 无关的 runtime — 非 root node 用户、/api/v1/health HEALTHCHECK、预置 OS_ARTIFACT_PATH / OS_PORT=8080、OCI source labels;CLI 版本由 CI 通过 OS_CLI_VERSION build-arg 锁定。
  • docker/README.md:tag 策略(X.Y.Z / X.Y / X / latest,与 @objectstack/cli 版本一一对应)、两种用法(extend / 直接挂载运行)、运行时必须注入的三个密钥变量(OS_DATABASE_URL / OS_AUTH_SECRET / OS_SECRET_KEY)。

发布流水线

  • .github/workflows/docker-publish.yml:reusable workflow(workflow_call + workflow_dispatch),buildx 多架构(amd64/arm64)推送 ghcr,推送后 os --version 冒烟。workflow_dispatch 路径用于两次发版之间的基础镜像 CVE 重建。
  • .github/workflows/release.yml:changesets 发布成功后提取 @objectstack/cli 版本并调用 docker-publish。不用 on: push: tags 触发——release 工作流用 GITHUB_TOKEN 推 tag,GitHub 会抑制由此产生的 workflow 触发,tag 触发器永远不会点火。

文档与示例

  • examples/docker/Dockerfile:runtime 阶段改为 FROM ghcr.io/objectstack-ai/objectstack(健康检查、env、非 root 均继承),最终镜像只叠加编译产物;README 说明 tag 钉版与免构建路径。
  • content/docs/deployment/self-hosting.mdx:Docker 章节改为以官方镜像为主路径(挂载直跑 + extend 两种),保留自建等价 Dockerfile 供 air-gapped 场景。

验证

  • 两个 workflow YAML 通过语法校验;job 拓扑 release → docker 正确,caller 授予 callee 所需的 packages: write
  • 本环境无 Docker daemon,镜像构建无法本地验证——首次发版(或手动 workflow_dispatch 一个已发布版本,如 14.8.0)时需确认 ghcr 推送与冒烟步骤通过
  • 不含 changeset:未改动任何 npm 包,fixed group 不应因 CI/文档变更整体 bump 版本。

备注

  • 镜像 tag 与 CLI 版本严格一致,生产环境应钉精确版本(文档已强调)。
  • 后续(不在本 PR 范围):create-objectstack 脚手架模板可默认带上 examples/docker 三件套;README 增加 docker 快速开始入口。

🤖 Generated with Claude Code

https://claude.ai/code/session_0162o68e5w3bpUBEVRQboUGG

…bjectstack

Ship an official, versioned runtime image instead of only a copy-me example:

- docker/Dockerfile: app-agnostic runtime — node:22-slim + pinned
  @objectstack/cli + `os start`, non-root `node` user, /api/v1/health
  HEALTHCHECK, OS_ARTIFACT_PATH/OS_PORT preset, OCI source labels.
- .github/workflows/docker-publish.yml: reusable workflow (workflow_call +
  workflow_dispatch) building multi-arch (amd64/arm64) and pushing tags
  X.Y.Z / X.Y / X / latest, tag = published @objectstack/cli version, with a
  post-push `os --version` smoke test. Dispatch path covers base-image CVE
  rebuilds between releases.
- release.yml: expose published/cli-version outputs from the changesets step
  and call docker-publish after every successful npm publish (a tags trigger
  would never fire — tags are pushed with GITHUB_TOKEN).
- examples/docker: runtime stage now extends the official image; README
  documents tag pinning and the no-build mount path.
- docs/deployment/self-hosting: Docker section leads with the official image
  (mount-and-run + extend), keeps a self-built equivalent for air-gapped
  registries.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0162o68e5w3bpUBEVRQboUGG
@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jul 15, 2026 5:34am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation ci/cd size/m labels Jul 15, 2026
@os-zhuang os-zhuang added skip-changeset PR has no user-facing published change; bypasses the changeset gate and removed skip-changeset PR has no user-facing published change; bypasses the changeset gate labels Jul 15, 2026 — with Claude
…dd changeset

The docker e2e builds examples/docker, whose runtime stage is now
FROM ghcr.io/objectstack-ai/objectstack — a tag that doesn't exist until the
first release publishes it. Build that base locally from docker/Dockerfile
inside the job instead of pulling: kills the chicken-and-egg AND makes every
PR exercise the official runtime Dockerfile itself. Also trigger the e2e on
docker/** changes, and add the feature changeset (minor on @objectstack/cli).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0162o68e5w3bpUBEVRQboUGG
@os-zhuang
os-zhuang marked this pull request as ready for review July 15, 2026 07:41
@os-zhuang
os-zhuang merged commit df26c91 into main Jul 15, 2026
16 of 17 checks passed
@os-zhuang
os-zhuang deleted the claude/objectstack-official-docker-boic56 branch July 15, 2026 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd documentation Improvements or additions to documentation size/m tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants