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