copy file to docker conatiner using docker dockerfile 1

copy file to docker conatiner using docker dockerfile

COPY foo.txt /data/foo.txt
# where foo.txt is the relative path on host
# and /data/foo.txt is the absolute path in the image

Here is what the above code is Doing:
1. Create a new image from the base image
2. Copy the file foo.txt from the host to the image
3. Run the command ls -l /data/foo.txt in the image
4. Print the output of the command

Similar Posts