-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
podman load from buildctl using type oci results in incorrect name #12560
Comments
@vrothberg @mtrmac PTAL |
tl;dr buildkit is adding a Looking at the {
"schemaVersion": 2,
"manifests": [
{
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"digest": "sha256:e3b23b57855e132673409165a5a6559180c32d273399f13cf078163fea7398a0",
"size": 505,
"annotations": {
"io.containerd.image.name": "github.com/mattouille/whatever:latest",
"org.opencontainers.image.created": "2021-12-10T10:19:54Z",
"org.opencontainers.image.ref.name": "latest"
}
}
]
} The It would be trivial to support that but I am convinced that buildkit should fix that and properly set the |
Archives generated with buildkit have some kind of "hybrid" layout which is the same for OCI and Docker archives. OCI ones ship with a manifest.json but set the image's reference in the index.json but in a custom annotation and not the one the OCI image spec wants. Archives in the Docker format set the reference in `RepoTags` of the manifest.json. To support these archives, simply look for the custom containerd annotation *and* change the order back to give OCI archives precedence. Fixes: containers/podman/issues/12560 Signed-off-by: Valentin Rothberg <[email protected]>
containers/common#853 adds support for buildkit archives. |
Archives generated with buildkit have some kind of "hybrid" layout which is the same for OCI and Docker archives. OCI ones ship with a manifest.json but set the image's reference in the index.json but in a custom annotation and not the one the OCI image spec wants. Archives in the Docker format set the reference in `RepoTags` of the manifest.json. To support these archives, simply look for the custom containerd annotation *and* change the order back to give OCI archives precedence. Fixes: containers/podman/issues/12560 Signed-off-by: Valentin Rothberg <[email protected]>
Archives generated with buildkit have some kind of "hybrid" layout which is the same for OCI and Docker archives. OCI ones ship with a manifest.json but set the image's reference in the index.json but in a custom annotation and not the one the OCI image spec wants. Archives in the Docker format set the reference in `RepoTags` of the manifest.json. To support these archives, simply look for the custom containerd annotation *and* change the order back to give OCI archives precedence. Fixes: containers/podman/issues/12560 Signed-off-by: Valentin Rothberg <[email protected]>
Archives generated with buildkit have some kind of "hybrid" layout which is the same for OCI and Docker archives. OCI ones ship with a manifest.json but set the image's reference in the index.json but in a custom annotation and not the one the OCI image spec wants. Archives in the Docker format set the reference in `RepoTags` of the manifest.json. To support these archives, simply look for the custom containerd annotation *and* change the order back to give OCI archives precedence. Fixes: containers/podman/issues/12560 Signed-off-by: Valentin Rothberg <[email protected]>
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Images produced with buildctl are not resulting in the specified names when loaded into podman. This issue has been discussed before and was thought to be an issue with BuildKit (#11619). After speaking with the BuildKit team, however, it looks like other tooling like containerd implement workarounds for this.
Steps to reproduce the issue:
buildctl --addr=podman-container://buildkitd build --frontend dockerfile.v0 --local context=. --local dockerfile=. --export-cache type=inline --frontend-opt filename=Dockerfile --output type=oci,name=github.com/mattouille/whatever,dest=/tmp/whatever_image.tar
podman load -i /tmp/whatever_image.tar
podman images -a
Note: You can also use the stdout/in feature of podman and buildkit. The result is the same.
Describe the results you received:
The image name, regardless of the name specified, is
localhost/latest:latest
Describe the results you expected:
The image name is
github.com/mattouille/whatever:latest
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):N/A. Installed from source.
Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
Physical
The text was updated successfully, but these errors were encountered: