Save an image
UseexecuteRawEndpoint(new Docker\API\Endpoint\ImageGet($imageName)) and
require HTTP 200, then save the body in chunks using the
archive download pattern. The default
generated imageGet() result is null; it does not give you a tar stream.
For more than one image, use new ImageGetAll(['names' => ['image-a:tag', 'image-b:tag']]) with the raw endpoint. Specify the names explicitly rather
than accidentally exporting every image on the daemon.
Load an image archive
Loading creates or updates image records and tags on the daemon. Use a tar produced by an image-save operation and a development daemon. This call has noBuildStream/CreateImageStream wrapper; its progress response must be
handled separately.
Root-filesystem import is different
imageCreate() with fromSrc imports a root filesystem, not an image-save
archive. Use fromSrc => '-' for a request-body import, or a source URL for
the daemon to download. Remote source URLs are fetched by the daemon, not PHP;
do not accept arbitrary URLs from untrusted callers.
In this API line, imageCreate()’s request body is ?string, unlike the
resource/PSR-7-stream bodies supported by imageBuild(), imageLoad() and
putContainerArchive(). Do not pass a file resource to imageCreate() and
expect it to behave like an image load. Choose the operation and payload type
deliberately, especially for large archives.