Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions api/client/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,26 @@ import (
"encoding/json"
"fmt"

"golang.org/x/net/context"

"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/container"
Cli "github.com/hyperhq/hypercli/cli"
"github.com/hyperhq/hypercli/opts"
flag "github.com/hyperhq/hypercli/pkg/mflag"
"golang.org/x/net/context"
)

// CmdCommit creates a new image from a container's changes.
//
// Usage: docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]
func (cli *DockerCli) Commit(args ...string) error {
// Usage: hyper commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]
func (cli *DockerCli) CmdCommit(args ...string) error {
cmd := Cli.Subcmd("commit", []string{"CONTAINER [REPOSITORY[:TAG]]"}, Cli.DockerCommands["commit"].Description, true)
flPause := cmd.Bool([]string{"p", "-pause"}, true, "Pause container during commit")
flPause := cmd.Bool([]string{}, true, "Pause container during commit")
flComment := cmd.String([]string{"m", "-message"}, "", "Commit message")
flAuthor := cmd.String([]string{"a", "-author"}, "", "Author (e.g., \"John Hannibal Smith <hannibal@a-team.com>\")")
flChanges := opts.NewListOpts(nil)
cmd.Var(&flChanges, []string{"c", "-change"}, "Apply Dockerfile instruction to the created image")
// FIXME: --run is deprecated, it will be replaced with inline Dockerfile commands.
flConfig := cmd.String([]string{"#-run"}, "", "This option is deprecated and will be removed in a future version in favor of inline Dockerfile-compatible commands")
flConfig := cmd.String([]string{}, "", "This option is deprecated and will be removed in a future version in favor of inline Dockerfile-compatible commands")
cmd.Require(flag.Max, 2)
cmd.Require(flag.Min, 1)

Expand Down
2 changes: 1 addition & 1 deletion cli/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type Command struct {
var dockerCommands = []Command{
{"attach", "Attach to a running container"},
//{"build", "Build an image from a Dockerfile"},
//{"commit", "Create a new image from a container's changes"},
{"commit", "Create a new image from a container's changes"},
{"config", "Config access key and secret key to Hyper server"},
//{"cp", "Copy files/folders between a container and the local filesystem"},
{"create", "Create a new container"},
Expand Down