Tag Archives: docker

Read environment variables from files in bash

In the Docker world it’s increasingly common to send secrets through files instead of environment variables by appendingĀ _FILE to the regular environment variable name.

Here’s a bash function which reads such files and updates the corresponding environment variable with the file contents.

Example usage: