I just had to deal with this problem myself - downloading an image from a limited computer with Internet access, but not a Docker client for use on another limited computer with a Docker client, but without access to the Internet. I submitted my question to the DevOps StackExchange website :
With the help of the Docker community, I was able to find a solution to my problem. The following is my decision.
So, it turns out that the Moby Project has a shell script on Moby Github that can load images from the Docker Hub in a format that can be imported into Docker:
The usage syntax for the script is defined as follows:
download-frozen-image-v2.sh target_dir image[:tag][@digest] ...
You can then import the image using tar and docker load :
tar -cC 'target_dir' . | docker load
To make sure the script works as expected, I downloaded the Ubuntu image from the Docker Hub and uploaded it to the Docker:
user@host :~$ bash download-frozen-image-v2.sh ubuntu ubuntu:latest user@host :~$ tar -cC 'ubuntu' . | docker load user@host :~$ docker run --rm -ti ubuntu bash root@1dd5e62113b9 :/
In practice, I will have to first copy the data from the Internet client (which does not have Docker installed) to the target / target machine (which has Docker installed):
user@nodocker :~$ bash download-frozen-image-v2.sh ubuntu ubuntu:latest user@nodocker :~$ tar -C 'ubuntu' -cf 'ubuntu.tar' . user@nodocker :~$ scp ubuntu.tar user@hasdocker :~
and then download and use the image on the target host:
user@hasdocker :~ docker load ubuntu.tar user@hasdocker :~ docker run --rm -ti ubuntu bash root@1dd5e62113b9 :/
source share