mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-03 12:11:41 +00:00
Use ContainerCommitResponse struct for Commit cmd
Signed-off-by: Jamie Hannaford <jamie.hannaford@rackspace.com>
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
|
||||
"github.com/docker/docker/engine"
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/opts"
|
||||
flag "github.com/docker/docker/pkg/mflag"
|
||||
"github.com/docker/docker/pkg/parsers"
|
||||
@@ -57,9 +57,10 @@ func (cli *DockerCli) CmdCommit(args ...string) error {
|
||||
}
|
||||
|
||||
var (
|
||||
config *runconfig.Config
|
||||
env engine.Env
|
||||
config *runconfig.Config
|
||||
response types.ContainerCommitResponse
|
||||
)
|
||||
|
||||
if *flConfig != "" {
|
||||
config = &runconfig.Config{}
|
||||
if err := json.Unmarshal([]byte(*flConfig), config); err != nil {
|
||||
@@ -70,10 +71,11 @@ func (cli *DockerCli) CmdCommit(args ...string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := env.Decode(stream); err != nil {
|
||||
|
||||
if err := json.NewDecoder(stream).Decode(&response); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Fprintf(cli.out, "%s\n", env.Get("Id"))
|
||||
fmt.Fprintln(cli.out, response.ID)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user