How to transfer files between Docker container and local machine

How to transfer files between Docker container and local machine

To transfer files between the host and the container, the full ID of the container is required.

The acquisition method is as follows:

1. First get the short ID or specified name of the container.

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

With this long ID, file transfer between the local machine and the container is simple.

docker cp local file path ID full name: container path 

After entering the container, you can see the files just uploaded.

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

docker cp ID full name: container file path local path

For mounting, you can refer to this article: Using Volume to transfer files between the host and Docker container.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • How to use Docker container to access host network
  • How to communicate between WIN10 system and Docker internal container IP
  • Steps to set up and mount shared folders on Windows host and Docker container

<<:  How to use resident nodes for layer management in CocosCreator

>>:  Linux implements automatic and scheduled backup of MySQL database every day

Recommend

HTML form_PowerNode Java Academy

1. Form 1. The role of the form HTML forms are us...

Detailed explanation of Vue advanced construction properties

Table of contents 1. Directive custom directive 2...

Detailed examples of Docker-compose networks

Today I experimented with the network settings un...

Diving into JS inheritance

Table of contents Preface Prepare Summarize n way...

Add crontab scheduled tasks to debian docker container

Now most of the Docker images are based on Debian...

What are the new CSS :where and :is pseudo-class functions?

What are :is and :where? :is() and :where() are p...

Summary of essential knowledge points for MySQL query optimization

Preface Query optimization is not something that ...

Installation and use of Apache stress testing tools

1. Download Go to the Apache official website htt...

Solve the cross-domain problem of get and post requests of vue $http

Vue $http get and post request cross-domain probl...

Summary of CSS gradient effects (linear-gradient and radial-gradient)

Linear-gradient background-image: linear-gradient...

Detailed process of compiling and installing Storm on Kylin V10 server

1 Introduction Apache Storm is a free, open sourc...