Sunday, September 11, 2022

Docker copying from to host

 sudo docker cp container-id:/path/filename.txt ~/Desktop/filename.txt

Obtain the name or id of the Docker container

Issue the docker cp command and reference the container name or id

The first parameter of the docker copy command is the path to the file inside the container

The second parameter of the docker copy command is the location to save the file on the host

Edit and use the file copied from inside the container to your host machine

references:

https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/How-to-copy-files-from-a-Docker-container-to-a-host-machine

No comments:

Post a Comment