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

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

王林
Release: 2021-01-22 11:08:07
forward
2762 people have browsed it

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/
Copy after login

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/
Copy after login

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!

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
About docker
From 1970-01-01 08:00:00
0
0
0
docker install phpstudy
From 1970-01-01 08:00:00
0
0
0
Deploy snmp environment in docker
From 1970-01-01 08:00:00
0
0
0
docker: invalid reference format
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template