Copy directory to other directory at Docker using ADD command

0 votes

I went through this documentation http://docs.docker.com/engine/reference/builder/#add but I am having an issue.. My goal is to copy the local directory go to docker /user/local/

The commands I used to do what I am trying to achieve is:

ADD go /usr/local/

and:

ADD /go/ /usr/local/ 

also:

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

But I am getting the error message /usr/local/go/src/make.bash: No such file or directory but the local go directory does contain make.bash.

Oct 11, 2018 in DevOps & Agile by Damon Salvatore
• 5,980 points

retagged Nov 12, 2018 by Kalgi 581 views

1 answer to this question.

0 votes

Here is how you can resolve your issue.

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 you can try the below commands as well.

COPY go /usr/local/go
answered Oct 11, 2018 by Damon Salvatore
• 5,980 points

Related Questions In DevOps & Agile

0 votes
1 answer
0 votes
2 answers
0 votes
1 answer

How to restart docker for windows using Powershell?

Try this: $processes = Get-Process "*docker for windows*" if ...READ MORE

answered Oct 23, 2018 in DevOps & Agile by Tyrion anex
• 8,700 points
7,529 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,020 points
2,719 views
0 votes
2 answers
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP