From cc8d7a1ec64fe6096a4a5a2f2e159209f9aeefa5 Mon Sep 17 00:00:00 2001 From: Bart Date: Sat, 25 Jul 2026 09:14:16 +0200 Subject: [PATCH] Allow building without --enable-nonfree for a redistributable image The flag gates GPL-incompatible external libraries, but this build links none: the only codec libraries in the configure line are libx264 (GPL), libopus (BSD) and libvpx (BSD). Its sole effect is marking the resulting ffmpeg non-redistributable, which blocks publishing a pre-built Earshot image to a public registry. ARG ENABLE_NONFREE=1 keeps the default build byte-for-byte identical; --build-arg ENABLE_NONFREE=0 drops the flag for a redistributable build. Verified with ENABLE_NONFREE=0: 16-channel Opus (hexadecagonal, no downmix) and VP9 output unchanged. --- Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a343f1c..2ecac3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -76,12 +76,17 @@ RUN cd /tmp/ && \ wget https://github.com/EnvelopSound/ffmpeg/archive/${FFMPEG_VERSION}.tar.gz && \ tar zxf ${FFMPEG_VERSION}.tar.gz && rm ${FFMPEG_VERSION}.tar.gz +# --enable-nonfree gates GPL-incompatible libraries (e.g. libfdk_aac); this +# build links none of them, so the flag is a no-op that only marks the binary +# non-redistributable. Default on (behaviour unchanged); build with +# --build-arg ENABLE_NONFREE=0 for a redistributable image. +ARG ENABLE_NONFREE=1 # Compile ffmpeg. RUN cd /tmp/FFmpeg-${FFMPEG_VERSION} && \ ./configure \ --enable-version3 \ --enable-gpl \ - --enable-nonfree \ + $( [ "${ENABLE_NONFREE}" = "1" ] && printf '%s' '--enable-nonfree' ) \ --enable-small \ --enable-libx264 \ --enable-libopus \