You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
always offer to pull latest image when creating a toolbox #873
Is your feature request related to a problem? Please describe.
We frequently see bug reports caused by people having an old toolbox image cached locally.
Describe the solution you'd like toolbox create should offer to pull down the latest image being requested.
For extra points it could check if a newer image exists first.
Additional context
I am imagining something like this:
$ toolbox create
A newer fedora-toolbox:34 image is available, do you want to download it? [Y/n]
I think this is the least surprising behavior (though personally I would always want to pull the latest image).
Reacted by Andrii Maksymets, Martin Vala and Otto Liljalaakso
A large number of images can accumulate this way. Disk space is not so expensive nowadays but say 10 images will take up circa 5GB on a system.
But generally I agree with you that this is a concern and I have a solution in mind that pulls in the latest images and also migrates older containers to those images. I have yet to create a prototype and address some concerns regarding the approach, though.
I'd be willing to go with this before my solution is done but I'd like to make also some changes to the way images are listed. The list of images could get very long. I think (did not test locally) #875 is a bit naive solution and could be more harmful than helpful, though.
A large number of images can accumulate this way. Disk space is not so expensive nowadays but say 10 images will take up circa 5GB on a system.
You are right: it would be better to purge older unused toolbox images.
But generally I agree with you that this is a concern and I have a solution in mind that pulls in the latest images and also migrates older containers to those images.
That sounds very interesting. How would that be possible?
I'd be willing to go with this before my solution is done but I'd like to make also some changes to the way images are listed. The list of images could get very long. I think (did not test locally) #875 is a bit naive solution and could be more harmful than helpful, though.
We frequently see bug reports caused by people having an
old toolbox image cached locally.
Umm... do you have some examples of these bug reports?
I know that people struggle to switch from Rawhide to a freshly branched unstable Fedora at the branching point. Anything else?
Have we ever pushed out badly broken images for stable Fedoras? Ultimately users can always 'dnf update' their containers, can't they?
At a time when toolbox:36 image is Rawhide,
need a Rawhide toolbox, get it with toolbox create --release 36.
Time passes, Fedora 36 is branched and toolbox:36 is re-defined to mean that.
Need a Fedora 36 toolbox, try to get it with toolbox create --release 36.
Expected result: get a Fedora 36 toolbox
Actual result: get a Rawhide toolbox
The image was not badly broken at the time is was created,
just had a confusing name,
but the resulting container in step 4 is badly broken,
because dnf does not point to repositories of the requested release.
I have reported this before in this comment.
Would you like to have this logged separately also?
Apart from automatically pulling, or prompting for pulling, new images,
this could also be solved through #646.
Switching from Fedora Rawhide to Branched is already a known and understood issue (and isn't specific to containers). I was looking for other problems that we have come across over time.
Switching from Fedora Rawhide to Branched is already a known and understood issue (and isn't specific to containers). I was looking for other problems that we have come across over time.
My example is not about switching from Rawhide to Branched.
At step 2, the user needs, and gets, a new Rawhide container.
It can stay Rawhide forever without affecting the rest of the steps.
At step 4, the user needs a new Fedora 36 container.
At this point, they are not interested in Rawhide at all.
But because Toolbx
a) first defines --release 36 to mean Rawhide, but later re-defines it to mean Fedora 36, and
b) does not pull latest images on create,
the user unexpectedly gets Rawhide in step 4.
Doing what is proposed in this issue would fix b),
fixing #646 would fix a).
Fix one, and the problem disappears.
EDIT: Ok, if you by "switching from Rawhide to Branched" mean
what I mean by "re-defines it to mean Fedora 36",
then indeed this is caused by that.
We might be able to solve the problem of garbage collecting older images, if we can figure out how to rebase existing containers on top of newer images (see #1358).
While playing with this today, I found some weird quirks. I don't know if they would be considered Podman bugs or if they are expected behaviour, but they might be surprising anyway. So, I will leave them here to save my future self and others some head-scratching. :)
I had an existing fedora-toolbox-42 container created from an older version of the registry.fedoraproject.org/fedora-toolbox:42 image. Then I did a podman pull ... on the same image, and got:
$ toolbox listIMAGE ID IMAGE NAME CREATED6fddd81bb158 <none> 12 days ago3aa55ef0b00a registry.fedoraproject.org/fedora-toolbox:42 16 hours agoCONTAINER ID CONTAINER NAME CREATED STATUS IMAGE NAME31453ee9f926 fedora-toolbox-42 12 days ago exited registry.fedoraproject.org/fedora-toolbox:42
Notice how the older image lost its name (in podman images, etc.), but the container still remembers it (in podman ps, etc.):
Activity
create: always offer to pull latest image (fixes: containers#873)
juhp commentedon Oct 15, 2021
Implemented in #875
martymichal commentedon Oct 25, 2021
A large number of images can accumulate this way. Disk space is not so expensive nowadays but say 10 images will take up circa 5GB on a system.
But generally I agree with you that this is a concern and I have a solution in mind that pulls in the latest images and also migrates older containers to those images. I have yet to create a prototype and address some concerns regarding the approach, though.
I'd be willing to go with this before my solution is done but I'd like to make also some changes to the way images are listed. The list of images could get very long. I think (did not test locally) #875 is a bit naive solution and could be more harmful than helpful, though.
juhp commentedon Oct 25, 2021
You are right: it would be better to purge older unused toolbox images.
That sounds very interesting. How would that be possible?
Okay sure: looking forward to seeing more
martymichal commentedon Oct 25, 2021
I have a theory that is only a theory now. When I have a prototype, I'll let the community know :). Maybe it will work and maybe it will not.
debarshiray commentedon Nov 16, 2021
Umm... do you have some examples of these bug reports?
I know that people struggle to switch from Rawhide to a freshly branched unstable Fedora at the branching point. Anything else?
Have we ever pushed out badly broken images for stable Fedoras? Ultimately users can always 'dnf update' their containers, can't they?
juhp commentedon Nov 16, 2021
I will have to go hunting for examples: there should be enough around.
Conversely, why would you not want to create a new toolbox with the latest image?
(Also
filesystemcan't be dnf updated.)create: always offer to pull latest image (fixes: containers#873)
debarshiray commentedon Nov 17, 2021
This one is #643, which should be fixed now.
debarshiray commentedon Nov 17, 2021
If there were no other trade-offs, yes, I would always want to use the latest image.
However, if a user keeps accumulating a large number of images, then:
toolbox listoutput and make it difficult to get a feel for what images are locally available.These are trade-offs, and we need to figure out what the right balance is. That's why I was curious about examples of bugs caused by stale images.
There could be other ways of looking at this too:
oturpe commentedon Nov 29, 2021
toolbox:36image is Rawhide,toolbox create --release 36.toolbox:36is re-defined to mean that.toolbox create --release 36.The image was not badly broken at the time is was created,
just had a confusing name,
but the resulting container in step 4 is badly broken,
because dnf does not point to repositories of the requested release.
I have reported this before in this comment.
Would you like to have this logged separately also?
Apart from automatically pulling, or prompting for pulling, new images,
this could also be solved through #646.
debarshiray commentedon Nov 29, 2021
Switching from Fedora Rawhide to Branched is already a known and understood issue (and isn't specific to containers). I was looking for other problems that we have come across over time.
oturpe commentedon Nov 29, 2021
My example is not about switching from Rawhide to Branched.
At step 2, the user needs, and gets, a new Rawhide container.
It can stay Rawhide forever without affecting the rest of the steps.
At step 4, the user needs a new Fedora 36 container.
At this point, they are not interested in Rawhide at all.
But because Toolbx
a) first defines
--release 36to mean Rawhide, but later re-defines it to mean Fedora 36, andb) does not pull latest images on
create,the user unexpectedly gets Rawhide in step 4.
Doing what is proposed in this issue would fix b),
fixing #646 would fix a).
Fix one, and the problem disappears.
EDIT: Ok, if you by "switching from Rawhide to Branched" mean
what I mean by "re-defines it to mean Fedora 36",
then indeed this is caused by that.
debarshiray commentedon Dec 15, 2021
Yes, #646 is a much safer change to implement.
debarshiray commentedon Jul 22, 2025
I found myself thinking about this today.
We might be able to solve the problem of garbage collecting older images, if we can figure out how to rebase existing containers on top of newer images (see #1358).
While playing with this today, I found some weird quirks. I don't know if they would be considered Podman bugs or if they are expected behaviour, but they might be surprising anyway. So, I will leave them here to save my future self and others some head-scratching. :)
I had an existing
fedora-toolbox-42container created from an older version of theregistry.fedoraproject.org/fedora-toolbox:42image. Then I did apodman pull ...on the same image, and got:Notice how the older image lost its name (in
podman images, etc.), but the container still remembers it (inpodman ps, etc.):Same in
/run/.containerenv: