docker cp文件夹的内容 [英] docker cp the content of a folder

查看:405
本文介绍了docker cp文件夹的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将文件夹(在我的服务器上)的内容复制到我的容器中:

I try to copy the content of a folder (on my server) to my container:

docker cp sonatype-work-backup/* nexus:/sonatype-work/

所以我想要sonatype工作的内容我/ sonatype工作/联盟。但是它不适用于 * ,没有明星,它将sonatype-work-backup目录复制到我的sonatype工作目录中。我不能执行 mv

So I want the content of sonatype-work in my /sonatype-work/ of nexus. But it doesn't work with the * and without the star it's copying the directory sonatype-work-backup inside my sonatype-work directory. I can't perform mv after that.

推荐答案

你可以在您的容器中运行该目录运行

you could just mount that directory in your container at run

 docker run -v /sonatype-work-backup:/mnt --name nexus nexus-image

然后

docker exec -it nexus bash

只需将/文件夹

这篇关于docker cp文件夹的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆