docker-library / busybox

Docker Official Image packaging for Busybox
http://busybox.net
396 stars 127 forks source link

Add envsubst to the container. #130

Closed kadams0911 closed 2 years ago

kadams0911 commented 2 years ago

By having envsubst to the container, an Init pod or any type of pod/deployment can grab the already installed environment variables in the pod/deployment and create the more precise configuration files to the pod/deployment. Example: /etc/database/creds-template.conf

username=${DB_USERNAME}
password=${DB_PASSWORD}
envsubst < /etc/database/creds-template.conf > /etc/database/creds.conf

Will allow like ${DB_USERNAME} and ${DB_PASSWORD} that are already set in environment like k8s secret mounts or environment secrets references to be substituted so that the original file, at rest, does NOT have the creds exposed.

yosifkit commented 2 years ago

envsubst is not a possible busybox command applet (https://www.busybox.net/downloads/BusyBox.html). So we will not be adding it.