summaryrefslogtreecommitdiff
path: root/libpod/adapter/runtime.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-02-13 18:42:00 +0100
committerGitHub <noreply@github.com>2019-02-13 18:42:00 +0100
commit62d88558e7637b72ea9ef53d1b3a2d08f2c6a51e (patch)
tree94834334f7b22ae6e914a3cfabe68c9bf5bde968 /libpod/adapter/runtime.go
parentdf52dac1e70ea04dc3de8e7372e23c47f06291d6 (diff)
parent7dcc21f21311ee1ff3fe6974d5926bec7d181e5c (diff)
downloadpodman-62d88558e7637b72ea9ef53d1b3a2d08f2c6a51e.tar.gz
podman-62d88558e7637b72ea9ef53d1b3a2d08f2c6a51e.tar.bz2
podman-62d88558e7637b72ea9ef53d1b3a2d08f2c6a51e.zip
Merge pull request #2322 from baude/remotepush
podman-remote push
Diffstat (limited to 'libpod/adapter/runtime.go')
-rw-r--r--libpod/adapter/runtime.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/libpod/adapter/runtime.go b/libpod/adapter/runtime.go
index 2b1ddb09d..acaecf4b5 100644
--- a/libpod/adapter/runtime.go
+++ b/libpod/adapter/runtime.go
@@ -4,18 +4,19 @@ package adapter
import (
"context"
- "github.com/pkg/errors"
"io"
"io/ioutil"
"os"
"strconv"
+ "github.com/containers/image/docker/reference"
"github.com/containers/image/types"
"github.com/containers/libpod/cmd/podman/cliconfig"
"github.com/containers/libpod/cmd/podman/libpodruntime"
"github.com/containers/libpod/libpod"
"github.com/containers/libpod/libpod/image"
"github.com/containers/libpod/pkg/rootless"
+ "github.com/pkg/errors"
)
// LocalRuntime describes a typical libpod runtime
@@ -190,3 +191,12 @@ func (r *LocalRuntime) CreateVolume(ctx context.Context, c *cliconfig.VolumeCrea
func (r *LocalRuntime) RemoveVolumes(ctx context.Context, c *cliconfig.VolumeRmValues) ([]string, error) {
return r.Runtime.RemoveVolumes(ctx, c.InputArgs, c.All, c.Force)
}
+
+// Push is a wrapper to push an image to a registry
+func (r *LocalRuntime) Push(ctx context.Context, srcName, destination, manifestMIMEType, authfile, signaturePolicyPath string, writer io.Writer, forceCompress bool, signingOptions image.SigningOptions, dockerRegistryOptions *image.DockerRegistryOptions, additionalDockerArchiveTags []reference.NamedTagged) error {
+ newImage, err := r.ImageRuntime().NewFromLocal(srcName)
+ if err != nil {
+ return err
+ }
+ return newImage.PushImageToHeuristicDestination(ctx, destination, manifestMIMEType, authfile, signaturePolicyPath, writer, forceCompress, signingOptions, dockerRegistryOptions, nil)
+}