mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Renamed 'docker tar' to 'docker export' for symmetry with 'docker import'
This commit is contained in:
parent
623e91e2e3
commit
e627a0da1e
1 changed files with 4 additions and 7 deletions
11
commands.go
11
commands.go
|
@ -49,7 +49,7 @@ func (srv *Server) Help() string {
|
||||||
{"run", "Run a command in a new container"},
|
{"run", "Run a command in a new container"},
|
||||||
{"start", "Start a stopped container"},
|
{"start", "Start a stopped container"},
|
||||||
{"stop", "Stop a running container"},
|
{"stop", "Stop a running container"},
|
||||||
{"tar", "Stream the contents of a container as a tar archive"},
|
{"export", "Stream the contents of a container as a tar archive"},
|
||||||
{"version", "Show the docker version information"},
|
{"version", "Show the docker version information"},
|
||||||
{"wait", "Block until a container stops, then print its exit code"},
|
{"wait", "Block until a container stops, then print its exit code"},
|
||||||
} {
|
} {
|
||||||
|
@ -551,10 +551,10 @@ func (srv *Server) CmdCommit(stdin io.ReadCloser, stdout io.Writer, args ...stri
|
||||||
return errors.New("No such container: " + containerName)
|
return errors.New("No such container: " + containerName)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (srv *Server) CmdTar(stdin io.ReadCloser, stdout io.Writer, args ...string) error {
|
func (srv *Server) CmdExport(stdin io.ReadCloser, stdout io.Writer, args ...string) error {
|
||||||
cmd := rcli.Subcmd(stdout,
|
cmd := rcli.Subcmd(stdout,
|
||||||
"tar", "CONTAINER",
|
"export", "CONTAINER",
|
||||||
"Stream the contents of a container as a tar archive")
|
"Export the contents of a filesystem as a tar archive")
|
||||||
fl_sparse := cmd.Bool("s", false, "Generate a sparse tar stream (top layer + reference to bottom layers)")
|
fl_sparse := cmd.Bool("s", false, "Generate a sparse tar stream (top layer + reference to bottom layers)")
|
||||||
if err := cmd.Parse(args); err != nil {
|
if err := cmd.Parse(args); err != nil {
|
||||||
return nil
|
return nil
|
||||||
|
@ -564,9 +564,6 @@ func (srv *Server) CmdTar(stdin io.ReadCloser, stdout io.Writer, args ...string)
|
||||||
}
|
}
|
||||||
name := cmd.Arg(0)
|
name := cmd.Arg(0)
|
||||||
if container := srv.runtime.Get(name); container != nil {
|
if container := srv.runtime.Get(name); container != nil {
|
||||||
if err := container.EnsureMounted(); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
data, err := container.Export()
|
data, err := container.Export()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue