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

Detailed explanation of Linux netfilter/iptables knowledge points

Netfilter Netfilter is a packet processing module...

Uniapp realizes sliding scoring effect

This article shares the specific code of uniapp t...

Future-oriented all-round web design: progressive enhancement

<br />Original: Understanding Progressive En...

MySQL Basics in 1 Hour

Table of contents Getting Started with MySQL MySQ...

How to solve the problem of ERROR 2003 (HY000) when starting mysql

1. Problem Description When starting MYSQL, a pro...

MySQL 5.7.17 installation and configuration graphic tutorial

The blogger said : I have been writing a series o...

In-depth analysis of the diff algorithm in React

Understanding of diff algorithm in React diff alg...

A brief talk about JavaScript parasitic composition inheritance

Composition inheritance Combination inheritance i...

js data types and their judgment method examples

js data types Basic data types: number, string, b...

Install Percona Server+MySQL on CentOS 7

1. Environmental Description (1) CentOS-7-x86_64,...

Vue+echarts realizes stacked bar chart

This article shares the specific code of Vue+echa...

WeChat applet realizes chat room function

This article shares the specific code of WeChat a...

Hover zoom effect made with CSS3

Result:Implementation code: html <link href=&#...

How to install PostgreSQL and PostGIS using yum on CentOS7

1. Update the yum source The PostgreSQL version o...

Analysis of MySQL's method of exporting to Excel

This article describes how to use MySQL to export...