diff options
author | baude <bbaude@redhat.com> | 2019-02-19 10:08:43 -0600 |
---|---|---|
committer | baude <bbaude@redhat.com> | 2019-02-20 12:58:05 -0600 |
commit | 711ac9305185e645f2970d09ff76c2761132202a (patch) | |
tree | e8c7c83be19cc075446b20ea49a88c529dda69f1 /libpod/adapter/runtime.go | |
parent | 4de0bf9c74624de8a2cab1e5cbebc0beaa67339a (diff) | |
download | podman-711ac9305185e645f2970d09ff76c2761132202a.tar.gz podman-711ac9305185e645f2970d09ff76c2761132202a.tar.bz2 podman-711ac9305185e645f2970d09ff76c2761132202a.zip |
podman-remote save [image]
Add the ability to save an image from the remote-host to the
remote-client.
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'libpod/adapter/runtime.go')
-rw-r--r-- | libpod/adapter/runtime.go | 12 |
1 files changed, 12 insertions, 0 deletions
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) +} |