If you are building it on your mac, you are most probably building the image for ARM, while your classical server is using x86-64. For cross-compilation I think you need to setup qemu locally.
It doesn’t matter where you create the release, it matters what machine creates the release. You are copying the compiled runtime from your system into the container.
As I understand I’m building the release inside the container, and then trying to run it inside such same container, so it should work unless I’m misunderstanding how docker build works
OK, that’s a really weird way of installing Erlang and Elixir but there are likely not many officially blessed ways under CentOS – not an expert on it.
Have you also tried put CMD /bin/topo_master start at the end of the Dockerfile so you don’t have to get inside it to start the app?
These might not be strongly related to your problem but I’d go through such a laundry list to make sure it’s not something in earlier stages of the deployment decisions.
I don’t think the have the latest version.
I tried the approach you suggested using those docker images from hexpm and now I get a slightly different error:
root@ca9d0e762504:/app# _build/prod/rel/topo_master/bin/topo_master start
/app/_build/prod/rel/topo_master/releases/1.4.0/../../erts-14.2.1/bin/erl: 12: exec: /app/_build/prod/rel/topo_master/erts-14.2.1/bin/erlexec: Exec format error
You should double check. Are you building inside the CentOS 7 container and then just copying the release to the baremetal CentOS 7 machines? If so, it can still be a mismatch e.g. the build container is having a x64 CPU and the prod machines use ARM?
I finally found the issue… the problem is that when I was copying the files to the container, I was also copying the _build and deps folders from my machine, and that is where everything got mixed.
Added a .dockerignore to exclude those folders and at least now the app tries to start… got a whole set of errors now but a lot less obscure.