summaryrefslogtreecommitdiff
path: root/libpod/container_api.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-04-03 12:34:19 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-04-10 13:31:59 +0000
commit1700f2b2381d9665810ed4764d0fe357150c5978 (patch)
treea7338bdc31da8ef48d337555911932b097c06f84 /libpod/container_api.go
parent998fd2ece0480e581e013124d0969a1af6305110 (diff)
downloadpodman-1700f2b2381d9665810ed4764d0fe357150c5978.tar.gz
podman-1700f2b2381d9665810ed4764d0fe357150c5978.tar.bz2
podman-1700f2b2381d9665810ed4764d0fe357150c5978.zip
Use buildah commit for podman commit
Resolves: #586 and #520 Signed-off-by: baude <bbaude@redhat.com> Closes: #592 Approved by: mheon
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r--libpod/container_api.go39
1 files changed, 0 insertions, 39 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go
index 6106cfc12..5ebb7b091 100644
--- a/libpod/container_api.go
+++ b/libpod/container_api.go
@@ -1,7 +1,6 @@
package libpod
import (
- "io"
"io/ioutil"
"os"
"strconv"
@@ -10,10 +9,8 @@ import (
"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"
@@ -586,42 +583,6 @@ func (c *Container) Inspect(size bool) (*inspect.ContainerInspectData, error) {
return c.getContainerInspectData(size, driverData)
}
-// Commit commits the changes between a container and its image, creating a new
-// image
-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()
-
- if err := c.syncContainer(); err != nil {
- return nil, err
- }
- }
-
- if c.state.State == ContainerStateRunning && pause {
- if err := c.runtime.ociRuntime.pauseContainer(c); err != nil {
- return nil, errors.Wrapf(err, "error pausing container %q", c.ID())
- }
- defer func() {
- if err := c.runtime.ociRuntime.unpauseContainer(c); err != nil {
- logrus.Errorf("error unpausing container %q: %v", c.ID(), err)
- }
- }()
- }
-
- tempFile, err := ioutil.TempFile(c.runtime.config.TmpDir, "podman-commit")
- if err != nil {
- return nil, errors.Wrapf(err, "error creating temp file")
- }
- defer os.Remove(tempFile.Name())
- defer tempFile.Close()
-
- if err := c.export(tempFile.Name()); err != nil {
- return nil, err
- }
- return c.runtime.imageRuntime.Import(tempFile.Name(), reference, writer, signingOptions, imageConfig)
-}
-
// Wait blocks on a container to exit and returns its exit code
func (c *Container) Wait() (int32, error) {
if !c.valid {