Docker Community Forums

Share and learn in the Docker community.

Download an image from a server

Hello,
this is my first step with this forum and docker.

I need to download an image docker from a server to save it on my computer in case there is a problem with the server.

Impossible to find to good command.
Could you help me please ?

When downloaded, is is only one file (it is better) ?

Thank you.

Jeremie

If it’s enough docker pull downloads an image and keeps it untill you delete it.
But if you want a file you can tinker with docker save exports an image to a file.

Thank for your response.
I have tried docker pull but it is not enough.
It seems to have a password… so I have tried with “docker login pull …” but no result.
I have never the possibility to enter a password. Username, yes but not the password…

docker login -p pull URL/image_name

Looks like your image is on a private registry. You have to do a plain docker login <repository url> first.
If you image is myregistry.com/testimage you have to do docker login myregistry.com

Ok thank you.
I have to wait for the good credentials now …
Maybe tomorrow …
Bye

Hello,
I have try the docker pull command. It seems we do not need credentials.
Here this is what I have by executing the command. But no image downloaded…
Any idea please ?

root@coucou:/home/test# docker pull docker.hello.com:5000/image_name:latest
Using default tag: latest
latest: Pulling from image_name
Digest: sha256:xxxxxxxxxxxxxxxxxxxxxxxx
Status: Image is up to date for docker.hello.com:5000/image_name:latest

Then everything is fine. Docker saves the images once downloaded. The message Status: Image is up to date for docker.hello.com:5000/image_name:latest tells you that you already have the latest image downloaded.

Try deleting the image with docker image rm docker.hello.com:5000/image_name:latest and pull it again with docker pull docker.hello.com:5000/image_name:latest.

In fact I try to download the image in order not to depends on the docker repository on the server.

By doing docker pull, I don not know where the file is downloaded, for example if I want to put it on a DVD…
If the server crash I need to have a backup of the image on my computer…

I try to do a “docker save”, and with this command I have a downloaded file…
And by doing a “docker load” I can generate my image…?

Yes. docker save saves your image to a file and docker load converts the file back to an usable image.

ok thank you,
So docker pull do not save the image but just load the image from a server …

Many thanks

Android Download Image from MySQL Database
First go to your hosting account. For this tutorial I am using free hosting account by hostinger.
In last tutorial we created two scripts. One for database connection and other one for storing image to database. …
Create a new PHP file. …
Copy the following code.

1 Like