[distrobuilder] How to compile a Centos container image in an Ubuntu environment (Github Action)?

Since I need some pre-built tools to install into my Centos system, how do I create and package a container image through distrobuilder in an Ubuntu environment?
I tried to build it using

sudo distrobuilder build-incus centos.yaml -o image.release=7 -o image.architecture=amd64 -o image.variant=cloud

but it seems that I can’t run the program:

Error: Error while downloading source: Failed to get release: Failed to find release

By default, it seems that I can only create and package container images on Ubuntu for systems that use apt as a package manager, such as kali.
Are there any examples? I’m a newbie and I’m happy to learn from any success stories.

All our images are built on Ubuntu or Debian systems.

We build the standard CentOS 7 image with:

distrobuilder build-incus centos.yaml -o image.serial=20240115_07:08 -o image.architecture=x86_64 -o image.release=7 -o image.variant=default -o packages.manager=yum

So I suspect the issue in your case would have been the image architecture causing the files to not be found on the CentOS servers.

You can look at the logs at https://jenkins.linuxcontainers.org/ to see exactly how we call distrobuilder. The same calls can be found in the jenkins/jobs directory of lxc-ci.

Thank you very much, I found that I can use -o image.architecture=amd64 only when compiling ubuntu, debian, kali and I have to use -o image.architecture=x86_64 when compiling other images such as centos, my problem is solved, thanks for the help!

But this raises another query for me, if I want to compile an image for, say, arm64 architecture, I have to make sure that the host for the compilation is arm64 architecture right? Or can I compile container images for arm64 architecture on amd64 architecture.

When I tried to compile archlinux:

distrobuilder build-incus archlinux.yaml -o image.release=current -o image.architecture=x86_64 -o image.variant=cloud -o packages.manager=pacman

I checked https://archive. archlinux.org/iso/ there is no corresponding file, so it caused the error:

Error: Error while downloading source: Failed to download "https://archive.archlinux.org/iso//current/archlinux-bootstrap-current-x86_64.tar.gz": Unable to fetch https://archive.archlinux.org/iso//current/archlinux-bootstrap-current-x86_64.tar.gz: 404 Not Found

May I ask if there is something wrong with what I wrote?

You’re trying to build archlinux cloud current on intel 64bit, that matches:
https://jenkins.linuxcontainers.org/job/image-archlinux/architecture=amd64,release=current,variant=cloud/

If you go see the log, you’ll see we run distrobuilder with:

-o image.serial=20240115_04:18 -o image.architecture=x86_64 -o image.variant=cloud

We do not pass a -o image.release

Thanks!