Browse code

Merge pull request #2723 from SvenDowideit/doc-build-image

Use the work Path for docker cp CONTAINER:PATH

Michael Crosby authored on 2013/11/21 04:10:13
Showing 3 changed files
... ...
@@ -987,7 +987,7 @@ func postContainersCopy(srv *Server, version float64, w http.ResponseWriter, r *
987 987
 	}
988 988
 
989 989
 	if copyData.Resource == "" {
990
-		return fmt.Errorf("Resource cannot be empty")
990
+		return fmt.Errorf("Path cannot be empty")
991 991
 	}
992 992
 	if copyData.Resource[0] == '/' {
993 993
 		copyData.Resource = copyData.Resource[1:]
... ...
@@ -1932,7 +1932,7 @@ func (cli *DockerCli) CmdRun(args ...string) error {
1932 1932
 }
1933 1933
 
1934 1934
 func (cli *DockerCli) CmdCp(args ...string) error {
1935
-	cmd := Subcmd("cp", "CONTAINER:RESOURCE HOSTPATH", "Copy files/folders from the RESOURCE to the HOSTPATH")
1935
+	cmd := Subcmd("cp", "CONTAINER:PATH HOSTPATH", "Copy files/folders from the PATH to the HOSTPATH")
1936 1936
 	if err := cmd.Parse(args); err != nil {
1937 1937
 		return nil
1938 1938
 	}
... ...
@@ -1946,7 +1946,7 @@ func (cli *DockerCli) CmdCp(args ...string) error {
1946 1946
 	info := strings.Split(cmd.Arg(0), ":")
1947 1947
 
1948 1948
 	if len(info) != 2 {
1949
-		return fmt.Errorf("Error: Resource not specified")
1949
+		return fmt.Errorf("Error: Path not specified")
1950 1950
 	}
1951 1951
 
1952 1952
 	copyData.Resource = info[1]
... ...
@@ -219,10 +219,15 @@ Full -run example
219 219
 
220 220
 ::
221 221
 
222
-    Usage: docker cp CONTAINER:RESOURCE HOSTPATH
222
+    Usage: docker cp CONTAINER:PATH HOSTPATH
223 223
 
224 224
     Copy files/folders from the containers filesystem to the host
225 225
     path.  Paths are relative to the root of the filesystem.
226
+    
227
+.. code-block:: bash
228
+
229
+    $ sudo docker cp 7bb0e258aefe:/etc/debian_version .
230
+    $ sudo docker cp blue_frog:/etc/hosts .
226 231
 
227 232
 .. _cli_diff:
228 233