Q. How can I download an image from Docker to a container host without Internet connectivity?
A. Normally images can be pulled directly from repositories such as Docker Hub however if a machine does not have Internet connectivity and the repository is not on-premises than it will not be possible to download images. An alternate approach is to download the images from a machine that has internet connectivity, save the image to a file, copy to the container host then import.
To save a downloaded image (assuming pulled already using docker pull) to file use:
docker save -o <output location>.docker <image name>:<tag, e.g. latest or specific version>
Then once copied to the target container host (could use Copy-Item to a session via -ToSession) to import use
docker load -i <imagename>.docker
Then check it is shown (docker images).
[Container World delivers real-world case studies from the cloud-native ecosystem, hands-on technical education, the best speakers and cutting-edge startups under one roof. Get your ticket.]