Docker add files to VOLUME
docker, dockerfile
Solution
Whatever you put in your Dockerfile is just evaluated at build time (and not when you are creating a new container).
If you want to make file from the host available in your container use a data volume:
docker run -v /host_dir:/container_dir ...
In case you just want to copy files from the host to a container as a one-off operation you can use:
docker cp /host_dir mycontainer:/container_dir
Problem
I have a `Dockerfile` which copies some files into the container and after that creates a VOLUME. ``` ... ADD src/ /var/www/html/ VOLUME /var/www/html/files ... ``` In the `src` folder is an files folder and in this files folder are some files I need to have copied to the VOLUME the first time the container gets started. I thought the first time the container gets created it uses the content of the original dir specified in the volume but this is not the case. So how can I get the files into this folder? Do I need to create an extra folder and copy it with a runscript (I hope not)?