You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The {productname} superuser has no special privilege related to deleting expired images from user repositories. There is no central mechanism for the superuser to gather information and act on user repositories. It is up to the owners of each repository to manage expiration and the deletion of their images.
22
22
endif::[]
23
23
24
-
Tag expiration can be set up in one of two ways:
24
+
Tag expiration can be set up in one of three ways:
25
25
26
-
* By setting the `quay.expires-after=` label in the Dockerfile when the image is created. This sets a time to expire from when the image is built.
26
+
* By setting the `quay.expires-after=` label in the Dockerfile when the image is created. This sets a time to expire from when the image is built. This label only works for image manifests.
27
+
28
+
* By setting the `quay.expires-after=` annotation label in the Dockerfile when the image is created. `--annotation` can be passed in for both image manifests and image indexes.
27
29
28
30
* By selecting an expiration date on the
29
31
ifeval::["{context}" == "quay-io"]
@@ -74,9 +76,115 @@ Expiration begins from the time that the image is pushed to the registry.
74
76
75
77
.Procedure
76
78
77
-
* Enter the following `docker label` command to add a label to the desired image tag. The label should be in the format `quay.expires-after=20h` to indicate that the tag should expire after 20 hours. Replace 20h with the desired expiration time. For example:
79
+
* Enter the following `docker label` command to add a label to the desired image tag. The label should be in the format `quay.expires-after=20h` to indicate that the tag should expire after 20 hours. Replace `20h` with the desired expiration time. For example:
You can add an annotation, for example, `quay.expires-after=20h`, to an image tag using the `--annotation` flag when pushing an image to the registry. This annotation causes the tag to automatically expire after the specified time. The annotation can be applies to both image manifests and image indexes. The following values for hours, days, or weeks are accepted:
90
+
91
+
* `1h`
92
+
* `2d`
93
+
* `3w`
94
+
95
+
Expiration begins from the time that the image is pushed to the registry.
96
+
97
+
[NOTE]
98
+
====
99
+
Using the `--annotation` flag is simplest using the `oras` CLI tool.
100
+
====
101
+
102
+
.Prerequisites
103
+
104
+
* You have downloaded the `oras` CLI. For more information, see link:https://oras.land/docs/installation[Installation].
105
+
106
+
.Procedure
107
+
108
+
. Enter the following `oras push --annotation` command to add an annotation to the desired image tag. The annotation should be in the format `quay.expires-after=<value>` to indicate that the tag should expire the set time. For example:
With the `oras` CLI tool, you can unset previously established expiration times.
152
+
153
+
.Prerequisites
154
+
155
+
* You have downloaded the `oras` CLI. For more information, see link:https://oras.land/docs/installation[Installation].
156
+
* You have pushed an image with the `quay.expires-after=<value>` annotation.
157
+
158
+
.Procedure
159
+
160
+
. Enter the following `oras push --annotation` command to remove an annotation to the desired image tag. The annotation should be in the format `quay.expires-after=never`. For example:
. The latest manifest will no longer have an expiration time. Confirm that the expiration date has been removed by checking the {productname} UI, or by entering the following command:
0 commit comments