from container to host
docker cp CONTAINER_NAME:PATH_IN_CONTAINER PATH_IN_HOST
from host to container
docker cp PATH_IN_HOST CONTAINER_NAME:PATH_IN_CONTAINER
If I use jess/transmission from
https://hub.docker.com/r/jess/transmission/builds/bsn7eqxrkzrhxazcuytbmzp/
, the files in the container are in /transmission/download
and my current directory on the host is /home/$USER/abc, after
docker cp transmission_id_or_name:/transmission/download .
I will have the files copied to
/home/$USER/abc/transmission/download
you can not, using docker cp
copy only one file, you copy the directory tree and the files