docker-cp - Man Page
Copy files/folders between a container and the local filesystem
Examples (TL;DR)
- Copy a file or directory from the host to a container:
docker cp path/to/file_or_directory_on_host container_name:path/to/file_or_directory_in_container
- Copy a file or directory from a container to the host:
docker cp container_name:path/to/file_or_directory_in_container path/to/file_or_directory_on_host
- Copy a file or directory from the host to a container, following symlinks (copies the symlinked files directly, not the symlinks themselves):
docker cp --follow-link path/to/symlink_on_host container_name:path/to/file_or_directory_in_container
Synopsis
docker cp [Options] CONTAINER:SRC_PATH DEST_PATH|-
docker cp [Options] SRC_PATH|- CONTAINER:DEST_PATH
Description
Alias for docker container cp
.
Options
- -a, --archive[=false]
Archive mode (copy all uid/gid information)
- -L, --follow-link[=false]
Always follow symbol link in SRC_PATH
- -h, --help[=false]
help for cp
See Also
Info
May 2020 Docker Community