Skip to content

Yum and rockylinux:[8|9]-minimal base #519

@lgorenstein

Description

@lgorenstein

It appears that base images rockylinux:[8|9]-minimal do not contain yum or dnf executable (only the rpm one). Which brings havoc when using building blocks that depend on having yum (e.g. the mkl() one).

Clearly not including yum/dnf was an intentional choice Rocky made for the -minimal container. In itself, this is is not a big problem in HPCCM context (there's always a slightly larger yum-containing regular rockylinux:[8|9] base image instead). But this could bite someone trying to do a multistage build using -minimal for the runtime stage (similar to the multistage example with Nvidia's -devel and -base). Perhaps HPCCM could add internal logic to install yum if yum is not in the image?


The two-stage MKL recipe that crashed on the second stage and led me to discovery:

Stage0 += baseimage(image='rockylinux:9', _as='devel')
Stage0 += mkl(eula=True, version='2020.0-088')

Stage1 += baseimage(image='rockylinux:9-minimal')
Stage1 += Stage0.runtime(_from='devel')

Or the smallest reproducible example.py with a single stage:

Stage0 += baseimage(image='rockylinux:9-minimal')
Stage0 += mkl(eula=True, version='2020.0-088')

Generated Singularity definition file:

$ hpccm --version
25.3.0

$ hpccm --recipe example.py --format singularity --singularity-version 3.8
BootStrap: docker
From: rockylinux:9-minimal
%post
    . /.singularity.d/env/10-docker*.sh

# MKL version 2020.0-088
%post
    rpm --import https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
    yum install -y dnf-utils
   ^^^^^^^^^^^^^^^^^^^^^^^^^^
[...]

Which then bombs out when building the container:

$ singularity build example.sif example.def
[,,,.]
INFO:    Running post scriptlet
+ . /.singularity.d/env/10-docker2singularity.sh
++ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ rpm --import https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
+ yum install -y dnf-utils
/.post.script: line 5: yum: command not found
FATAL:   While performing build: while running engine: while running %post section: exit status 127

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions