How to Copy Files from Docker Container to Host
Today in this article, we will see how to Copy Files from Docker Container to Host.
This technique is also useful if containers are stopped or paused as well.
Command
docker cp <container>:<container-source-path> <destination-path>
The docker cp the utility copies the contents of the Source Container to the target path specified.
You can copy from the container’s file system to the local machine or vice versa.
Below we are copying the file from the container to the host path.
Once copied, the host path can be used to explore the files.
Example
Below command is executed on windows,
docker cp 1cf2eafdee49:app test\docker-dump
Below is now how you can check all the files and directory
dir path
References:
Do you have any comments or ideas or any better suggestions to share?
Please sound off your comments below.
Happy Coding !!
Please bookmark this page and share it with your friends. Please Subscribe to the blog to receive notifications on freshly published(2024) best practices and guidelines for software design and development.