How to load docker images without using pull command?

Is there any way to load docker image / container using Fx.
Firefox and not using the built-in docker-pull .

I am blocked by the company’s firewall and proxy and I can’t get through it.

EDIT Well, then I think I should do it. My problem is that I cannot use docker to get images. IE Docker Saving / Pulling and other docker features as it is blocked by firewall.

+6
source share
4 answers

Just an alternative. This is what I did in my organization for couchbase , where I was blocked by a proxy.

On my personal laptop (OSX)

 ~$ $ docker save couchbase > couchbase.tar ~$ ls -lh couchbase.docker -rw------- 1 vikas devops 556M 12 Dec 21:15 couchbase.tar ~$ xz -9 couchbase.tar ~$ ls -lh couchbase.tar.xz -rw-r--r-- 1 vikas staff 123M 12 Dec 22:17 couchbase.tar.xz 

Then I uploaded the compressed tarball to Dropbox and uploaded it to my working computer. For some reason Dropbox was open :)

On my work laptop (CentOS 7)

 $ docker load < couchbase.tar.xz 

References

+5
source

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 :/# 
+4
source

First check if your docker daemon is configured to use a proxy server.
For example, with boot2docker and a docker machine, this is done to create docker machines with the --engine-env option.

If this is just a certificate issue (for example, Firefox makes access to DockerHub), try installing this certificate :

 openssl s_client -connect index.docker.io:443 -showcerts /dev/null | openssl x509 -outform PEM > docker.pem sudo cp docker.pem /etc/pki/ca-trust/source/anchors/ sudo update-ca-trust sudo systemctl restart docker sudo docker run hello-world 

Another solution (not a recommended solution) would be to access the --insecure-registry hub without using the --insecure-registry certificate :

If the firewall is actively blocking any docker save attempts, to the point that you cannot even access DockerHub from Firefox, you need a docker save / docker load image archive. Save it from the computer on which you accessed the Docker Hub (and where the remote docker failed). Download it to your corporate computer (after the approval of your IT administrators, of course).

Note: you cannot simply “simply” upload an image because it is often based on other images that you also need to download.
This is what docker pull does for you.
And this is exactly what docker save does (create one archive consisting of all the necessary images)

OP Ephreal adds in the comments :

[I] did not receive an image of my case for work.
But I found that I can download the docker file and recreate the image from scratch .
This is essentially the same as loading an image.

+1
source

Thus, by definition, the docker click client command should actually talk to the docker daemon, because the docker daemon collects layers one by one for you.

Think of it as a POST request - that it causes a state mutation in the docker itself. You do not pull anything over HTTP when you try.

You can pull all the individual layers from REST from the docker registry, but this will not really be the same semantics as attraction, because pull is an action that specifically tells the daemon to go and gets all the layers for the image you care about.

0
source

All Articles