mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-05 13:11:30 +00:00
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:
@@ -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
|
||||
================
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ Available Commands
|
||||
command/attach
|
||||
command/build
|
||||
command/commit
|
||||
command/cp
|
||||
command/diff
|
||||
command/export
|
||||
command/history
|
||||
|
||||
@@ -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.
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user