I’ve often seen “complaints” of people trying out elixir and releases that it’s difficult to setup mostly because of the need of matching up build and production server. Sure one can build the release on the production server for trying things out, but that needs erlang and elixir being installed on the production server essentially removes one of the “advertised” upsides of releases for not needing to do that. One can use docker, but not everyone is willing to fiddle with that for a quick trial.
Given hex bob does now build precompiled packages of erlang for all ubuntu lts versions there seems to be another viable path however, which I tried out quickly last week: Download those precompiled packages and extract the erts portion to build the release with. Given my understanding this should work fine for any project not needing to run NIFs or otherwise depending on actual cross compilation.
The following is a proof of concept of what I built:
This feels like it could be a great way to ease people into building releases without immediatelly forcing them to use the complex solutions if all they need is ERTS being compiled on some version of ubuntu. I only did some quick experiment with an bare phoenix installation released for ubuntu 16.04 from my mac and this seemed to work fine.
@ericmj also suggested that extracting erts out of the many docker images hex builds might be an option, which would allow for even more variety, but I feel it would likely be simpler to just build the release within an docker container in the first place.
I’m wondering what people think about this approach. I might put it together into a proper library with some more documentation, like suggesting pbkdf2_elixir
for not having a C dependency, ….