8.7.4. 使用注解删除标签过期


使用 oras CLI 工具,您可以取消设置之前建立的过期时间。

先决条件

步骤

  1. 输入以下 oras push --annotation 命令删除所需镜像标签的注释。该注解的格式应为 quay.expires-after=never。例如:

    $ oras push --annotation quay.expires-after=never \
      <quay-server.example.com>/<organization>/<repository>:<tag> \
      <file_path>:<media_type>

    输出示例

    ✓ Uploaded  hello.txt                                                                                                       12/12  B 100.00%  321ms
      └─ sha256:74b9e308133afb3bceae961097cb2aa481483869d695ce1414cd2bc7f046027c
    ✓ Uploaded  application/vnd.oci.empty.v1+json                                                                                 2/2  B 100.00%  328ms
      └─ sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a
    ✓ Uploaded  application/vnd.oci.image.manifest.v1+json                                                                    620/620  B 100.00%     0s
      └─ sha256:c370e931b5eca44fd753bd92e6991ed3be70008e8df15078083359409111f8c3
    Pushed [registry] quay-server.example.com/fortestuser/busybox:test2
    ArtifactType: application/vnd.unknown.artifact.v1

  2. 最新清单将不再有过期时间。通过检查 Red Hat Quay UI 或输入以下命令来确认已删除过期日期:

    {"tags": [{"name": "test2", "reversion": false, "start_ts": 1743708135, "manifest_digest": "sha256:19e3a3501b4125cce9cb6bb26ac9207c325259bef94dc66490b999f93c4c83a9", "is_manifest_list": false, "size": 12, "last_modified": "Thu, 03 Apr 2025 19:22:15 -0000"}, {"name": "test2", "reversion": false, "start_ts": 1743706344, "end_ts": 1743708135}]}

    请注意,没有列出过期时间。

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部