Home  >  Article  >  Operation and Maintenance  >  How docker implements file migration operations between the host and the container

How docker implements file migration operations between the host and the container

王林
王林forward
2021-01-22 11:08:072672browse

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!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete

Related articles

See more