Home > Article > Operation and Maintenance > How to solve file transfer between docker container and local machine
How to solve the file transfer between docker container and local machine?
To transfer files between the host and the container, you need to use the full ID of the container.
The acquisition method is as follows:
1. First get the short ID of the container or the specified name.
#2. Then get the full name of the ID based on any one of these two items.
# With this long ID, file transfer between the machine and the container will be simple.
docker cp 本地文件路径 ID全称:容器路径
After entering the container, you can see the file you just uploaded.
If the container transfers files to the local, the reverse is fine:
docker cp ID全称:容器文件路径 本地路径
Related references:docker tutorial
The above is the detailed content of How to solve file transfer between docker container and local machine. For more information, please follow other related articles on the PHP Chinese website!