Copy Files

Copy files/folders between a container and the local filesystem

container
files

Command

docker cp

Explanation

Transfers files between host and container filesystems while container is running.

Examples

Copy from container to host

docker cp my_container:/file.txt .

Copy from host to container

docker cp file.txt my_container:/path/