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/
COPY is a docker file command that copies files from a local source location to a destination in the Docker container. ADD command is used to copy files/directories into a Docker image. It only has only one assigned function. It can also copy files from a URL.
Docker Dockerfiles COPY InstructionAll new files and directories are created with a UID and GID of 0.
Obtain the name or id of the Docker container. Issue the docker cp command and reference the container name or id. The first parameter of the docker copy command is the path to the file inside the container. The second parameter of the docker copy command is the location to save the file on the host.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With