Skip to content
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

Build OCI-compatible image cache #1119

Closed

Conversation

angonz
Copy link
Contributor

@angonz angonz commented Sep 4, 2024

Fixes #1118

Add image-manifest=true to build context to support OCI-compatible image cache.
This allows using the registry cache in other registries, like AWS ECR.

@regisb
Copy link
Contributor

regisb commented Oct 15, 2024

🤔 According to my tests this change should not break our CI. But I'm not sure what's the impact, to be honest. I fail to understand this part of the docs: https://docs.docker.com/build/cache/backends/

By default, the OCI media type generates an image index for the cache image. Some OCI registries, such as Amazon ECR, don't support the image index media type: application/vnd.oci.image.index.v1+json. If you export cache images to ECR, or any other registry that doesn't support image indices, set the image-manifest parameter to true to generate a single image manifest instead of an image index for the cache image.

I am tempted not to merge this change, for the following reasons:

  1. I don't really have a clue what this does.
  2. It makes the build command more complicated.
  3. You can achieve the same result by implementing the DOCKER_BUILD_COMMAND filter https://docs.tutor.edly.io/reference/api/hooks/catalog.html#tutor.hooks.Filters.DOCKER_BUILD_COMMAND

@angonz
Copy link
Contributor Author

angonz commented Oct 16, 2024

Hi Régis!
To be honest, I stopped using the registry cache because it only slows the image building process. Registry cache seems to be tied to the image tag. As we create a new tag for every build, cache is always regenerated. Btw, I didn't know of the DOCKER_BUILD_COMMAND setting. That might be a better alternative.

@DawoudSheraz
Copy link
Contributor

Given the conversations above, are we good to close this PR @angonz?

@angonz
Copy link
Contributor Author

angonz commented Oct 17, 2024

Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Won't fix
Development

Successfully merging this pull request may close these issues.

400 Bad request when building images with registry cache to ECR
3 participants