Hey <@UB90MG971> — low priority, but a couple quic...
# geodesic
m
Hey @Jeremy G (Cloud Posse) — low priority, but a couple quick questions for you following some internal discussion at Masterpoint on Geodesic. 1. In
Dockerfile.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.
j
I will ask @Erik Osterman (Cloud Posse) to weigh in here, as he was the original
direnv
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
Copy code
direnv allow $GEODESIC_HOST_CWD/.envrc
in it.
e
Ya, we really haven't invested too much more in this b/c it's an interactive shell thing and we've been moving 💯 gitops
👍 1
m
Good stuff — Thanks gents!