In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to copy files to the host in the docker container". The explanation in the article is simple and clear and easy to learn and understand. please follow the editor's ideas to study and learn "how to copy files to the host in the docker container".
To copy files from the docker container to the host, execute the following command in the host:
Docker cp container name: the path of the file to be copied in the container should be copied to the corresponding path of the host
Suppose the name of the container is testtomcat, and the file path to be copied from the container is / usr/local/tomcat/webapps/test/js/test.js. Now copy test.js from the container to the / opt path of the host, and execute the command on the host.
Docker cp testtomcat:/usr/local/tomcat/webapps/test/js/test.js / opt
Suppose I want to copy a common.log file, then after entering the container, use the find. /-name "common.log" command to find the directory where the file is located, assuming that the search result is
. / mwbase/applogs/rtlog/OLS/common.log
Execute exit to exit the docker container. After exiting the container, you want to copy it to the / home/rhlog directory of the host and rename it to yyy.log. Then the final command is:
Docker cp 6741xxxxxxxx:/xxxx/xxx/xxx/xxxx/common.log / home/rhlog/yyy.log # Note there is no "."
As a result of the execution, you can see that the / home/rhlog directory copy gets the yyy.log, so the file is copied out.
Thank you for your reading. the above is the content of "how to copy files to the host in the docker container". After the study of this article, I believe you have a deeper understanding of how to copy files to the host in the docker container, and the specific usage needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.