Docker File COPY

Apparently my mental model of how this works and reality are not ‘in sync’ :wink: I ‘assumed’ that if I copied in a file that it would overwrite any file in the container when I am using COPY in the dockerfile. This is only apparently half true. the configuration file already exists in the container. So for example if the configuration file has 25 lines in it, I am copying in an additional 10 lines. 9 of those lines are in fact copying correctly but because that 10th line already exists it will not overwrite. So it ‘appears’ that the COPY command is not really a CP command but a DIF copy kind of. I guess I am going to have to go back to the drawing board and figure this one out. It just seemed that since I can copy the file once the container is running that I should be able to copy the file before the container runs. Thanks for your help.

just depends on what that program does when it starts…

‘typically’ a config file (cf/cnf/conf) is read only… by the application…

again, you can prove that this is not true by using the run/attach commands to verify that your file does/doesn’t get modified by the application…

i don’t think the copy has anything to do with it…