Docker – ADD or COPY a folder in Docker

docker

My directory Structure as follows

 Dockerfile downloads

I want to add downloads to /tmp

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

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

 ADD . tmp/

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

Best Answer

I believe that you need:

COPY downloads/ /tmp/downloads/

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