I want a conditional COPY
in my Dockerfile
but since this option does not exist I came across this workaround. Assuming I have following case (filenames simplified):
COPY file1.txt another_folder/file1.txt* /etc/some_folder/
will the first file1.txt
be overwritten by the second another_folder/file1.txt
if the second exists? So that /etc/some_folder/file1.txt
will be the one of another_folder
if it exists, otherwise the first.
Both filenames will be the same name but not the same content.
To make it clear upfront, I want the described behaviour.