Skip to content

Implement multi-arch image building for devfile-index & devfile-index-base #1547

Closed
@Jdubrick

Description

@Jdubrick

Which area is this issue related to?

/area registry

Issue Description

Currently when trying build devfile-index-base and devfile-index with --platform linux/arm64 you are presented with:

WARNING: image platform (linux/amd64) does not match the expected platform (linux/arm64)

This is most likely due to the base builder image not supporting arm64. Newer versions of that builder should support it.

The Dockerfile used to build devfile-index also contains amd64 dependencies. This will cause the image to build for amd64 even if --platform linux/arm64 is passed on most machines that won't fully emulate (I believe the newest version of Podman is doing this). This will need to be dynamically set based on the architecture the build is trying to run for.

Additionally, we should implement manifest creation so that we can build and store the images as multi-arch so that both architectures are supported. It may also be good to implement the manifest creation, multi-arch building, and pushing to the existing build.sh, push.sh and build_registry.sh scripts we are already using.

Once the manifest is created and apart of the repository, any automation that is currently building images for this repository and pushing them should be doing so to the manifest to allow for multi-arch pulling.

Below is an example from Red Hat Developer:

# First, initialise the manifest
podman manifest create <image name>

# Build the image attaching them to the manifest
podman build --platform linux/amd64,linux/arm64  --manifest <image name>  .

# Finally publish the manifest
podman manifest push <image name>

Acceptance criteria

  • Warnings about base image not supporting arm64 architecture cleared
  • amd64 dependency in Dockerfile handled to dynamically set
  • devfile-index-base able to be built as multi-arch
  • devfile-index able to be built as multi-arch
  • Any automations building images and pushing to quay.io should be pushing to that manifest

Metadata

Metadata

Assignees

Labels

area/registryDevfile registry for stacks and infrastructure

Type

No type

Projects

Status

Done ✅

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions