what does docker import command do?

0 votes

What is the functionality of docker import and how is it different from docker load command?

Jul 2 in Docker by Sam
• 1,520 points
35 views

1 answer to this question.

0 votes

docker import command Imports the contents from a tarball to create a filesystem image.

docker import [OPTIONS] file|URL|- [REPOSITORY[:TAG]]

You can specify a URL or - (dash) to take data directly from STDIN. The URL can point to an archive (.tar, .tar.gz, .tgz, .bzip, .tar.xz, or .txz) containing a filesystem or to an individual file on the Docker host. If you specify an archive, Docker untars it in the container relative to the / (root). If you specify an individual file, you must specify the full path within the host. To import from a remote location, specify a URI that begins with the http:// or https:// protocol.

some of the illustrations are as shown below:

Importing from a remote location:

$ docker import http://example.com/exampleimage.tgz

Import to docker from a local archive:

$ docker import /path/to/exampleimage.tgz

Once the tarballs are produced either by docker save or docker import you could use either docker load or docker import whose functions are as given below:

  • docker import creates one image from one tarball which is not even an image (just a filesystem you want to import as an image).  Create an empty filesystem image and import the contents of the tarball.
  • docker load creates potentially multiple images from a tarred repository (since docker save can save multiple images in a tarball). Loads a tarred repository from a file or the standard input stream
answered Jul 2 by Sirajul
• 25,180 points

Related Questions In Docker

0 votes
1 answer

What all platforms does docker run on?

Hey @Albert, docker runs on the following ...READ MORE

answered Feb 12 in Docker by Imran
29 views
0 votes
0 answers

what is the use of docker history command in Docker?

I am trying to find the initial ...READ MORE

Jun 19 in Docker by Shubham
• 1,000 points
26 views
0 votes
1 answer

How do I scale in Docker Swarm Mode W/Terraform Digital Ocean Load Balancing

The solution you could build for Digital ...READ MORE

answered Jun 19, 2018 in Docker by shubham
• 6,890 points
199 views
0 votes
1 answer

How to run a docker command from inside the container?

You must have come across the /var/run/docker.sock file, ...READ MORE

answered Jun 28, 2018 in Docker by Sophie may
• 9,530 points
323 views
0 votes
1 answer
0 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 56,520 points
150 views
0 votes
1 answer

What is a docker file? How do I create a docker image with dockerfile?

 A Dockerfile is a script/text configuration file that contains ...READ MORE

answered Jun 7 in Docker by Sirajul
• 25,180 points
301 views
0 votes
1 answer

How does save and export command work in docker and how are they different from one another?

Export : Export is used to persist a ...READ MORE

answered Jul 2 in Docker by Sirajul
• 25,180 points

edited Jul 2 by Sirajul 27 views