I’d like to describe the way we’re compiling our release and see if there are any known problems with this approach.
As we all know, when compiling a release, it’s important to use the Erlang Runtime System for the target operating system.
As a team we have various OS’s so obviously we can’t just mix release
. Instead we have a script which uses the latest Erlang docker file, and copies the ERTS folders onto the host. This only needs to happen once (unless you delete the files).
After that, we are now free to build our release using mix, with a target that specifies include_erts: "../path/to/erts"
.
With this approach, we can compile releases super quick as we’re only compiling our own app code.
The only downside we have found so far is that we’re forced to use Debian because that’s what the official erlang:latest docker file is based on. I’m sure you could create your own with your desired OS if required of course.
I’m interested if anyone else is doing it this way?
And if so, are there any downsides, or gotcha’s that we might bump our head on?