-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create archive for the minikube images #7767
Comments
One small problem with this is that the feature is currently broken in
$ docker images k8s.gcr.io/pause
REPOSITORY TAG IMAGE ID CREATED SIZE
k8s.gcr.io/pause 3.2 80d28bedfe5d 2 months ago 683kB
k8s.gcr.io/pause 3.1 da86e6ba6ca1 2 years ago 742kB
$ docker save k8s.gcr.io/pause:3.1 k8s.gcr.io/pause:3.2 > images.tar
$ docker load -i images.tar
Loaded image: k8s.gcr.io/pause:3.1
Loaded image: k8s.gcr.io/pause:3.2
$ podman load -i images.tar
Unexpected tar manifest.json: expected 1 item, got 2
open images.tar/manifest.json: not a directory
Error: error pulling "": unable to pull dir:images.tar: unable to pull image: Error determining manifest MIME type for dir:images.tar: open images.tar/manifest.json: not a directory That is,
$ podman images k8s.gcr.io/pause
REPOSITORY TAG IMAGE ID CREATED SIZE
k8s.gcr.io/pause 3.2 80d28bedfe5d 2 months ago 688 kB
k8s.gcr.io/pause 3.1 da86e6ba6ca1 2 years ago 749 kB
$ podman save k8s.gcr.io/pause:3.1 k8s.gcr.io/pause:3.2 > images.tar
$ docker load -i images.tar
e17133b79956: Loading layer [==================================================>] 744.4kB/744.4kB
Loaded image: k8s.gcr.io/pause:3.1
Loaded image: k8s.gcr.io/pause:3.2
$ docker images k8s.gcr.io/pause
REPOSITORY TAG IMAGE ID CREATED SIZE
k8s.gcr.io/pause 3.1 da86e6ba6ca1 2 years ago 742kB
k8s.gcr.io/pause 3.2 da86e6ba6ca1 2 years ago 742kB So this feature is mostly for containerd and other storage drivers, until podman is fixed... |
The workaround for cri-o (and others, as well) is just to use the current minikube cache... Since it creates one cache file per container image, the problems above are not exposed. The OCI format is not widely used at the moment, so might as well stay with the Docker format. And since by default the layers are stored as .tar.gz, compressing them again don't yield much. |
With the amount of problems this still has, and the lack of benefit vs. the preload - lowered priority. |
One simple option, if wanting a one-file download also for the others is to tar up the cache folder...
386M images.tar |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
(breakout from issue #7737, as a released file)
As an alternative to the current preload tarball, where it cannot be used (for various reasons).
It would contain the same
essentials
andauxiliary
images, but in a more portable formatAdditionally it would work in all container runtimes, the preload requires one tarball for each.
As well as allow loading with all storage drivers, those also require different tarball variants.
Current:
preloaded-images-k8s-v2-v1.18.0-docker-overlay2-amd64.tar.lz4
preloaded-images-k8s-v2-v1.18.0-containerd-overlay2-amd64.tar.lz4
preloaded-images-k8s-v2-v1.18.0-crio-overlay-amd64.tar.lz4
Side note: the overlayfs storage format is just called "overlay" in github.com/containers/storage
(probably because there was no need for a "overlay2" to replace a previous "overlay" attempt*)
* see https://docs.docker.com/storage/storagedriver/overlayfs-driver/
Example:
images-k8s-v1.18.0-amd64.tgz
One could additionally use different format (oci-archive instead of docker-archive) as well as
different compression (xz instead of gz), but then it will not work with all container runtimes.
docker save $images | gzip -9 > images.tgz
podman save --format oci-archive $images > images.tar && xz < images.tar > images.txz
The preload tarball also contains the kubernetes programs, but those would be excluded here.
(e.g.
kubeadm
kubelet
kubectl
, as they are not container images but regular executables)Related issues:
For Docker, the current preload is still the fastest option (prepared format, faster compression)
So this is a portable alternative, with a more compatible format and more compatible compression:
from ./lib/docker/overlay2/ (and friends) to manifest.json (and friends)
from lz4 to gzip
The text was updated successfully, but these errors were encountered: