From 711ac9305185e645f2970d09ff76c2761132202a Mon Sep 17 00:00:00 2001 From: baude Date: Tue, 19 Feb 2019 10:08:43 -0600 Subject: podman-remote save [image] Add the ability to save an image from the remote-host to the remote-client. Signed-off-by: baude --- libpod/adapter/runtime.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libpod/adapter/runtime.go') diff --git a/libpod/adapter/runtime.go b/libpod/adapter/runtime.go index 02ef9af07..b12f63cdc 100644 --- a/libpod/adapter/runtime.go +++ b/libpod/adapter/runtime.go @@ -310,3 +310,15 @@ func (r *LocalRuntime) Build(ctx context.Context, c *cliconfig.BuildValues, opti func (r *LocalRuntime) PruneVolumes(ctx context.Context) ([]string, []error) { return r.Runtime.PruneVolumes(ctx) } + +// SaveImage is a wrapper function for saving an image to the local filesystem +func (r *LocalRuntime) SaveImage(ctx context.Context, c *cliconfig.SaveValues) error { + source := c.InputArgs[0] + additionalTags := c.InputArgs[1:] + + newImage, err := r.Runtime.ImageRuntime().NewFromLocal(source) + if err != nil { + return err + } + return newImage.Save(ctx, source, c.Format, c.Output, additionalTags, c.Quiet, c.Compress) +} -- cgit v1.2.3-54-g00ecf