在Docker中添加或复制一个文件夹 [英] ADD or COPY a folder in Docker

查看:4407
本文介绍了在Docker中添加或复制一个文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的目录结构如下

 Dockerfile downloads

我想添加下载到/ tmp

I want to add downloads to /tmp

 ADD downloads /tmp/
 COPY down* /tmp
 ADD ./downloads /tmp

Nothings工作。它将下载的内容复制到tmp中。我想复制下载淹没。任何意见?

Nothings works. It copies the contents of downloads into tmp. I want to copy the downloads floder. Any idea?

 ADD . tmp/

复制Dockerfile。我不想将Dockerfile复制到tmp /

copies Dockerfile also. i dont want to copy Dockerfile into tmp/

推荐答案

我相信你需要:

COPY downloads /tmp/downloads/

这将会将downloads目录的内容复制到映像中名为 / tmp / downloads / 的目录。

That will copy the contents of the downloads directory into a directory called /tmp/downloads/ in the image.

这篇关于在Docker中添加或复制一个文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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