DEV Community

Josh Kasuboski
Josh Kasuboski

Posted on • Originally published at joshkasuboski.com on

1

Add Multi-Arch Dependencies Easily

I wanted to build a multi-arch docker image for media transcoding. Time to get the dependencies from someone who already did it.

The Goal

I wanted a multi-arch image to run mdhiggins/sickbeard_mp4_automator. I just needed the manual.py script not the radarr integration. The images published by mdhiggins are based on images like the linuxserver/radarr image and aren't multi-arch.

You can skip ahead to just see the Dockerfile at kasuboski/manual-sma.

The main issue for making the image multi-arch is ffmpeg. In the mdhiggins/radarr-sma Dockerfile, it is always downloading the amd64 version of ffmpeg. This obviously won't go well for other architectures.

There are ffmpeg builds published for other architectures. You would just need to make sure to download the correct one.

The Lazy Solution

It wouldn't be too bad to figure out which architecture is being built and then download the correct version of ffmpeg. It is one more script to maintain though.

I noticed the linuxserver repo has a multi-arch ffmpeg container already. They include a statically compiled ffmpeg so getting it into my image is as easy as copying the binary.

Dockerfiles have a COPY --from=<image> option. This lets you copy files from another image. That image will automatically be the correct one for your architecture (as long as the image supports it).

So instead of figuring out the correct architecture and downloading the corresponding ffmpeg. You can just add FROM linuxserver/ffmpeg as ffmpeg and then COPY --from=ffmpeg /usr/local/bin/ff* /usr/local/bin/.

This will copy both ffmpeg and ffprobe to the built container.

To build the image, I used the same method as my building multiarch images post. Basically, setting up docker buildx in GitHub Actions. You can see the workflow at kasuboski/manual-sma.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more