nanobox
nanobox copied to clipboard
Image cache management - purge and prune
trafficstars
I've run into a few issues with my image cache:
- My image cache gets really big and eats up all my VMs disk space
- In one case, my VM died while extracting a image. Now I can't pull the image, because docker sees that the directory it's trying to pull into isn't empty.
I think we need to provide a way to manage the image cache. Maybe even an image command with subcommands. Possibly something like:
# list cached images
nanobox image ls
# update all images
nanobox image update
# update a specific image
nanobox image update nanobox/mysql:5.6
# purge all images
nanobox image rm --all
# OR
nanobox image purge
# remove a specific image
nanobox image rm nanobox/mysql:5.6
# prune unused images (images no longer used by registered apps)
nanobox image prune
Part of the reason that image caches grow is because when a data component is provisioned, we use the current version of the image. When a new image is available, we can't re-provision the data component because it would wipe the data, so the old out-dated image has to be kept around. We need to provide a way to migrate data from containers using old images to containers using new images:
nanobox image migrate
This is going to migrate all data from containers using old images
to new containers using updated images. This process may take a while.
Would you like to proceed? (Y/n)
We may even want to run a nanobox image update before the migration and a nanobox image prune after.