Mattia Dinosaur
Mattia Dinosaur

Reputation: 920

Where can i get docker image off line?

In my working environment , i can't connect to the network, but i can connect to the download machine ,which can connect to network .

But i do not know how to find a docker image and download it .

The website docker hub just show the command such as "docker pull nginx" , but i can't connect to the network ,it is useless for me .

My question:

Now, I have install docker by download docker-engine.deb. where can I get a docker image off line?

Upvotes: 0

Views: 2086

Answers (1)

lvthillo
lvthillo

Reputation: 30723

You'll need access to a registry where docker images are stored. But if you don't have images and no registry with images yet, than you have to pull the image from the internet.

A recommended way could be:

Install docker on a machine (maybe your local machine) with internet access and pull an image:

$ docker pull busybox

Use docker save to make a .tar of your image

$ docker save busybox > busybox.tar

or you can use the following syntax

$ docker save --output busybox.tar busybox

Reference is here.

You can use a tool like scp to send the .tar to your Docker server where you don't have internet access. Now you can use docker load to extract the .tar and get your image:

$ docker images

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE

$ docker load < busybox.tar.gz

Loaded image: busybox:latest
$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
busybox             latest              769b9341d937        7 weeks ago         2.489 MB

Reference is here

Upvotes: 2

Related Questions