diff --git a/Dockerfile b/Dockerfile index 9bbe926..a51f12b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,6 +24,14 @@ RUN BUILD_FLAGS="-s -w -X git.yuntuo.hk/k2safe/orbit/internal/buildinfo.Version= FROM scratch +ARG VERSION=dev +ARG REVISION=unknown +ARG BUILD_TIME=unknown +LABEL org.opencontainers.image.title="Orbit" \ + org.opencontainers.image.version="${VERSION}" \ + org.opencontainers.image.revision="${REVISION}" \ + org.opencontainers.image.created="${BUILD_TIME}" + COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=build /out/orbit /usr/local/bin/orbit COPY --from=build /out/orbit-migrate /usr/local/bin/orbit-migrate diff --git a/docs/21-container-deployment.md b/docs/21-container-deployment.md index a217559..0c847eb 100644 --- a/docs/21-container-deployment.md +++ b/docs/21-container-deployment.md @@ -27,7 +27,7 @@ docker build --platform linux/amd64 \ -t registry.example/orbit:1.0.0 . ``` -节点启动后通过 `GET /version` 核对这些值。`registry.example` 只是占位符,不是平台依赖。 +镜像同时写入 OCI `org.opencontainers.image.version`、`org.opencontainers.image.revision` 和 `org.opencontainers.image.created` 标签;可以先核对标签,再在节点启动后通过 `GET /version` 核对进程实际使用的值。`registry.example` 只是占位符,不是平台依赖。 ## 2. 迁移、核验和启动 diff --git a/docs/reports/phase-7-regression-status.md b/docs/reports/phase-7-regression-status.md index fab96ce..e1efe5e 100644 --- a/docs/reports/phase-7-regression-status.md +++ b/docs/reports/phase-7-regression-status.md @@ -8,7 +8,7 @@ | --- | --- | --- | | 服务端单元与竞态、vet、构建 | Docker `golang:1.27.1`,仓库声明版本;`GOWORK=off go test -race ./... && go vet ./... && go build ./...` | PASS | | SDK 与独立示例竞态、vet、构建 | Docker `golang:1.27.1`;SDK 全 module、全部示例、`orbit-load`、`orbit-exec-load`、`orbit-schedule-load`、`orbit-workflow-load`,以及 result-inbox/task-outbox | PASS;健康/版本 SDK 契约包含 `Client.Version(ctx)`,返回协议身份且不暴露敏感响应 | -| 容器发布物构建 | `make image`;宿主平台 linux/arm64;显式 `docker build --platform linux/amd64`;带 `VERSION`、`REVISION`、`BUILD_TIME` 构建参数的版本化镜像;镜像内 `GOWORK=off` | PASS;native 与 amd64 镜像均构建成功,包含 `orbit`、`orbit-migrate`、`orbit-admin`,运行用户为非 root;版本化 amd64 二进制包含注入的构建身份,`GET /version` 契约单测通过;无 DSN 时服务按预期拒绝启动 | +| 容器发布物构建 | `make image`;宿主平台 linux/arm64;显式 `docker build --platform linux/amd64`;带 `VERSION`、`REVISION`、`BUILD_TIME` 构建参数的版本化镜像;镜像内 `GOWORK=off` | PASS;native 与 amd64 镜像均构建成功,包含 `orbit`、`orbit-migrate`、`orbit-admin`,运行用户为非 root;版本化 amd64 二进制和 OCI 标签均包含注入的构建身份,`GET /version` 契约单测通过;无 DSN 时服务按预期拒绝启动 | | 当前协议门禁 | `make protocol-check` | PASS,当前 v1 契约同步 | | 历史 SDK / 服务端任务 API 双向演练 | Go 1.27.1、MySQL 8.4 一次性环境;`make mysql-compatibility`;历史提交 `a50d5fa` | PASS;旧服务端+当前 SDK、当前服务端+旧 SDK 均完成真实任务受理、幂等、查询、分页和取消;不是正式标签或全协议矩阵 | | 外键迁移防回归 | `TestPostRemovalMigrationGuard`;服务端迁移运行时校验 | PASS;000008 以前仅保留兼容清理历史,后续迁移在执行前拒绝引用约束 DDL |