summaryrefslogtreecommitdiff
path: root/daemon/containerd/image_commit.go
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/containerd/image_commit.go')
-rw-r--r--daemon/containerd/image_commit.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/daemon/containerd/image_commit.go b/daemon/containerd/image_commit.go
index bbb4df0ddc..a721c41970 100644
--- a/daemon/containerd/image_commit.go
+++ b/daemon/containerd/image_commit.go
@@ -6,7 +6,6 @@ import (
"crypto/rand"
"encoding/base64"
"encoding/json"
- "errors"
"fmt"
"runtime"
"strings"
@@ -20,7 +19,6 @@ import (
"github.com/containerd/containerd/rootfs"
"github.com/containerd/containerd/snapshots"
"github.com/docker/docker/api/types/backend"
- "github.com/docker/docker/errdefs"
"github.com/docker/docker/image"
"github.com/opencontainers/go-digest"
"github.com/opencontainers/image-spec/identity"
@@ -298,5 +296,13 @@ func uniquePart() string {
//
// This is a temporary shim. Should be removed when builder stops using commit.
func (i *ImageService) CommitBuildStep(ctx context.Context, c backend.CommitConfig) (image.ID, error) {
- return "", errdefs.NotImplemented(errors.New("not implemented"))
+ ctr := i.containers.Get(c.ContainerID)
+ if ctr == nil {
+ // TODO: use typed error
+ return "", fmt.Errorf("container not found: %s", c.ContainerID)
+ }
+ c.ContainerMountLabel = ctr.MountLabel
+ c.ContainerOS = ctr.OS
+ c.ParentImageID = string(ctr.ImageID)
+ return i.CommitImage(ctx, c)
}