Home>Article>Operation and Maintenance> How to solve file transfer between docker container and local machine

How to solve file transfer between docker container and local machine

WJ
WJ Original
2020-06-05 15:41:50 2504browse

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.

How to solve file transfer between docker container and local machine

#2. Then get the full name of the ID based on any one of these two items.

How to solve file transfer between docker container and local machine

# 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.

How to solve file transfer between docker container and local machine

If the container transfers files to the local, the reverse is fine:

docker cp ID全称:容器文件路径 本地路径

How to solve file transfer between docker container and local machine

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!

Statement:
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