Fix OCI images not being processed correctly #12

Merged
denise merged 1 commits from :master into master 4 months ago
Collaborator

This commit changes the way remote images are checked for updates. Instead of being based off the local image hash, which changes locally for OCI images with application/vnd.oci.image.index.v1+json manifests, all remote images now base themselves off the manifest list content digest, present in the docker-content-digest response header for the Docker Registry API v2/manifests endpoint and in RepoDigests with the command docker image inspect.

Local images do not have content digests, so they still follow the local image hash system.

A few things (non-extensive list) need to be tested thoroughly before pulling to main:

  • Does the manifest list content digest change on all updates?
  • Does the manifest list content digest change when changes are made to an architecture that is not ours? If so, is it done very often, causing unnecessary pulls?
  • Do all images have a manifest list?
  • Are there any regressions with local images?
This commit changes the way remote images are checked for updates. Instead of being based off the local image hash, which changes locally for OCI images with application/vnd.oci.image.index.v1+json manifests, all remote images now base themselves off the manifest list content digest, present in the `docker-content-digest` response header for the Docker Registry API v2/manifests endpoint and in RepoDigests with the command `docker image inspect`. Local images do not have content digests, so they still follow the local image hash system. A few things (non-extensive list) need to be tested thoroughly before pulling to main: * Does the manifest list content digest change on all updates? * Does the manifest list content digest change when changes are made to an architecture that is not ours? If so, is it done very often, causing unnecessary pulls? * Do all images have a manifest list? * Are there any regressions with local images?
denise added 1 commit 4 months ago
denise requested review from neil 4 months ago
denise requested review from frdescam 4 months ago
Poster
Collaborator

I believe that moving to this system might require all images to be removed and repulled, since the content digest might not be in the right format if the image was pulled with a image id.

While testing, I ran into an issue with trying to get the locally stored content digests by using the {{index .RepoDigests 0}} format with the docker inspect image command. The digest was there, but that syntax did not work, only {{.RepoDigests}} would work.

I believe that moving to this system might require all images to be removed and repulled, since the content digest might not be in the right format if the image was pulled with a image id. While testing, I ran into an issue with trying to get the locally stored content digests by using the `{{index .RepoDigests 0}}` format with the `docker inspect image` command. The digest was there, but that syntax did not work, only `{{.RepoDigests}}` would work.
neil approved these changes 4 months ago
neil left a comment
Owner

Works in production. Couldn’t test child image rebuilds but I believe it’ll be unaffected by those changes.
Thanks for the rework!

Works in production. Couldn’t test child image rebuilds but I believe it’ll be unaffected by those changes. Thanks for the rework!
frdescam refused to review 4 months ago
frdescam requested review from frdescam 4 months ago
denise changed title from WIP: Fix OCI images not being processed correctly to Fix OCI images not being processed correctly 4 months ago
frdescam approved these changes 4 months ago
denise merged commit fd02307ff1 into master 4 months ago
This repo is archived. You cannot comment on pull requests.
No reviewers
No Milestone
No Assignees
3 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: 42l/docker-update-images#12
Loading…
There is no content yet.