oras

ORAS OCI 制品管理

补充说明

ORAS 用 OCI Registry 存储任意制品(Helm chart、SBOM、签名、模型、二进制),不局限于容器镜像。它把制品作为 OCI artifact 推送,复用镜像仓库的认证、复制和保留策略。

常用命令:oras push、oras pull、oras discover、oras attach、oras manifest。

常用示例

登录仓库:

oras login registry.example.com -u "$USER" -p "$PASSWORD"

推送制品:

oras push registry.example.com/artifacts/app:1.0.0 \
  --artifact-type application/vnd.example.config.v1+json \
  ./config.yaml:application/yaml \
  ./sbom.json:application/spdx+json

拉取制品:

oras pull registry.example.com/artifacts/app:1.0.0 -o ./out

查看引用和附件:

oras discover registry.example.com/artifacts/app:1.0.0
oras attach registry.example.com/artifacts/app:1.0.0 \
  --artifact-type application/vnd.in-toto+json \
  ./provenance.json

查看 manifest:

oras manifest fetch registry.example.com/artifacts/app:1.0.0

易错点与排错