Home >Operation and Maintenance >Docker >How docker implements file migration operations between the host and the container
The specific file migration operations are as follows:
(Learning video sharing: Introduction to Programming)
1. Copy from the host machine File into the container
The container name is testCentos. Now you need to copy the host/home/test.txt file to the /dockerHome/path in the container
docker cp /home/test.txt testCentos:/dockerHome/
2. From Copy files from the container to the host
Assume that the container is named testCentos, and the path of the file to be copied from the container is: /dockerHome/test.txt. Now we need to copy test.txt from the container to the host. Below the /home/ path
docker cp testCentos:/dockerHome/test.txt /home/
Related recommendations:Docker Getting Started Tutorial
The above is the detailed content of How docker implements file migration operations between the host and the container. For more information, please follow other related articles on the PHP Chinese website!