MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

Docker Tutorials: Difference between Docker Load and Docker Import

DevOpsSchool banner: Difference between Docker Load and Docker Import, with Docker logo

If you want to “flatten” an image and avoid the history which has multiple layers, docker export and import is the best way to do that.

docker save – docker save will indeed produce a tarball, but with all parent layers, and all tags + versions.

docker export – docker export does also produce a tarball, but without any layer/history.

However, once those tarballs are produced, load/import are there to:

docker import – 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 – 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

 

[CODE]$ docker run -it ubuntu
$ cd /opt/
root@20a8011f2e65:/opt# touch DevOpsSchool.com
root@20a8011f2e65:/opt# ls
DevOpsSchool.com

CNTRL + P + Q

$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
20a8011f2e65 ubuntu “/bin/bash” 24 seconds ago Up 23 seconds thirsty_wilson

$ docker export -o ubuntu-devops.tar 20a8011f2e65
$ docker help import
Usage: docker import [OPTIONS] file|URL|- [REPOSITORY[:TAG]]
Import the contents from a tarball to create a filesystem image

Options:
-c, –change list Apply Dockerfile instruction to the created image
–help Print usage
-m, –message string Set commit message for imported image

$ docker import -m”ubuntu+devopsschool” ubuntu-devops. tar
sha256:c9b6e68b24325d86c511cd45071e69cacd185835b427c83f1cecf7e2e001b13e

$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
c9b6e68b2432 4 seconds ago 69.8MB

$ docker tag c9b6e68b2432 ubuntu-devopsschool.com
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu-devopsschool.com latest c9b6e68b2432 25 seconds ago 69.8MB

$ docker run -itd ubuntu-devopsschool.com ls /opt
04ed9676981d943f85de58b9885f0347f4ed11c96d97546d484173b7fcd48101

$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
20a8011f2e65 ubuntu “/bin/bash” 2 minutes ago Up 2 minutes

$ docker exec 20a8011f2e65 ls /opt
DevOpsSchool.com

$ docker history ubuntu-devopsschool.com
IMAGE CREATED CREATED BY SIZE COMMENT
c9b6e68b2432 About a minute ago 69.8MB ubuntu+devopsschool[/CODE]

Docker Tutorials Fundamental To Advanced-2021 Crash Course:- https://bit.ly/3hOIbTB

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

Install Sonatype Nexus with Docker: RM2/RM3 Commands, Validation Steps, and Important Caveats

A structured, production-minded rewrite of the original 2016 Docker setup for Sonatype Nexus Repository Manager 2 and 3. Includes command examples, a workflow diagram, and clear warnings about outdated tags/endpoints.

Read More

Docker Lab & Assignment – Creating an Image

Here’s a detailed Tutorial and Lab Guide for the listed Docker commands, focused on practical usage, explanations, and step-by-step labs with Ubuntu + git + apache2 as…

Read More

Docker commands Guide – docker tag with examples

Here’s a complete tutorial on docker tag, covering what it does, examples, and use cases. What is docker tag? docker tag is a Docker command that creates…

Read More

Docker commands Guide – docker save with examples

Here’s a complete tutorial on docker save and docker load, covering what they do, examples, and use cases. What are docker save and docker load? Key Features:…

Read More

Docker commands Guide – docker rmi with examples

Here’s a complete tutorial on docker rmi, including what it does, examples, and use cases. What is docker rmi? docker rmi is a Docker command used to…

Read More

Docker commands Guide – docker load with examples

Here’s a complete tutorial on docker load, covering what it does, examples, and use cases. What is docker load? docker load is a Docker command used to…

Read More