DEV Community

Joseph D. Marhee
Joseph D. Marhee

Posted on

13 1

Exporting images with Containerd CLI (ctr)

I recently found that a Docker image I use as a part of one of my Helm charts was no longer available on DockerHub, and I hadn't mirrored it in another location. It was running in a K3s cluster, meaning I couldn't docker tag original-maintainer/image:tag me/image:tag it and push to the Hub myself back on my local machine, which was running the Docker CLI.

First, logging into a node with the image on it, I ran the following:

ctr -n k8s.io images export bind9:9.11.tar docker.io/internetsystemsconsortium/bind9:9.11 --platform linux/amd64
Enter fullscreen mode Exit fullscreen mode

which exported the image to a tarball. This is similar to docker image save.

Then, pulling it down to my Docker CLI machines:

scp jdmarhee@192.168.0.60:bind9:9.11.tar .
Enter fullscreen mode Exit fullscreen mode

I then load the image from the tarball:

 docker image load --input bind9\:9.11.tar
Enter fullscreen mode Exit fullscreen mode

which returns the original tag for the image (internetsystemsconsortium/bind9:9.11) so I can re-tag it and push:

docker image tag internetsystemsconsortium/bind9:9.11 jmarhee/bind9:9.11

docker push jmarhee/bind9:9.11
Enter fullscreen mode Exit fullscreen mode

Now this image is available on Docker Hub for my (and your) new clusters to access.

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more