Is there a way to package binary dependencies with Distillery?

Some Elixir libraries depend on binaries such as imagemagick, wkhtmltopdf, pdftk, etc, but I’m not sure I want my production machine to have these binaries built-in. Is there a way to include these binaries as part of a Distillery release?

Unfortunately no. The problem here is that those binaries not only are compiled for a specific architecture, but often are dynamically linking specific system libraries (or third-party libs for that matter). Your system package manager already solves the problem of pulling down the correct versions of everything needed by a given program, so I would stick with that. If you are concerned about running multiple versions of a given program on the same host, I’d look into something like Nix, which allows you to run an application in an environment with a specific set of system dependencies, which should accomplish compartmentalization as well as being able to “lock” your system dependencies to versions you have verified compatibility with.

2 Likes