How to copy files from a Docker container to the host
You can copy files from a Docker container to the host even if you didn't mount a volume using the command docker cp
.
Here's an example where we copy the file /home/user/file.jpg
from the container to file.jpg
in the current dicretory of the host:
$ docker cp my_container:/home/user/file.jpg file.jpg