You may overwrite files.
Use multistage build and COPY (docker 19.03).
One stage
Create files outside of VOLUME'd folder. Or at same RUN step which add/modify files copy it outside of that folder.
Next stage COPY files from previous stage to VOLUME'd folder.