How to install apt packages with fly.toml

Hey there, I am new to fly.io, I have a Phoenix app, I have followed all the steps, and everything is fine, I now have a new fly.toml file.

The problem is that my app makes use of ffmpeg and ImageMagick. How can I install them? Is there an option in fly.toml or I have to use Dockerfile?

Any examples on any of that?

Thanks!

Hi!

Yep, that needs to be done in the Dockerfile. For phoenix, the base container is Debian, so the “apt” command should be available to use.

It is, essentially, “just” adding something like this to the Dockerfile:

RUN apt-get install -y ffmpeg

(perhaps append ffmpeg to the items installed here: flyctl/Dockerfile at master · superfly/flyctl · GitHub )

(It’s possible you’ll need to install other libraries depending on what you’re doing with ffmpeg).

1 Like

Hi!

I don’t use a Dockerfile, I used Heroku buildpacks, do you have any idea how to install apt packages?

Thanks