8

I'm new to Docker, and would like to use it in an air-gapped environment. I understand I can set up my own repository inside my isolated system, but I don't know how to get the many docker images I need from the docker hub into the environment. If I could download them to a .zip or .tgz archive, that would be great, but don't see a way to do that from the hub. I can't use Docker outside the isolated environment. I may be able to use git outside my air-gapped environment, but getting .zip archives would be much better. Advice on how to get started will be appreciated.

Dave
  • 1,973
  • 2
  • 17
  • 18

1 Answers1

13

You can do the following to produce an archive file for any image on the Hub:

docker pull image:tag
docker save image:tag -o file.tar

Then transfer file.tar to the air-gapped machine and just do:

docker load -i file.tar

If you actually have an air-gapped network, rather than a single machine, it's probably a better idea to set up your own registry within the network that contains your curated images.

Adrian Mouat
  • 44,585
  • 16
  • 110
  • 102
  • Thanks for the response Adrian, but I can't run Docker outside of my isolated environment. I'm looking for something like a repository of archive files, or a Docker JVM or .NET client that will do the pull and save you mentioned without requiring Docker to be installed. – Dave May 16 '15 at 18:21
  • 1
    Why can't you run Docker outside the isolated environment? You could also easily write your own client to do this. – Adrian Mouat May 17 '15 at 10:59
  • How, in broadest terms, would you suggest writing my own client? What protocols, file formats and directory structures and the like? – Dave May 18 '15 at 17:08
  • You could just write a bash script that `docker save`s the requested image into the directory of an FTP or HTTP download server. – Adrian Mouat May 18 '15 at 17:27
  • 2
    @Dave I know this is four years old at this point, but I'm curious what was keeping you from running docker outside of your isolated environment. Doesn't it just require installing docker on any machine outside of the isolated environment? Is it a security rule for the air-gapped environment? If so, what is the thought behind that rule? – T.C. Proctor Apr 19 '19 at 15:14
  • @t-c-proctor I can't answer for Dave, but in my case the "just installing docker" becomes the problem. They don't want docker installed without the air gap. As far as the thought behind the rule, best to assume none. – OtherDevOpsGene Aug 27 '19 at 17:23