Can I copy a file with different Name in Docker image using COPY in Dockerfile. I am trying with below:
COPY file /dest/<renamed_file>
You can simply do it like COPY test.txt /dest/test_renamed.txt without a trailing /.
If you put a trailing / like COPY test.txt /dest/test_2/, it will copy the test.txt file (with the same name, of course) into the directory at /dest/test_2/.
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