image_save
Save a Docker image as a tar archive to a server-host file or return it in-band as base64 bytes, preserving layers, tags, and metadata for later restore.
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: 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 max_bytes: In-band mode: abort with ToolInputError 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 |