Forrest logo
back to the docker tool

docker:tldr:e22a9

docker: Save an image to a tar archive.
$ docker save --output ${filename-tar} ${image}:${tag}
try on your machine

This command is used to save a Docker image as a tar file.

Here is an explanation of each component of the command:

  • docker save: This is the Docker command used to save an image.
  • --output ${filename-tar}: This flag specifies the output file name for the tar archive that will contain the saved Docker image. ${filename-tar} is a variable that needs to be replaced with the desired name for the tar file (e.g., myimage.tar).
  • ${image}:${tag}: This part of the command represents the Docker image you want to save. ${image} refers to the name of the Docker image (e.g., myimage). ${tag} refers to the specific version or tag of the image (e.g., latest or v1.0).

So, in summary, this command saves a Docker image and exports it as a tar archive with the specified file name.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the docker tool