User Learning
User Learning

Reputation: 3473

How to load a Docker image from a tar file

I have installed Docker for Windows. I have downloaded HDP_2.5_docker.tar from http://hortonworks.com/downloads/#sandbox which is a 10 GB file.

How can I load an image tar file? I have tried this command:

docker import HDP_2.5_docker.tar

Upvotes: 108

Views: 328837

Answers (4)

Amit Pathak
Amit Pathak

Reputation: 1367

Load the desired docker file, assuming you are in the same directory as the tar file, you can use -

$ docker load -i filename.tar

On successful import, you will see a success message along with the image ID

Check in the docker images for the image ID that you just received:

docker images

You will see the docker loaded successfully in the docker images list. However, there is one thing worth mentioning in case you might get confused; the date reflected in the command output might reflect the date when docker is created. Assuming, docker got created 5 days ago then the same will be shown in the output. Better way to confirm if your docker is loaded or not is to check for the image ID or repo and tag name (if you know).

You can finally run the docker using the command -

$ docker run -it image-ID

Upvotes: 19

xxxx_XXXXXX_xxxxx
xxxx_XXXXXX_xxxxx

Reputation: 199

you can do:

docker image import file.tar images_name:image_tag

Upvotes: 19

VladoDemcak
VladoDemcak

Reputation: 5259

You can use docker load

Usage:  docker load [OPTIONS]

Load an image from a tar archive or STDIN

Git bash console:

docker load < HDP_2.5_docker.tar

Windows cmd:

docker load -i windowsservercore.tar

Upvotes: 148

Tuo Zhang
Tuo Zhang

Reputation: 281

Firstly, put the tar file under your user folder: i.e: C:\Users\yourName\xxx.tar

Secondly, run the Docker load CMD:

docker load -i xxx.tar

After it is done, we could see the file is loaded as Docker images by running CMD:

docker images

Upvotes: 28

Related Questions