envsubst instead of sed
What is the motivation or use case for the change?
Replacing variables using sed is pretty rough and prone to errors and misreplacements.
https://github.com/CrunchyData/crunchy-containers/blob/237245acd35a5fc15cec2f14c00a040bd3b5eed0/bin/postgres/start.sh#L162-L169
https://github.com/CrunchyData/crunchy-containers/blob/237245acd35a5fc15cec2f14c00a040bd3b5eed0/bin/postgres/start.sh#L295-L298
https://github.com/CrunchyData/crunchy-containers/blob/237245acd35a5fc15cec2f14c00a040bd3b5eed0/bin/postgres/start.sh#L343-L348
Describe the solution you'd like What about envsubst? It has been made for that purpose back in 2009.
It would be also nice to use it here: https://github.com/CrunchyData/crunchy-containers/blob/237245acd35a5fc15cec2f14c00a040bd3b5eed0/bin/postgres/start.sh#L353
Open to the idea. Please feel free to submit a patch :smile:
I have issues building images locally, so I am not able to test them at the moment:
error dry-running "ADD conf/RPM-GPG-KEY-crunchydata /": no files found matching "/home/frafra/Code/crunchy-containers/conf/RPM-GPG-KEY-crunchydata": no such file or directory
Hi @frafra,
Thanks for your patience. The files you need to build are now available. You can get the key/repo file here:
https://www.crunchydata.com/developers/download-postgres/binaries/postgresql12
Thanks!