Easy Tutorial
❮ Docker Command Manual Docker History Command ❯

Docker cp Command

Docker Command Manual


docker cp : Used for copying data between a container and the host.

Syntax

docker cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|-
docker cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH

OPTIONS Description:

-

-L : Maintain links in the source target

Examples

Copy the host's /www/tutorialpro directory to the /www directory of the container 96f7f14e99ab.

docker cp /www/tutorialpro 96f7f14e99ab:/www/

Copy the host's /www/tutorialpro directory to the container 96f7f14e99ab, renaming the directory to www.

docker cp /www/tutorialpro 96f7f14e99ab:/www

Copy the /www directory of the container 96f7f14e99ab to the host's /tmp directory.

docker cp 96f7f14e99ab:/www /tmp/

Docker Command Manual

❮ Docker Command Manual Docker History Command ❯