image_save
Save a Docker image as a tar archive, preserving layers and tags for restoration. Choose to write directly to a host file or return the archive bytes in-band.
Instructions
Save an image as a tar archive: to a file on the server host, or in band.
The archive keeps layers, tags, and metadata so image_load can restore it — different from
container_export, which flattens one container's filesystem. With dest_path the archive
streams straight to disk (no byte cap), so it handles large images — the file is written by
the server's user, ~ is expanded, and an existing file is refused unless
overwrite=True. Without dest_path the tar bytes are returned in band, capped at max_bytes
(default 32 MiB) because MCP base64-encodes them — a fallback for when no writable host path
exists (e.g. a containerized server without a bind mount).
args: id_or_name - Image name or id dest_path - Destination path on the server host; omit to return the bytes in band named - Whether to retain repository/tag names in the saved archive overwrite - Replace dest_path if it already exists (default False) max_bytes - In-band mode: abort with ValueError beyond this many bytes (default 32 MiB) returns: bytes | dict - the tarball bytes (in band), or {"path": , "bytes_written": int}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| named | No | ||
| dest_path | No | ||
| max_bytes | No | ||
| overwrite | No | ||
| id_or_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |