mirror of https://github.com/docker/docs.git
Merge pull request #2723 from SvenDowideit/doc-build-image
Use the work Path for docker cp CONTAINER:PATH
This commit is contained in:
commit
2bc35287a0
2
api.go
2
api.go
|
@ -987,7 +987,7 @@ func postContainersCopy(srv *Server, version float64, w http.ResponseWriter, r *
|
||||||
}
|
}
|
||||||
|
|
||||||
if copyData.Resource == "" {
|
if copyData.Resource == "" {
|
||||||
return fmt.Errorf("Resource cannot be empty")
|
return fmt.Errorf("Path cannot be empty")
|
||||||
}
|
}
|
||||||
if copyData.Resource[0] == '/' {
|
if copyData.Resource[0] == '/' {
|
||||||
copyData.Resource = copyData.Resource[1:]
|
copyData.Resource = copyData.Resource[1:]
|
||||||
|
|
|
@ -1932,7 +1932,7 @@ func (cli *DockerCli) CmdRun(args ...string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cli *DockerCli) CmdCp(args ...string) error {
|
func (cli *DockerCli) CmdCp(args ...string) error {
|
||||||
cmd := Subcmd("cp", "CONTAINER:RESOURCE HOSTPATH", "Copy files/folders from the RESOURCE to the HOSTPATH")
|
cmd := Subcmd("cp", "CONTAINER:PATH HOSTPATH", "Copy files/folders from the PATH to the HOSTPATH")
|
||||||
if err := cmd.Parse(args); err != nil {
|
if err := cmd.Parse(args); err != nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -1946,7 +1946,7 @@ func (cli *DockerCli) CmdCp(args ...string) error {
|
||||||
info := strings.Split(cmd.Arg(0), ":")
|
info := strings.Split(cmd.Arg(0), ":")
|
||||||
|
|
||||||
if len(info) != 2 {
|
if len(info) != 2 {
|
||||||
return fmt.Errorf("Error: Resource not specified")
|
return fmt.Errorf("Error: Path not specified")
|
||||||
}
|
}
|
||||||
|
|
||||||
copyData.Resource = info[1]
|
copyData.Resource = info[1]
|
||||||
|
|
|
@ -219,10 +219,15 @@ Full -run example
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
Usage: docker cp CONTAINER:RESOURCE HOSTPATH
|
Usage: docker cp CONTAINER:PATH HOSTPATH
|
||||||
|
|
||||||
Copy files/folders from the containers filesystem to the host
|
Copy files/folders from the containers filesystem to the host
|
||||||
path. Paths are relative to the root of the filesystem.
|
path. Paths are relative to the root of the filesystem.
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
$ sudo docker cp 7bb0e258aefe:/etc/debian_version .
|
||||||
|
$ sudo docker cp blue_frog:/etc/hosts .
|
||||||
|
|
||||||
.. _cli_diff:
|
.. _cli_diff:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue