mirror of
https://github.com/containers/podman.git
synced 2025-12-09 07:09:03 +08:00
@@ -27,7 +27,6 @@ func getMainCommands() []*cobra.Command {
|
||||
_mountCommand,
|
||||
_pauseCommand,
|
||||
_portCommand,
|
||||
_pushCommand,
|
||||
_refreshCommand,
|
||||
_restartCommand,
|
||||
_restoreCommand,
|
||||
@@ -57,7 +56,6 @@ func getImageSubCommands() []*cobra.Command {
|
||||
return []*cobra.Command{
|
||||
_buildCommand,
|
||||
_loadCommand,
|
||||
_pushCommand,
|
||||
_saveCommand,
|
||||
_signCommand,
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ var imageSubCommands = []*cobra.Command{
|
||||
_inspectCommand,
|
||||
_pruneImagesCommand,
|
||||
_pullCommand,
|
||||
_pushCommand,
|
||||
_rmiCommand,
|
||||
_tagCommand,
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ var mainCommands = []*cobra.Command{
|
||||
_inspectCommand,
|
||||
_killCommand,
|
||||
_pullCommand,
|
||||
_pushCommand,
|
||||
_rmiCommand,
|
||||
_tagCommand,
|
||||
_versionCommand,
|
||||
|
||||
@@ -2,8 +2,6 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/containers/libpod/cmd/podman/cliconfig"
|
||||
"github.com/spf13/cobra"
|
||||
"io"
|
||||
"os"
|
||||
"strings"
|
||||
@@ -11,11 +9,13 @@ import (
|
||||
"github.com/containers/image/directory"
|
||||
"github.com/containers/image/manifest"
|
||||
"github.com/containers/image/types"
|
||||
"github.com/containers/libpod/cmd/podman/libpodruntime"
|
||||
"github.com/containers/libpod/cmd/podman/cliconfig"
|
||||
"github.com/containers/libpod/libpod/adapter"
|
||||
"github.com/containers/libpod/libpod/image"
|
||||
"github.com/containers/libpod/pkg/util"
|
||||
imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -93,7 +93,7 @@ func pushCmd(c *cliconfig.PushValues) error {
|
||||
registryCreds = creds
|
||||
}
|
||||
|
||||
runtime, err := libpodruntime.GetRuntime(&c.PodmanCommand)
|
||||
runtime, err := adapter.GetRuntime(&c.PodmanCommand)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "could not create runtime")
|
||||
}
|
||||
@@ -131,12 +131,7 @@ func pushCmd(c *cliconfig.PushValues) error {
|
||||
SignBy: signBy,
|
||||
}
|
||||
|
||||
newImage, err := runtime.ImageRuntime().NewFromLocal(srcName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
authfile := getAuthFile(c.Authfile)
|
||||
|
||||
return newImage.PushImageToHeuristicDestination(getContext(), destName, manifestType, authfile, c.SignaturePolicy, writer, c.Compress, so, &dockerRegistryOptions, nil)
|
||||
return runtime.Push(getContext(), srcName, destName, manifestType, authfile, c.SignaturePolicy, writer, c.Compress, so, &dockerRegistryOptions, nil)
|
||||
}
|
||||
|
||||
@@ -324,8 +324,8 @@ type BuildInfo (
|
||||
image_format: string
|
||||
)
|
||||
|
||||
# BuildResponse is used to describe the responses for building images
|
||||
type BuildResponse (
|
||||
# MoreResponse is a struct for when responses from varlink requires longer output
|
||||
type MoreResponse (
|
||||
logs: []string,
|
||||
id: string
|
||||
)
|
||||
@@ -604,9 +604,9 @@ method ListImages() -> (images: []Image)
|
||||
method GetImage(id: string) -> (image: Image)
|
||||
|
||||
# BuildImage takes a [BuildInfo](#BuildInfo) structure and builds an image. At a minimum, you must provide the
|
||||
# 'dockerfile' and 'tags' options in the BuildInfo structure. It will return a [BuildResponse](#BuildResponse) structure
|
||||
# 'dockerfile' and 'tags' options in the BuildInfo structure. It will return a [MoreResponse](#MoreResponse) structure
|
||||
# that contains the build logs and resulting image ID.
|
||||
method BuildImage(build: BuildInfo) -> (image: BuildResponse)
|
||||
method BuildImage(build: BuildInfo) -> (image: MoreResponse)
|
||||
|
||||
# This function is not implemented yet.
|
||||
# method CreateImage() -> (notimplemented: NotImplemented)
|
||||
@@ -624,8 +624,8 @@ method HistoryImage(name: string) -> (history: []ImageHistory)
|
||||
# PushImage takes three input arguments: the name or ID of an image, the fully-qualified destination name of the image,
|
||||
# and a boolean as to whether tls-verify should be used (with false disabling TLS, not affecting the default behavior).
|
||||
# It will return an [ImageNotFound](#ImageNotFound) error if
|
||||
# the image cannot be found in local storage; otherwise the ID of the image will be returned on success.
|
||||
method PushImage(name: string, tag: string, tlsverify: bool, signaturePolicy: string, creds: string, certDir: string, compress: bool, format: string, removeSignatures: bool, signBy: string) -> (image: string)
|
||||
# the image cannot be found in local storage; otherwise it will return a [MoreResponse](#MoreResponse)
|
||||
method PushImage(name: string, tag: string, tlsverify: bool, signaturePolicy: string, creds: string, certDir: string, compress: bool, format: string, removeSignatures: bool, signBy: string) -> (reply: MoreResponse)
|
||||
|
||||
# TagImage takes the name or ID of an image in local storage as well as the desired tag name. If the image cannot
|
||||
# be found, an [ImageNotFound](#ImageNotFound) error will be returned; otherwise, the ID of the image is returned on success.
|
||||
|
||||
Reference in New Issue
Block a user