Copy directory to other directory at Docker using

2019-01-29 19:46发布

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/

I tried:

ADD go /usr/local/

and:

ADD /go/ /usr/local/ 

also:

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 but the local go directory does contain make.bash.

标签: docker
1条回答
甜甜的少女心
2楼-- · 2019-01-29 20:15
ADD go /usr/local/

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

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

ADD go /usr/local/go

or

COPY go /usr/local/go
查看更多
登录 后发表回答