• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

“docker save” Command Examples

by admin

The command “docker save” is a Docker CLI command that allows you to export one or more Docker images into an archive file. It essentially creates a compressed file that contains all the necessary components of the Docker image, including the layers, metadata, and configuration information.

When you use the “docker save” command, you specify the image or images you want to export, and Docker creates a tarball file (.tar) that encapsulates the selected image(s) and their dependencies. This file can then be transferred to another system or stored for later use.

Once you execute the command, Docker creates a tarball file that includes all the necessary files and information required to recreate the exported image(s). This file can be transferred to another system using various methods such as copying it over a network or using a file transfer protocol.

To import the exported Docker image(s) back into Docker on another system, you can use the “docker load” command, which allows you to load images from a tarball file.

The “docker save” command is useful in scenarios where you need to share or distribute Docker images with others or move them between different environments. It provides a convenient way to package and transport Docker images as a single archive file, making it easier to manage and deploy containers across different systems.

docker save Command Examples

1. Save an image by redirecting stdout to a tar archive:

# docker save image:tag > /path/to/file.tar

2. Save an image to a tar archive:

# docker save --output /path/to/file.tar image:tag

3. Save all tags of the image:

# docker save --output /path/to/file.tar image_name

4. Cherry-pick particular tags of an image to save:

# docker save --output path/to/file.tar image_name:tag1 image_name:tag2 ...

Filed Under: DevOps, Docker, Kubernetes, Linux

Some more articles you might also be interested in …

  1. m4 Command Examples
  2. lualatex Command Examples
  3. mdadm Command Shows State : active, degraded
  4. fdroid: F-Droid build tool
  5. expr: Evaluate expressions and manipulate strings
  6. cmctl: A CLI tool that can help you to manage cert-manager resources inside your cluster
  7. “ntpq -pn” command returns with error “Name or service not known”
  8. gh pr create: Manage GitHub pull requests from the command-line
  9. mkfs.ntfs Command Examples in Linux
  10. How to Manage Zimbra Account Status from CLI

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright