Image Caching
Minishift provides the image
command together with its sub-commands to control the behavior of image caching. To export and import images from the Docker daemon of the Minishift VM, use minishift image export
and minishift image import
.
Once the Minishift VM is running, images can be explicitly exported from the Docker daemon:
Pulling image <image-name-0> .. OK
Exporting <image-name-0>. OK
Pulling image <image-name-1> .. OK
Exporting <image-name-2>. OK
To import previously cached images, use the minishift image import
command:
$ minishift image import <image-name-0> <image-name-1> ...
Importing <image-name-0> . OK
To view currently cached images on the host:
To view images available in the Docker daemon:
$ minishift image list --vm
openshift/origin-haproxy-router:v3.6.0
openshift/origin-pod:v3.6.0
openshift/origin:v3.6.0
In order to avoid having to type the image names explicitly as part of the image export
or image import
command, you can store a list of image names for import and export in the persistent configuration.
Use to view the list of currently configured images and minishift image cache-config add
to add images to the list:
$ minishift image cache-config view
$ minishift image cache-config add alpine:latest busybox:latest
$ minishift image cache-config view
alpine:latest
busybox:latest
To remove images from the list use :
Once the image names are stored in the persistent configuration, you can run minishift image export
and without any arguments.
Image caching is enabled by default for Minishift. It occurs in a background process after the minishift start
command is completed for the first time. Once the images are cached under $MINISHIFT_HOME/cache/images, successive Minishift VM creations will use these cached images.
To disable this feature you need to disable the image-caching
property in the persistent configuration using the command:
You can re-enable the caching of the OpenShift images by setting image-caching
to true
or removing the setting altogether using minishift config unset
:
$ minishift config unset image-caching
To delete an image from the local cache, use the command: