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, 2019 in Docker by Sam
• 6,260 points
6,629 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, 2019 by Sirajul
• 59,230 points

Related Questions In Docker

+1 vote
0 answers

What does COMMAND in 'docker ps' mean?

docker ps or docker container ls displays ...READ MORE

Apr 20, 2022 in Docker by pranav
• 2,590 points
1,164 views
0 votes
1 answer

What all platforms does docker run on?

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

answered Feb 13, 2019 in Docker by Imran
841 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 20, 2019 in Docker by Shubham
• 1,000 points
1,451 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
• 7,340 points
1,520 views
+2 votes
1 answer
+2 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
• 58,020 points
2,730 views
+1 vote
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, 2019 in Docker by Sirajul
• 59,230 points
4,530 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, 2019 in Docker by Sirajul
• 59,230 points

edited Jul 2, 2019 by Sirajul 6,990 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP