Use a CLI tool to update .properties
It is more robust and more readable than using sed
.
Consider e.g:
https://github.com/jwodder/javaproperties-cli
or
https://github.com/empa-scientific-it/properties-updater
You only would need to add the binary to the dockerfile.