Matt Gowie
09/15/2022, 5:33 PMDockerfile.options, you folks mention preferring YAML configuration direnv>. My assumption is that you’re referring to things like terraform vars and similar configuration that atmos now covers, but not for actual environment variables. Is that correct? My team and I are working on setting env vars like KUBECONFIG + AWS_CONFIG_FILE to custom, project specific files via direnv. And before we do so I figured I would ask about that comment considering ya’ll might have some learnings there.
2. Do you have a suggested approach for running direnv allow $GEODESIC_HOST_CWD/.envrc on start of the container? I don’t want to use a preferences or overrides file because we want it to be persisted across all container sessions and not just my own. I’m assuming that means we need to add an additional bash script into rootfs/ that’ll get executed by Geodesic at start of the container, but I’m unaware what would be the best option there as I’d rather not override /etc/profile completely.Jeremy G (Cloud Posse)
09/15/2022, 7:16 PMdirenv proponent and set up all of Geodesic's direnv support.
Our current model is to use Geodesic tools against files on the host computer, mounted into the container at /localhost. This can be tricky with direnv allow, either being a hassle or a security weakness depending on your configuration and point of view. Personally I prefer setting env vars via shell scripts and functions, either run at startup or explicitly on the command line.
You can add scripts under rootfs/etc/profile.d/ in your repo. Any file in that directory ending in .sh will be sourced by bash at shell startup. Since Geodesic comes with a direnv.sh which you do not want to overwrite, you might call your script direnv_allow_host.sh and put
direnv allow $GEODESIC_HOST_CWD/.envrc
in it.Erik Osterman (Cloud Posse)
09/15/2022, 8:20 PMMatt Gowie
09/15/2022, 9:00 PM