I can't seem to be able to access env variables with (System/getenv "foobar")
when running a native image. Is there some hoops I gotta jump through to make it work?
@matias287 you need to defer getting those environment variables to runtime, so wrap it in a function or a delay
So instead of
(def ACCESS_TOKEN (System/getenv "foo"))
I should do
(defn [] get_access_token (System/getenv "foo"))
?
yes
Cheers. I'll try that
else you will get to see the compile time environment variables
What if I provide the env variable in compile time already?
Would that fix it?
then that should work
I have 2 different docker containers doing the code => jar and jar => native image tasks. Which one would I need to expose it to?
but this is possibly a security issue if you distribute those binaries to people you don't trust
the native image one
Yeah the current use case is just that I build the image, and push it to aws lambda
So no one will be touching them directly
also you don't have any way to refresh the token without re-building your native image
Oh that's true
Maybe I'll wrap it then