Repository navigation
docs(dockerimage): document age filtering #3928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
c6385cc
324c8a3
382d667
ebfeaaa
2de2098
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,6 +77,49 @@ Accepted forms: | |
| * `windows/amd64` | ||
| * `linux/arm/v7` | ||
|
|
||
| == Age | ||
|
|
||
| `age` limits a source to tags created within a time window, and makes a condition fail for a tag outside it. With `minimum: 7d`, a source passes over a tag created yesterday and returns the previous one. | ||
|
|
||
| [source,yaml] | ||
| ---- | ||
| sources: | ||
| updatecli: | ||
| kind: dockerimage | ||
| spec: | ||
| image: ghcr.io/updatecli/updatecli | ||
| architecture: amd64 | ||
| versionfilter: | ||
| kind: semver | ||
| age: | ||
| minimum: 7d | ||
| ---- | ||
|
|
||
| A tag is dated by the first of these that is set: | ||
|
|
||
| . the `org.opencontainers.image.created` annotation of the image index | ||
| . the `org.opencontainers.image.created` annotation of the image manifest | ||
| . the `created` field of the image configuration | ||
|
|
||
| Remarks: | ||
|
|
||
| * A tag is dated for every platform of `architectures`, and must exist and be inside the window for all of them. This holds for a source and a condition alike. Without a platform, an image index is dated by its `linux/amd64` image, or else its first image. | ||
| * A source needs a version filter that orders tags, such as `semver`. Registries list tags alphabetically, so the `latest` kind with the `latest` pattern is refused. | ||
| * Each tag costs requests to the registry, so a source checks at most 20 tags, in the order the version filter prefers them. | ||
| * A source is skipped, not failed, when every matching tag is outside the window, none of them has a date, none of them is supported (schema1 images are not), or the registry fails to answer for a tag after answering for a preferred one. It fails when the registry fails for the first tag. | ||
|
|
||
| [IMPORTANT] | ||
| ==== | ||
| The date is set by the publisher when the image is built, not by the registry when the tag is pushed. An image built long before its release, such as a promoted or retagged one, looks older than it is and can pass a `minimum` age on its first day. A malicious image can also claim any date, so unlike the age filter for npm or PyPI, it is not a protection against a compromised release. | ||
| ==== | ||
|
|
||
| [IMPORTANT] | ||
| ==== | ||
| Reproducible builds set the creation date to the Unix epoch, 1970-01-01, and Updatecli treats that as no date. Unless such an image carries the `org.opencontainers.image.created` annotation, it can't be filtered by age: a source with `age` set skips it every time. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Distinguish an undated tag from a skipped source. If an epoch-dated tag is followed by a dated tag inside the window, the source can select the latter. The statement that the source skips the image every time can imply that one undated candidate makes the whole source skip. Clarify that the source skips when none of its matching candidates has a usable date.
|
||
|
|
||
| The `gcr.io/distroless` images are in this case. Leave `age` unset for them. | ||
| ==== | ||
|
|
||
| == Authentication | ||
|
|
||
| Depending on the Docker Registry, authentication may be required. The way to retrieve the token depends on the registry. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Qualify the previous-tag example.
If the previous tag is also younger than seven days, the source does not return it. It continues checking candidates and may skip. State that the source returns a later candidate only if it satisfies the age and other filters.