Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

buildah (1.38.0) bud --all-platforms --manifest - not resolving manifest specified in a build-arg (FROM $BUILDARG) #5850

Open
grooverdan opened this issue Nov 29, 2024 · 1 comment

Comments

@grooverdan
Copy link

The base manifest mariadb-5293-ubi was created with buildah (create, add).

The `buildah bud --all-platforms . --build-arg BASE=mariadb-52293-ubi Containerfile..

With a basic container file beginning:

ARG BASE
FROM $BASE

Fails to resolve the base manifest. With and without and explicit localhost/ prefix.


$ buildah manifest inspect mariadb-52293-ubi
{
    "schemaVersion": 2,
    "mediaType": "application/vnd.oci.image.index.v1+json",
    "manifests": [
        {
            "mediaType": "application/vnd.oci.image.manifest.v1+json",
            "size": 2668,
            "digest": "sha256:3dcb8be60079a6f7bdaa888ac4236ea132f1e255945af8446b4b6acbf1b20f73",
            "platform": {
                "architecture": "amd64",
                "os": "linux"
            }
        }
    ]
}
(base) 
/tmp/bt 
$ podman run --rm mariadb-52293-ubi echo "Help"
Help

$ buildah bud --all-platforms --jobs 4 --manifest  mariadb-52293-ubi-debug --build-arg BASE=mariadb-52293-ubi -f mariadb-docker/Containerfile.debug-ubi

? Please select an image: 
  ▸ registry.fedoraproject.org/mariadb-52293-ubi:latest
    registry.access.redhat.com/mariadb-52293-ubi:latest
    docker.io/library/mariadb-52293-ubi:latest

Pushing this manifest to a full tag didn't resolve this either

$ buildah tag mariadb-52293-ubi domain.with.name/mariadb-52293-ubi:tag 

$ podman run --rm  domain.with.name/mariadb-52293-ubi:tag  echo "Help"
Help

$ buildah bud --all-platforms --jobs 4 --manifest  mariadb-52293-ubi-debug --build-arg BASE=domain.with.name/mariadb-52293-ubi:tag -f mariadb-docker/Containerfile.debug-ubi
Error: base image name "domain.with.name/mariadb-52293-ubi:tag" didn't resolve to a manifest list
(base) 


$ buildah version
Version: 1.38.0
Go Version: go1.23.2
Image Spec: 1.1.0
Runtime Spec: 1.2.0
CNI Spec: 1.1.0
libcni Version:
image Version: 5.33.0
Git Commit:
Built: Wed Nov 13 03:29:52 2024
OS/Arch: linux/amd64
BuildPlatform: linux/amd64
(base)
/tmp/bt
$ buildah info
{
"host": {
"CgroupVersion": "v2",
"Distribution": {
"distribution": "fedora",
"version": "41"
},

@grooverdan
Copy link
Author

grooverdan commented Nov 29, 2024

Note explicit use of --platform resolves this;

$ buildah bud --platform  linux/amd64 --jobs 4 --manifest  mariadb-52293-ubi-debug --build-arg BASE=domain.with.name/mariadb-52293-ubi:tag -f mariadb-docker/Containerfile.debug-ubi
STEP 1/4: FROM domain.with.name/mariadb-52293-ubi:tag
STEP 2/4: USER root
....

But not a short version:

buildah manifest inspect "$devmanifest" | tee "${t}"
+ buildah manifest inspect mariadb-52293-ubi
+ tee /tmp/tmp.fww4TiapX5
{
    "schemaVersion": 2,
    "mediaType": "application/vnd.oci.image.index.v1+json",
    "manifests": [
        {
            "mediaType": "application/vnd.oci.image.manifest.v1+json",
            "size": 2668,
            "digest": "sha256:b7e1e0a1fab554076472ec497115ade427bb01f1b6638ca02134a11a6e968e23",
            "platform": {
                "architecture": "amd64",
                "os": "linux"
            }
        }
    ]
}
trap 'manifest_image_cleanup "$devmanifest" "$t"' EXIT
+ trap 'manifest_image_cleanup "$devmanifest" "$t"' EXIT

if [ "$prod_environment" = "True" ]; then
  buildah manifest push --all "$devmanifest" "docker://quay.io/mariadb-foundation/mariadb-devel:${container_tag}"
  echo "${container_tag}" > last_tag
else
  rm -f last_tag
fi
+ '[' False = True ']'
+ rm -f last_tag

#
# MAKE Debug manifest

debugmanifest=${image}-debug
+ debugmanifest=mariadb-52293-ubi-debug

## intentionally array to simple
# shellcheck disable=SC2124
archlist="${arches[@]}"
+ archlist=linux/amd64
# comma separated
archlist=${archlist// /,}
+ archlist=linux/amd64
buildah bud --platform "${archlist}" --jobs 4 --manifest "$debugmanifest" --build-arg BASE="$image" -f "mariadb-docker/Containerfile.debug$ubi"
+ buildah bud --platform linux/amd64 --jobs 4 --manifest mariadb-52293-ubi-debug --build-arg BASE=mariadb-52293-ubi -f mariadb-docker/Containerfile.debug-ubi
STEP 1/4: FROM mariadb-52293-ubi
? Please select an image: 
  ▸ registry.fedoraproject.org/mariadb-52293-ubi:latest
    registry.access.redhat.com/mariadb-52293-ubi:latest
    docker.io/library/mariadb-52293-ubi:latest

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant