Open FatmanUK opened 5 months ago
How about doing a docker pull directly from build host docker to cluster?
Possibly upload docker-registry by slow method, enable, then push all apps to it?
Q: How to copy many Docker images into a VM?
A: Stand up a Docker registry (not just podman) on the vm-host.
@vm $ sudo xbps-install -Ay podman
Get the registry image into the vm-host.
@build $ podman image exists docker.io/registry:2.8.1
@build $ [ $? -eq 1 ] && podman image pull docker.io/registry:2.8.1
@build $ podman save docker.io/registry:2.8.1 --format oci-archive -o /dev/shm/registry.tar
@build $ tar cpzf - /dev/shm/registry.tar | ssh vm tar xvpzf - -C /
Run the registry on the VM host.
@vm $ </dev/shm/registry.tar podman load
@vm $ podman run --rm -d -p 5000:5000 --name registry docker.io/registry:2.8.1
For images...
IMG_ID=d6e34de69afe
ORIG_TAG=ghcr.io/dreamtrack-net/kerberos
@build $ podman tag ${IMG_ID} vm:5000/${ORIG_TAG}
@build $ podman push vm:5000/${ORIG_TAG} --tls-verify=false
@vm $ podman pull localhost:5000/${ORIG_TAG} --tls-verify=false
@vm $ podman untag localhost:5000/${ORIG_TAG}
@vm $ podman tag ${IMG_ID} ${ORIG_TAG}
@vm $ podman save ${ORIG_TAG} --format oci-archive -o ~/kerb.tar
No good: tagging and pushing has to happen serially, which makes it takes three times as long. :/
Tagging not needed after all; push with:
podman push {{ image or id }} docker://{{ registry_ip }}:5000/{{ image }} --tls-verify=false
Possibly need --remove-signatures
in there too. If I care about signatures at some point, I can add a check on the build host.
podman save
is nightmarishly slow. I've seen it take 12s to save a single image. Perhaps it would be better to leave the images in podman and push them into crictl later on?
Note to self, look at WiFi 7 routers. Time to replace that crappy TPLINK.
Can I shorten it by collecting all the images into one big tar? Or would that make it worse?