|
@@ -16,6 +16,7 @@ import (
|
|
|
"github.com/docker/docker/builder/dockerfile"
|
|
|
"github.com/docker/docker/cliconfig"
|
|
|
"github.com/docker/docker/daemon/daemonbuilder"
|
|
|
+ derr "github.com/docker/docker/errors"
|
|
|
"github.com/docker/docker/graph"
|
|
|
"github.com/docker/docker/graph/tags"
|
|
|
"github.com/docker/docker/pkg/archive"
|
|
@@ -63,12 +64,11 @@ func (s *router) postCommit(ctx context.Context, w http.ResponseWriter, r *http.
|
|
|
Config: c,
|
|
|
}
|
|
|
|
|
|
- container, err := s.daemon.Get(cname)
|
|
|
- if err != nil {
|
|
|
- return err
|
|
|
+ if !s.daemon.Exists(cname) {
|
|
|
+ return derr.ErrorCodeNoSuchContainer.WithArgs(cname)
|
|
|
}
|
|
|
|
|
|
- imgID, err := dockerfile.Commit(container, s.daemon, commitCfg)
|
|
|
+ imgID, err := dockerfile.Commit(cname, s.daemon, commitCfg)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|