I’m trying to build a release of a Phoenix app to deploy onto a CentOS 7 server (currently just testing on a Vagrant VM). I’m building it using Distillery running in a Docker container based on erlang:20.0, which I’ve done successfully before (although I think that app was deployed on Ubuntu).
When I try to start the application, I get the following error:
/vagrant/erts-9.0.5/bin/beam.smp: /lib64/libz.so.1: version `ZLIB_22.214.171.124' not found (required by /vagrant/erts-9.0.5/bin/beam.smp)
It seems the VM has a newer version of zlib (zlib-1.2.7-17.el7.x86_64), which doesn’t match.
I’m not sure exactly where the dependency on zlib is coming from, but a grep of
deps points to cowboy/cowlib as the most likely answer.
Is there an easy fix for this (can I get distillery to bundle the shared library?), or does the OS I build the release on have to have exactly the same versions of any native library dependencies as the target server?
Any clues greatly appreciated!