Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

Docker Tutorials: Difference between Docker Load and Docker Import

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 a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at <a href="https://www.cotocus.com/">Cotocus</a>. I share tech blog at <a href="https://www.devopsschool.com/">DevOps School</a>, travel stories at <a href="https://www.holidaylandmark.com/">Holiday Landmark</a>, stock market tips at <a href="https://www.stocksmantra.in/">Stocks Mantra</a>, health and fitness guidance at <a href="https://www.mymedicplus.com/">My Medic Plus</a>, product reviews at <a href="https://www.truereviewnow.com/">TrueReviewNow</a> , and SEO strategies at <a href="https://www.wizbrand.com/">Wizbrand.</a> Do you want to learn <a href="https://www.quantumuting.com/">Quantum Computing</a>? <strong>Please find my social handles as below;</strong> <a href="https://www.rajeshkumar.xyz/">Rajesh Kumar Personal Website</a> <a href="https://www.youtube.com/TheDevOpsSchool">Rajesh Kumar at YOUTUBE</a> <a href="https://www.instagram.com/rajeshkumarin">Rajesh Kumar at INSTAGRAM</a> <a href="https://x.com/RajeshKumarIn">Rajesh Kumar at X</a> <a href="https://www.facebook.com/RajeshKumarLog">Rajesh Kumar at FACEBOOK</a> <a href="https://www.linkedin.com/in/rajeshkumarin/">Rajesh Kumar at LINKEDIN</a> <a href="https://www.wizbrand.com/rajeshkumar">Rajesh Kumar at WIZBRAND</a> <a href="https://www.rajeshkumar.xyz/dailylogs">Rajesh Kumar DailyLogs</a>

Related Posts

Docker Tutorials: Docker Image – Understanding Dockerfiles instructions & options

Here’s a step-by-step tutorial for Dockerfile, including explanations and examples for each major command. Dockerfile Tutorial A Dockerfile is a text file containing instructions to build a…

Read More

Docker Tutorials: Docker Image – Example and Sample Programs of Dockerfile

Reference Rajesh Kumar I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at Cotocus. I share tech blog at DevOps School, travel stories…

Read More

Docker Tutorials: Installation and Configurations

Docker Installation in Centos/RHEL Method -1: How to install Docker Community Edition via YUM? Step 1 – Install required packages. yum-utils provides the yum-config-manager utility, and device-mapper-persistent-data…

Read More

Docker Tutorials: How to Install Docker in Ubuntu?

Install Docker Engine in Ubuntu NOTE – All commands you must run as root user or add a current user into a linux group name called “docker”…

Read More

Docker Lab, Excercise & Assignment – 7 – Docker Volume

Below is a very detailed tutorial and lab manual for learning Docker Volumes, using the Ubuntu image for practical, hands-on labs. This covers all major types of…

Read More

Docker Lab, Excercise & Assignment – 4 – Docker Networking

Here’s an in-depth, step-by-step tutorial and lab manual for Docker Networking—starting from basics, covering all core concepts, and providing a hands-on guide to every feature and command….

Read More