Skip to content
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

CentOS Stream 9 build failure #51

Closed
lttlrck opened this issue Jul 9, 2024 · 5 comments · Fixed by #52
Closed

CentOS Stream 9 build failure #51

lttlrck opened this issue Jul 9, 2024 · 5 comments · Fixed by #52

Comments

@lttlrck
Copy link

lttlrck commented Jul 9, 2024

any clues as to the problem here? It's looking for repo configs that do not exist:

[stuart@vulcan]~% d2vm convert registry.xyz.com/pe/platform:latest -o test.qcow2
Using local image registry.xyz.com/pe/platform:latest
Inspecting image registry.xyz.com/pe/platform:latest
Docker image based on CentOS Stream 9
Building kernel enabled image
Error: docker image build -t ab500c7d-ef6b-4012-b554-5c1781d46db9 -f /tmp/d2vm/ab500c7d-ef6b-4012-b554-5c1781d46db9/registry.xyz.com_protocol-pe /tmp/d2vm/ab500c7d-ef6b-4012-b554-5c1781d46db9: stdout: Sending build context to Docker daemon  3.584kB
Step 1/6 : FROM registry.xyz.com/pe/platform:latest
 ---> 4f46cc6167a1
Step 2/6 : USER root
 ---> Running in 4432ffaa6169
Removing intermediate container 4432ffaa6169
 ---> 9646c3d19f94
Step 3/6 : RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* &&     sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
 ---> Running in 31ec456c9280
sed: can't read /etc/yum.repos.d/CentOS-*: No such file or directory
 stderr: DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            Install the buildx component to build images with BuildKit:
            https://docs.docker.com/go/buildx/

in the container:

[root@control]# ll /etc/yum.repos.d/
total 32
drwxr-xr-x. 1 root root  194 Jun 25 23:09 .
drwxr-xr-x. 1 root root 3156 Jul  9 15:11 ..
-rw-r--r--. 1 root root 4245 Mar 20 17:57 centos-addons.repo
-rw-r--r--. 1 root root 2600 Mar 20 17:57 centos.repo
-rw-r--r--. 1 root root 1142 Aug 17  2023 epel-cisco-openh264.repo
-rw-r--r--. 1 root root 1552 Aug 17  2023 epel-testing.repo
-rw-r--r--. 1 root root 1453 Aug 17  2023 epel.repo
-rw-r--r--. 1 root root  174 Jun 25 23:09 google-chrome.repo
[root@control protocolEngine]# uname -r
6.0.12-100.fc35.x86_64
[root@control protocolEngine]# cat /etc/centos-release
CentOS Stream release 9
[root@control protocolEngine]# yum repolist enabled
repo id                     repo name
appstream                   CentOS Stream 9 - AppStream
baseos                      CentOS Stream 9 - BaseOS
epel                        Extra Packages for Enterprise Linux 9 - x86_64
epel-cisco-openh264         Extra Packages for Enterprise Linux 9 openh264 (From Cisco) - x86_64
extras-common               CentOS Stream 9 - Extras packages
google-chrome               google-chrome

thanks!

@Adphi
Copy link
Member

Adphi commented Jul 9, 2024

Hi @lttlrck, thank you for your interest in the project 😀 !

It seems that centos 9 has changed the name of the repository definition files.
As a result, the fix used previously no longer works. I don't even know if it's still necessary...

RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && \
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

I'll have a look as soon as I can.

@lttlrck
Copy link
Author

lttlrck commented Jul 9, 2024

Thanks for the quick reply. Yes I suspect they are unnecessary. I will attempt to remove those lines from d2vm/templates/centos.Dockerfile

I also tried with --raw, I am not sure what it omits, it does build the qcow2. But it doesn't boot:

image

/boot/ looks correct though. Perhaps this is expected with --raw?

[root@f87441a3eeca protocolEngine]# ll /boot/
total 39964
dr-xr-xr-x. 1 root root      410 Jul  9 16:11 .
drwxr-xr-x. 1 root root      356 Jul  9 16:20 ..
-rw-r--r--. 1 root root      160 Jul  2 17:20 .vmlinuz-5.14.0-474.el9.x86_64.hmac
-rw-------. 1 root root  8844402 Jul  2 17:20 System.map-5.14.0-474.el9.x86_64
-rw-r--r--. 1 root root   224976 Jul  2 17:20 config-5.14.0-474.el9.x86_64
drwxr-xr-x. 1 root root        6 Jun 25 23:07 efi
drwx------. 1 root root        0 May 29 08:14 grub2
-rw-------. 1 root root 17432170 Jul  9 16:11 initramfs-5.14.0-474.el9.x86_64.img
drwxr-xr-x. 1 root root       14 Jul  9 16:11 loader
lrwxrwxrwx. 1 root root       45 Jul  9 16:11 symvers-5.14.0-474.el9.x86_64.gz -> /lib/modules/5.14.0-474.el9.x86_64/symvers.gz
-rwxr-xr-x. 1 root root 14407720 Jul  2 17:21 vmlinuz-5.14.0-474.el9.x86_64

@Adphi Adphi linked a pull request Jul 9, 2024 that will close this issue
@Adphi
Copy link
Member

Adphi commented Jul 9, 2024

@lttlrck this is expected.
When you use the --raw flag, you are supposed to provide a fully bootable image, i.e. with the kernel and boot loader already configured.

@lttlrck
Copy link
Author

lttlrck commented Jul 9, 2024

@lttlrck this is expected. When you use the --raw flag, you are supposed to provide a fully bootable image, i.e. with the kernel and boot loader already configured.

I modified the template and it converts and boots :-)

I had to make more changes because I am using microdnf instead of yum/dnf but this is amazing thank you.

@lttlrck lttlrck closed this as completed Jul 9, 2024
@Adphi
Copy link
Member

Adphi commented Jul 9, 2024

@lttlrck You're welcome!

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

Successfully merging a pull request may close this issue.

2 participants