Add cp command and copy api endpoint

The cp command and copy api endpoint allows users
to copy files and or folders from a containers filesystem.

Closes #382
This commit is contained in:
Michael Crosby
2013-08-06 16:09:54 +00:00
parent 0dbc51f4d2
commit 5b8cfbe15c
10 changed files with 202 additions and 1 deletions
+32 -1
View File
@@ -525,6 +525,38 @@ Remove a container
:statuscode 500: server error
Copy files or folders from a container
**************************************
.. http:post:: /containers/(id)/copy
Copy files or folders of container ``id``
**Example request**:
.. sourcecode:: http
POST /containers/4fa6e0f0c678/copy HTTP/1.1
Content-Type: application/json
{
"Resource":"test.txt"
}
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Content-Type: application/octet-stream
{{ STREAM }}
:statuscode 200: no error
:statuscode 404: no such container
:statuscode 500: server error
2.2 Images
----------
@@ -1091,7 +1123,6 @@ Monitor Docker's events
:statuscode 200: no error
:statuscode 500: server error
3. Going further
================
+1
View File
@@ -30,6 +30,7 @@ Available Commands
command/attach
command/build
command/commit
command/cp
command/diff
command/export
command/history
+13
View File
@@ -0,0 +1,13 @@
:title: Cp Command
:description: Copy files/folders from the containers filesystem to the host path
:keywords: cp, docker, container, documentation, copy
===========================================================
``cp`` -- Copy files/folders from the containers filesystem to the host path
===========================================================
::
Usage: docker cp CONTAINER:RESOURCE HOSTPATH
Copy files/folders from the containers filesystem to the host path. Paths are relative to the root of the filesystem.
+1
View File
@@ -15,6 +15,7 @@ Contents:
attach <command/attach>
build <command/build>
commit <command/commit>
cp <command/cp>
diff <command/diff>
export <command/export>
history <command/history>