Copy directory to other directory at Docker using

2019-01-29 19:56发布

问题:

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.

回答1:

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


标签: docker