-
Notifications
You must be signed in to change notification settings - Fork 131
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
Annotations in the apko yaml file aren't picked up. #481
Comments
My guess is that the annotations are going to the wrong place. Have you tried with a single-arch build? |
Thanks for the response @kaniini, sorry if I'm misunderstanding but I thought these lines in the apko manifest indicated a single-arch build? Or is there something else I need to do? archs:
- x86_64 |
Not working here either. To recreate:
Build step with debug, note annotations are picked up at the start:
If we search the tar file, the string isn't present:
|
If someone looks at this, there may be design questions to answer. OCI annotations are not the same thing as Docker labels, but Docker labels are the only thing that is commonly exposed to tooling. I suggest we set both labels and OCI annotations. https://github.com/opencontainers/image-spec/blob/main/annotations.md |
Is this one fixed? we've been adding annotations for awhile now. |
% crane manifest --platform=linux/amd64 cgr.dev/chainguard/go | jq .
{
"schemaVersion": 2,
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"config": {
"mediaType": "application/vnd.oci.image.config.v1+json",
"size": 476,
"digest": "sha256:2a8c2e25422b48ebd1fc2c04f6fae356fe0c46c7b6ae41ddd67a7e166206c88c"
},
"layers": [
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"size": 187965818,
"digest": "sha256:f5d46be78e5ee5007db174a73235169653a99894c71ab54a3409c6602846c551"
}
],
"annotations": {
"org.opencontainers.image.revision": "1dcbc451e8783ee8cef562f23bf9af6ad8887950",
"org.opencontainers.image.source": "https://github.com/chainguard-images/images"
}
} |
I'll close this for now. |
I think those annotations are special-cased. For example if we look at the terraform image it sets:
But this is what we get: crane manifest --platform=linux/amd64 cgr.dev/chainguard/terraform | jq .
{
"schemaVersion": 2,
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"config": {
"mediaType": "application/vnd.oci.image.config.v1+json",
"size": 562,
"digest": "sha256:4d52ed817ff416640367d1a4450cfaa4c0e625b1a5dd1f2c9700eb5634a045da"
},
"layers": [
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"size": 21898812,
"digest": "sha256:110f671782bd324fd996f9b3905109b2442ae01e29bcaf3ce76682df64a63967"
}
],
"annotations": {
"org.opencontainers.image.revision": "1dcbc451e8783ee8cef562f23bf9af6ad8887950",
"org.opencontainers.image.source": "https://github.com/chainguard-images/images"
}
} |
I'll try to take a look at this. I see @imjasonh started on it and there's some comments in the code. |
I've gone down a rabbit-hole trying to figure this out. Locally, it seems annotations are being generated and added to the platform specific manifest. I'm not sure if we just need to update the version of apko used in builds. However, Docker does not support annotations in I'll leave this issue open to track the above problem with our builds not including annotations (although it is working locally for me) and I'll open a separate issue for adding labels. |
Fixed the build not including annotations issue in #690 so will close this. |
Also opened #692 to track label support |
It seems that annotations inside an apko yaml file aren't picked up when the image is built. My manifest is
When I run
apko build
it seems to get picked up (by looking at the log). However when I look at the image manifest, the annotations don't exist. I tried loading the image and pushing it to a registry then usingcrane manifest
to check the manifest and still no annotations.apko build log
I also tried
apko publish
but the log seems to indicate the annotations aren't being picked up at all. I also triedcrane manifest
with the published image and it didn't contain any annotations.apko publish log
The text was updated successfully, but these errors were encountered: