Replacing env variables in files without external tools
The following script recursively copies all files from /config-image
directory to /config
and replaces env variables inside the files.
|
|
For example, /config-image
could contain next file:
|
|
The result of the script above would be next
|
|
All the replacement magic is done by envsubst but it took me a while to combine it with file copying and hierarchical file structure processing.
Script works in clean alpine setup with only gettext additional package installed.