Docker can’t install build essentials error: Package build-essential is not available

In general I would strongly recommend using the official hexpm images, rather than the elixir image managed by your distro.

Here hexpm/elixir - Docker Image you can choose exactly which core distro you want, elixir version, and erlang version.