Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to copy files to docker container under linux

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

How to copy files to a docker container under linux? Many people don't know much about it. Today, in order to let you know more about linux, the editor summarizes the following contents. Let's look down together.

1. View all docker containers

Docker ps// 775c7c9ee1e1 is iddocker exec-it 775c7c9ee1e1 / bin/bash in docker

2. Copy files from the linux system to the container

Get the long ID of the container

/ / python is the project name docker inspect-f'{{.ID}} 'python running in the docker container

Then make a copy. Note: when you execute the docker command, you must exit the container, otherwise an error will be reported.

It is the same when copied from the container. You can change the position behind the docker cp. You can copy without a long path, and the container name displayed by docker ps can be used.

/ / docker cp Local path Container length ID: container path docker cp / usr/local/test.txt 38ef22f922704b32cf2650407e16b146bf61c221e6b8ef679989486d6ad9e856:/usr/local/tomcat/webapps test.txt

The above is how to copy files to the docker container under linux to do a brief introduction, of course, the detailed use of the above differences still have to be used by everyone to understand. If you want to know more, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report