Repository navigation
Description
Describe the bug
toolbox create --distro rhel --version 7.9 fails to pull the correct image base
Steps how to reproduce the behaviour
- podman login to redhat registries (this might be optional)
- Attempt to create a RHEL7 toolbox:
toolbox create --distro rhel --version 7.9 - Mark Y to pull the image
- Note that it attempts to resolve the wrong image for this version of RHEL
Expected behaviour
It should pull from registry.access.redhat.com/ubi7/ubi:7.9
Actual behaviour
It attempts to pull from registry.access.redhat.com/ubi8/ubi:7.9
Screenshots
$ toolbox create --distro rhel --release 7.9 rhel
Image required to create toolbox container.
Download registry.access.redhat.com/ubi8/ubi:7.9 (500MB)? [y/N]: y
Error: failed to pull image registry.access.redhat.com/ubi8/ubi:7.9
Output of toolbox --version (v0.0.90+)
toolbox version 0.0.99.3
Toolbox package info (rpm -q toolbox)
toolbox-0.0.99.3-4.fc36.x86_64
Output of podman version
$ podman version
Client: Podman Engine
Version: 4.1.0
API Version: 4.1.0
Go Version: go1.18
Built: Fri May 6 09:15:54 2022
OS/Arch: linux/amd64
Podman package info (rpm -q podman)
podman-4.1.0-1.fc36.x86_64
Info about your OS
Fedora Linux 36
Additional context
Documented my steps here on ask.fedoraproject.org, but I was able to get it to work by hacking src/pkg/util.go and overriding the rhel definition to work for 7.x and after compiling, it actually does work, however, this hack alone isn't sufficient since it's now hard-coded for EL7 instead of EL8.
"rhel": {
"rhel-toolbox",
"ubi",
parseReleaseRHEL,
"<major.minor>",
"registry.access.redhat.com",
"ubi7",
false,
},
Activity
vwbusguy commentedon Jun 7, 2022
One further point - this EL8 hard-coding also impacts RHEL9 as well:
vwbusguy commentedon Jun 9, 2022
I don't see an obvious simple, elegant solution, but it should be possible to add some logic to intercept the RHEL image repo base and rewrite it to the correct major version at this point here: https://github.com/containers/toolbox/blob/main/src/pkg/utils/utils.go#L312
[-]RHEL7 environments not loaded due to ubi8 hard-coding[/-][+]RHEL7/9 environments not loaded due to ubi8 hard-coding[/+]ClashTheBunny commentedon Jun 19, 2022
I think a better workaround than hacking utils.go would be to just specify the image, not that that fixes the problem...
I can't test this, since it does need the login, but it does try to pull correctly:
You may need to add the
--authfile $XDG_RUNTIME_DIR/containers/auth.jsonoption if podman isn't correctly logged in, but also, no way to test...vwbusguy commentedon Jun 21, 2022
Sure, I agree, but this image path is not obvious to the end user based on tool feedback, which is all the more complicated by this bug still being present in Fedora at the moment.
If it's helpful, a free-as-in-coffee Red Hat Developer Sub should be sufficient for the login credentials to test.
debarshiray commentedon Jan 28, 2023
Sorry about all the confusion here.
The story is that the initial attempt to support RHEL Toolbx containers (ie., commit 21d25f8 or #667) using the base UBI image (ie.,
registry.access.redhat.com/ubi8) was 1.5 years before RHEL 9.0 was released in May 2022. That's why it didn't support RHEL 9. It also didn't support RHEL 7, because RHEL 7 was already too old at that point. It would be quite difficult to drive changes into the distribution for something fairly new like Toolbx to work (well) with it. Hence, the only supported version was RHEL 8.Back then we already knew that, just like the base
registry.fedoraproject.org/fedoraimages, the base UBI image was not ideal for creating Toolbx containers, because it's optimized for deploying services running on servers, not for daily interactive use. eg., it doesn't havesudo(8).That's why, since then, we have put up Toolbx images that are still based on the UBI RPM repositories but are designed for daily interactive use with Toolbx. These are available for both RHELs 8 and 9 at
registry.access.redhat.com/ubi8/toolboxandregistry.access.redhat.com/ubi9/toolboxrespectively. However, RHEL 7, continues to be unsupported due to its age.Neither of these images are part of a Toolbx release because they are relatively new. It took some time to work through the process to add some of the necessary packages to the UBI RPM repositories, then eventually the images themselves, and finally making sure that they are sufficiently tested. Although, astute observers will notice that @HarryMichal had added the Toolbx image for RHEL 8 in current Git
main(ie., commit f456c17) in January 2022, but that was still almost half a year before RHEL 9.0 came out.Anyway, things have fairly settled down by now, so I feel confident about wiring the RHEL 9 image to the
--distroflag too.debarshiray commentedon Jan 28, 2023
Note that none of these images should require any form of authentication. The images under
registry.access.redhat.comshould be publicly available.You don't even need the gratis RHEL Developer Suite to create the container, but you might need it later to unlock more content afterwards.
vwbusguy commentedon Jan 29, 2023
I'm curious when this change was made. It's certainly a welcome one.
pkg/utils: Be more strict about what is acceptable
pkg/utils: Support RHEL 9 Toolbx containers
pkg/utils: Be more strict about what is acceptable
pkg/utils: Support RHEL 9 Toolbx containers
debarshiray commentedon Jan 29, 2023
It's been like this from the first time I started poking at UBI and the Red Hat OCI registries. The images on
registry.access.redhat.comhave always been public, but there's another registry atregistry.redhat.iothat requires authentication.Note that the
toolboximage for RHEL 9.0 seems to be oddly tagged on the registry. It only has a9.0.0tag and no9.0tag, while both are present for the RHEL 9.1 image.debarshiray commentedon Jan 29, 2023
I have attempted to add support for RHEL 9 Toolbx containers in #1220