Skip to content

always offer to pull latest image when creating a toolbox #873

Open

Description

@juhp

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).

Activity

  1. added
    1. Feature request
    on Sep 10, 2021
  2. added a commit that references this issue on Sep 13, 2021
    89596de
  3. juhp commented on Oct 15, 2021

    @juhp
    ContributorAuthor

    Implemented in #875

  4. added this to the Release 0.2.0 milestone on Oct 25, 2021
  5. added
    2. Container Configuration
    on Oct 25, 2021
  6. martymichal commented on Oct 25, 2021

    @martymichal
    Member

    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.

  7. juhp commented on Oct 25, 2021

    @juhp
    ContributorAuthor

    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.

    Okay sure: looking forward to seeing more

  8. martymichal commented on Oct 25, 2021

    @martymichal
    Member

    That sounds very interesting. How would that be possible?

    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.

  9. debarshiray commented on Nov 16, 2021

    @debarshiray
    Member

    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?

  10. juhp commented on Nov 16, 2021

    @juhp
    ContributorAuthor

    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 filesystem can't be dnf updated.)

  11. added a commit that references this issue on Nov 16, 2021
    8bfbbf4
  12. debarshiray commented on Nov 17, 2021

    @debarshiray
    Member

    (Also filesystem can't be dnf updated.)

    This one is #643, which should be fixed now.

  13. debarshiray commented on Nov 17, 2021

    @debarshiray
    Member

    Conversely, why would you not want to create a new toolbox with
    the latest image?

    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:

    • It can negatively impact disk space.
    • It can clutter up the toolbox list output 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:

    • Sharing the DNF caches to reduce network traffic.
    • Prompting the user that a new image is now available, so that they can manually migrate.
  14. oturpe commented on Nov 29, 2021

    @oturpe
    Contributor

    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?

    1. At a time when toolbox:36 image is Rawhide,
    2. need a Rawhide toolbox, get it with toolbox create --release 36.
    3. Time passes, Fedora 36 is branched and toolbox:36 is re-defined to mean that.
    4. Need a Fedora 36 toolbox, try to get it with toolbox create --release 36.
    5. Expected result: get a Fedora 36 toolbox
    6. 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.

  15. debarshiray commented on Nov 29, 2021

    @debarshiray
    Member

    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.

  16. oturpe commented on Nov 29, 2021

    @oturpe
    Contributor

    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.

  17. debarshiray commented on Dec 15, 2021

    @debarshiray
    Member

    Yes, #646 is a much safer change to implement.

  18. debarshiray commented on Jul 22, 2025

    @debarshiray
    Member

    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-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 list
    IMAGE ID      IMAGE NAME                                     CREATED
    6fddd81bb158  <none>                                         12 days ago
    3aa55ef0b00a  registry.fedoraproject.org/fedora-toolbox:42   16 hours ago
    
    CONTAINER ID  CONTAINER NAME     CREATED      STATUS  IMAGE NAME
    31453ee9f926  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.):

    $ podman inspect --format '{{.Image}} {{.ImageName}}' --type container fedora-toolbox-42
    6fddd81bb1585137fc3550846d5aa6b7cc99b188ff07bac37e35ae46d3495fdf registry.fedoraproject.org/fedora-toolbox:42

    Same in /run/.containerenv:

    ⬢ $ cat /run/.containerenv 
    engine="podman-5.5.2"
    name="fedora-toolbox-42"
    id="31453ee9f92652b3065d34a10f1dbbf84a84e2e90eea3572825b88c20a041f83"
    image="registry.fedoraproject.org/fedora-toolbox:42"
    imageid="6fddd81bb1585137fc3550846d5aa6b7cc99b188ff07bac37e35ae46d3495fdf"
    rootless=1
    graphRootMounted=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    1. Feature request2. Container Configuration

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions