Hi All, this document deals with how to copy a file from container to host machine.
Docker is a set of the platform as service products that use OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files; they can communicate with each other through well-defined channels.
You can copy a file from the host machine to the container by performing the below command,
Get the container ID first.
copy the container ID and execute the below copy command.
This will copy testfile.txt from the host machine to / location of the docker container.
You can copy the below command to copy a file from a docker container to host machine
The above command will copy testfile.txt from / location of a docker container to newfile.txt in the current location of the host machine.
© 2019, Techrunnr. All rights reserved.