← 返回命令列表

Linux command

docker-image-save 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Save image to tar archive

docker image save -o [image.tar] [image]

Save to stdout

docker image save [image] > [image.tar]

Save multiple images

docker image save -o [images.tar] [image1] [image2]

Save with compression

docker image save [image] | gzip > [image.tar.gz]

说明

docker image save saves one or more Docker images to a tar archive, packaging all image layers, configuration, and metadata into a single file. This command is designed for transferring images between systems without using a registry, backing up important images, or distributing images via offline media. The resulting tar archive contains the complete image structure, including all filesystem layers, image manifests, and configuration JSON. Multiple images can be saved to a single archive, which is useful for bundling related images together. Output can be directed to a file with -o or to stdout, allowing for flexible integration with compression tools like gzip or transmission over network connections. Use docker image load to restore images from these archives.

参数

-o, --output _file_
Write to file instead of stdout.

FAQ

What is the docker-image-save command used for?

docker image save saves one or more Docker images to a tar archive, packaging all image layers, configuration, and metadata into a single file. This command is designed for transferring images between systems without using a registry, backing up important images, or distributing images via offline media. The resulting tar archive contains the complete image structure, including all filesystem layers, image manifests, and configuration JSON. Multiple images can be saved to a single archive, which is useful for bundling related images together. Output can be directed to a file with -o or to stdout, allowing for flexible integration with compression tools like gzip or transmission over network connections. Use docker image load to restore images from these archives.

How do I run a basic docker-image-save example?

Run `docker image save -o [image.tar] [image]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -o, --output _file_ do in docker-image-save?

Write to file instead of stdout.