主机参考:VPS测评参考推荐/专注分享VPS服务器优惠信息!若您是商家可以在本站进行投稿,查看详情!此外我们还提供软文收录、PayPal代付、广告赞助等服务,查看详情! |
我们发布的部分优惠活动文章可能存在时效性,购买时建议在本站搜索商家名称可查看相关文章充分了解该商家!若非中文页面可使用Edge浏览器同步翻译!PayPal代付/收录合作 |
linux下怎么将文件复制到docker容器中?很多人都不太了解,今天小编为了让大家更加了解linux,所以给大家总结了以下内容,一起往下看吧。
How to copy files to the docker container under Linux? Many people don't know much about it. Today, in order to let you know more about Linux, I summarized the following contents for you. Let's look down.
1、查看所有的docker容器
docker ps
Docker PS
//775c7c9ee1e1 is the ID in docker
docker exec -it 775c7c9ee1e1 /bin/bash
docker exec -it 775c7c9ee1e1 /bin/bash
2、从linux系统拷贝文件到容器
2. Copy files from Linux system to container
得到容器的长ID
Get the long ID of the container
//Python is the name of the project running in the docker container
docker inspect -f '{{.ID}}' python
docker inspect -f '{{.ID}}' python
然后进行拷贝 ,注意:执行docker命令时一定要退出容器,否则报错
Then copy it. Note: when executing the docker command, you must exit the container, otherwise an error will be reported
从容器中拷出来是一样的,docker cp 后面的位置调换一下即可,复制时可不用长路径,docker ps显示的容器名称即可使用
It's the same when copying from the container. Just change the location after docker CP. you don't need a long path when copying. The container name displayed by docker PS can be used
// docker cp 本地路径 容器长ID:容器路径
//Docker CP local path container long ID: container path
docker cp /usr/local/test.txt 38ef22f922704b32cf2650407e16b146bf61c221e6b8ef679989486d6ad9e856:/usr/local/tomcat/webapps test.txt
docker cp /usr/local/test.txt 38ef22f922704b32cf2650407e16b146bf61c221e6b8ef679989486d6ad9e856:/usr/local/tomcat/webapps test.txt
以上就是linux下怎么将文件复制到docker容器中做了简略的介绍,当然详细使用上面的不同还得要大家自己使用过才领会。如果想了解更多,欢迎关注主机参考行业资讯频道哦!
The above is a brief introduction of how to copy files to the docker container under Linux. Of course, the detailed use of the above differences should be understood only after you have used them. If you want to learn more, please pay attention to the host reference industry information channel!
--------------------------------------------------------------
主机参考,收集国内外VPS,VPS测评,主机测评,云服务器,虚拟主机,独立服务器,国内外服务器,高性价比建站主机相关优惠信息@zhujicankao.com
详细介绍和测评国外VPS主机,云服务器,国外服务器,国外主机的相关优惠信息,商家背景,网络带宽等等,也是目前国内最好的主机云服务器VPS参考测评资讯优惠信息分享平台
这几篇文章你可能也喜欢:
- PacificRack,黑色星期五特别优惠,美国便宜VPS云服务器低至1折,美国洛杉矶QN自营机房,KVM虚拟架构,2核4G内存100Mbps带宽,仅15美元/年,约1.25美元/月
- HostDare,黑色星期五特别优惠,国外高质量CN2 GIA优质线路VPS云服务器8.5折,美国洛杉矶机房,KVM虚拟架构,1核756M内存50Mbps带宽,42.49美元/年
- DMIT,黑色星期五特别优惠,日本CN2 GIA特价8折,美国/香港VPS云服务器1.5倍流量,消费最高3000美元返900美元,KVM虚拟架构,1核0.75G内存100Mbps带宽,19.9美元/月
- PacificRack,黑色星期五特别优惠,全场VPS云服务器5折,美国洛杉矶自营机房,KVM虚拟架构,1核512M内存100Mbps带宽,12.5美元/年
- 云服务器优化教程,宝塔面板优化高并发大流量网站程序,让中大型网站访问顺畅不卡
本文由主机参考刊发,转载请注明:linux下怎么将文件复制到docker容器中 https://zhujicankao.com/14098.html
评论前必须登录!
注册