Why Sometimes it can be handy to have a copy of a container image locally or being able to manually copy a docker image from one computer to another. Recently I had an issue where newly built Kubernetes worker nodes did not work properly due to the fact that the flannel pod image was hosted on quay.io , which was not available at the time. The "fix" was to manually export the image from a server which had flannel running just fine and import on the new worker nodes (and restart the flannel pods). Export Assuming we want to save / export the image below: $ docker images REPOSITORY TAG IMAGE ID CREATED SIZE kindest/node <none> af39c553b6de 2 weeks ago 1.12GB We run docker save with the image id and redirect the output into a new local file. $ docker save af39c553b6de > kindest-node.tar Once done, we end up with a new tar file, which can be compressed optionally. $ ls -lah kindest-node.tar -rw-rw-r-- 1 user user 1.1G Jun 6 12:11 kinde
Everything Unix, Cloud and Kubernetes