Just started to work with docker and I can't figure out how copy all project files into docker image?
Let's say we have structure:
----my-app
-------------------api
-------------------config
-------------------lib
-------------------public
-------------------Dockerfile
-------------------index.html
So, how can I copy all these folders and files into docker container? What command in Dockerfile should I use?
Super easy solution is to use multiple time COPY command. But I believe, that it's wrong way
put your files in a repository, and do a git clone or hg clone of course you will need to install git or mercurial before, and remove them after, see as an example
hub.docker.com/r/k3ck3c/simh_alpine
As I seen in Dockerfile documentation on COPY says:
The COPY instruction copies new files or directories from and adds them to the filesystem of the container at the path .
Therefore you can copy a whole directory.
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