Open mangelajo opened 2 years ago
Hi @mangelajo Thanks for creating the issue. Does registry accepts mixed mediaTypes
for schemaVersion: 2
, Not sure but I think here buildah is failing while copying the manifest to remote dest. On quick lookups i was not able to find any documentation for quay.io
and image-spec seems to be missing any reference of mixed types https://github.com/opencontainers/image-spec/blob/main/manifest.md
But I'm unsure about this so tagging @giuseppe @nalind @mtrmac @vrothberg for opinion.
Mixing manifest schemas like this is not expected to work.
Buildah should either explicitly reject that, or (preferably?) convert the input manifests to all use a consistent format before/when creating the manifest. (c/image/copy can convert multi-arch images, but only when explicitly instructed to do so, and it silently assumes[1] the input to be compliant with specs, and that implies using a consistent format.)
[1] In the sense that I can’t immediately point to any code that makes that assumption, but there well might be some and we might not treat it as a bug.
@nalind @flouthoc WDYT?
I think rejecting at buildah end might be more useful for users here instead of silently converting it to consistent format or maybe warn while converting the manifest into the common format.
Makes sense to me.
A friendly reminder that this issue had no activity for 30 days.
@flouthoc are you going to open a PR on this?
@rhatdan Yes I'll open a PR for this. I think i missed this issue from last time.
I just encountered this issue while trying to create a manifest with an image built locally for arm64
and an amd64
image pulled from docker.io
I'm working on running K8ssandra in OpenShift Local on a MacBook with M2 CPU.
I worked around the mixed media problem by: export BUILDAH_FORMAT=docker
so that the locally built image matched the format of the remote image.
I should note that this was with podman
. But, is likely applicable to buildah
since they share the same roots.
A friendly reminder that this issue had no activity for 30 days.
Description
When a manifest is created mixing images pulled from the registry, in a different mediaFormat, and images created locally, it fails to push them to quay later with:
If we inspect the manifest
Steps to reproduce the issue:
Could be further simplified probably, but this is what I used:
Dockerfile
:buildah manifest create quay.io/microshift/cli:4.10.0-0.okd-2022-04-23-131357
buildah pull --arch amd64 quay.io/openshift/okd-content@sha256:5bca6c5df37e9191bda7e265d47473b4cd59c941a3e70966f0f84470d1f65a24
buildah tag quay.io/openshift/okd-content@sha256:5bca6c5df37e9191bda7e265d47473b4cd59c941a3e70966f0f84470d1f65a24 quay.io/microshift/cli:4.10.0-0.okd-2022-04-23-131357-amd64
buildah build-using-dockerfile --override-arch arm64 -f Dockerfile -t quay.io/microshift/cli:4.10.0-0.okd-2022-04-23-131357-arm64 --build-arg VERSION=openshift-clients-4.10.0-202203170916-5-g3e24949fe --build-arg TARGETARCH=arm64 --build-arg REGISTRY=quay.io/microshift --build-arg OKD_TAG=4.10.0-0.okd-2022-04-23-131357 .
buildah manifest add quay.io/microshift/cli:4.10.0-0.okd-2022-04-23-131357 quay.io/microshift/cli:4.10.0-0.okd-2022-04-23-131357-amd64
buildah manifest add quay.io/microshift/cli:4.10.0-0.okd-2022-04-23-131357 quay.io/microshift/cli:4.10.0-0.okd-2022-04-23-131357-arm64
buildah manifest push --all quay.io/microshift/cli:4.10.0-0.okd-2022-04-23-131357 docker://quay.io/microshift/cli:4.10.0-0.okd-2022-04-23-131357
Describe the results you received:
Describe the results you expected: All correctly pushed
Output of
rpm -q buildah
orapt list buildah
:Output of
buildah version
:*Output of `cat /etc/release`:**
Output of
uname -a
:Output of
cat /etc/containers/storage.conf
: