aboutsummaryrefslogtreecommitdiff
path: root/libpod/container_api.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-03-15 10:06:49 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-03-20 16:20:12 +0000
commit38a1b2f16d210525eafcc845e7a9cce598207113 (patch)
tree5616a12d68ebe55138fbde85f936a6bc90d4c8fd /libpod/container_api.go
parentecfa321288f10b70a59166f93296c77d262317fc (diff)
downloadpodman-38a1b2f16d210525eafcc845e7a9cce598207113.tar.gz
podman-38a1b2f16d210525eafcc845e7a9cce598207113.tar.bz2
podman-38a1b2f16d210525eafcc845e7a9cce598207113.zip
Image library stage 4 - create and commit
Migrate the podman create and commit subcommandis to leverage the images library. I also had to migrate the cmd/ portions of run and rmi. Signed-off-by: baude <bbaude@redhat.com> Closes: #498 Approved by: mheon
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r--libpod/container_api.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go
index ef94aa4c9..27c7994f4 100644
--- a/libpod/container_api.go
+++ b/libpod/container_api.go
@@ -1,16 +1,18 @@
package libpod
import (
+ "io"
"io/ioutil"
"os"
"strconv"
"time"
- "github.com/containers/storage"
"github.com/docker/docker/daemon/caps"
"github.com/docker/docker/pkg/stringid"
+ ociv1 "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
"github.com/projectatomic/libpod/libpod/driver"
+ "github.com/projectatomic/libpod/libpod/image"
"github.com/projectatomic/libpod/pkg/inspect"
"github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/util/wait"
@@ -532,7 +534,7 @@ func (c *Container) Inspect(size bool) (*inspect.ContainerInspectData, error) {
// Commit commits the changes between a container and its image, creating a new
// image
-func (c *Container) Commit(pause bool, options CopyOptions) (*storage.Image, error) {
+func (c *Container) Commit(pause bool, reference string, writer io.Writer, signingOptions image.SigningOptions, imageConfig ociv1.Image) (*image.Image, error) {
if !c.locked {
c.lock.Lock()
defer c.lock.Unlock()
@@ -563,7 +565,7 @@ func (c *Container) Commit(pause bool, options CopyOptions) (*storage.Image, err
if err := c.export(tempFile.Name()); err != nil {
return nil, err
}
- return c.runtime.ImportImage(tempFile.Name(), options)
+ return image.Import(tempFile.Name(), reference, writer, signingOptions, imageConfig, c.runtime.imageRuntime)
}
// Wait blocks on a container to exit and returns its exit code