fusillicode
Dockerize an Elixir escript (or mix task)
Hi 
I’m having an hard times trying to figure out “the best” way to build a “simple” Elixir script (or task) that should run scheduled by a k8s job.
I know that Elixir doesn’t actually address this kind of use cases but I would really like use it considering the great experience I had in the past.
I’ve already implemented some tasks (mix tasks) to accomplish some data transformations with Flow & other libs and I would really love to replicate the experience but in a containerized environment.
The task that I need to implement would need to fetch some data from some REST APIs, query a DB and save some info inside it. So I’ll have a few dependencies to libs like postgrex & httpoison.
Is there an easy way to accomplish what I have in mind? 
Thanks in advance to everyone 
Most Liked
fusillicode
Got it.
One last (I hope) concern…I’m just trying (almost live) to pass ENV vars both by building & running the script locally on my machine & through docker.
Unfortunately, as I expected, their not properly evaluated.
P.S: I’m just trying to find the post that describe the issue with ENV and compilation that I’ve read just a little while ago 
NobbZ
In an escript you can simply read the os-environment and write to the app-environment. There shouldn’t be any issues.







