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
Currently, if there are any container images which are not needed by the currently-active containers, the cache rm-img command will delete those images. This is because we're just using the Docker API client's ImagesPrune method. It would be more correct for us to keep any images which are needed by the current and next staged pallet bundles (and maybe also any images needed by the current pallet?), so that those container images are available during boot when we don't have internet access to download any missing container images.
Since image pruning is somewhat complex behind-the-scenes, here are some ideas for how we might implement this fix:
Instead of pruning all images using the Docker API Client, we could just use the Docker API Client to manually delete a list of tagged images, and then we could prune dangling images afterwards.
We could just prune all images not attached to containers, but also keep a cache of all container images in a separate storage (caching: Enable caching & loading of container images in Forklift's cache #245 ) which we can prune ourselves, so that we can load them back into the Docker daemon if they're required but missing on the next boot. This may be somewhat wasteful of SD card space, though, since we'd have two copies of each container image.
Also, the rmImgAction function should be moved from the cmd/forklift/cache/cache.go file to the cmd/forklift/cache/images.go file
The text was updated successfully, but these errors were encountered:
ethanjli
changed the title
cache rm-img shouldn't delete images which might be needed
caching: cache rm-img shouldn't delete images which might be needed
Jun 14, 2024
Currently, if there are any container images which are not needed by the currently-active containers, the
cache rm-img
command will delete those images. This is because we're just using the Docker API client'sImagesPrune
method. It would be more correct for us to keep any images which are needed by the current and next staged pallet bundles (and maybe also any images needed by the current pallet?), so that those container images are available during boot when we don't have internet access to download any missing container images.Since image pruning is somewhat complex behind-the-scenes, here are some ideas for how we might implement this fix:
Also, the
rmImgAction
function should be moved from thecmd/forklift/cache/cache.go
file to thecmd/forklift/cache/images.go
fileThe text was updated successfully, but these errors were encountered: