Forrest logo
back to the docker tool

docker:tldr:76c5f

docker: Save an image by redirecting `stdout` to a tar archive.
$ docker save ${image}:${tag} > ${filename-tar}
try on your machine

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

Here's a breakdown of the command:

  • docker save: This is the Docker command that is used to save an image.
  • ${image}:${tag}: This refers to the image name and tag. The ${image} variable represents the name of the Docker image, and the ${tag} variable represents the tag assigned to that image. For example, if the image name is myapp and the tag is latest, this part of the command would be myapp:latest.
  • >: This is a shell redirect operator that is used to redirect the output of the command to a file.
  • ${filename-tar}: This is the name of the output tar file that will be created. The ${filename} variable represents the desired name of the file, and the -tar suffix is added to indicate that it is a tar file. For example, if the desired output file name is myapp-image, this part of the command would be myapp-image.tar.

So, when you run this command, it will save the specified Docker image as a tar file with the provided filename.

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