使用ADD命令将目录复制到另一个目录 [英] Copy directory to another directory using ADD command

查看:50
本文介绍了使用ADD命令将目录复制到另一个目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已阅读 http://docs.docker.com/engine/reference/builder/#add 但是我遇到了一个问题.我想将本地目录 go 复制到docker /user/local/

I have read http://docs.docker.com/engine/reference/builder/#add however I met a problem. I want to copy the local directory go to docker /user/local/

我尝试过:

ADD go /usr/local/

和:

ADD /go/ /usr/local/ 

还:

RUN chmod 0755 /usr/local/go/src/make.bash

但是,我看到以下错误消息:

However, I see the following error message:

/usr/local/go/src/make.bash: No such file or directory

,但是本地 go 目录确实包含 make.bash .

but the local go directory does contain make.bash.

推荐答案

ADD go /usr/local/

将复制本地 go 目录中的内容在Docker映像的/usr/local/目录中.

will copy the contents of your local go directory in the /usr/local/ directory of your docker image.

要在/usr/local/中复制 go 目录本身,请使用:

To copy the go directory itself in /usr/local/ use:

ADD go /usr/local/go

COPY go /usr/local/go

这篇关于使用ADD命令将目录复制到另一个目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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