Skip to content

Commit

Permalink
Vastly reduced the size of the finished container image by:
Browse files Browse the repository at this point in the history
1. Using ubuntu:latest to compile the applications from their vast amounts of library source-code
2. Copied ONLY the compiled applications and libraries into a Debian (Bullseye Slim) image, reducing the finished allav image from 1660 MB to just 338 MB in size!
  • Loading branch information
nicklansley committed Dec 3, 2020
1 parent 5beaa6f commit 798afb0
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ RUN ldconfig

# Build FFMpeg
WORKDIR /
RUN wget https://ffmpeg.org/releases/ffmpeg-4.2.1.tar.gz
RUN tar -xvf ffmpeg-4.2.1.tar.gz
WORKDIR /ffmpeg-4.2.1
RUN wget https://ffmpeg.org/releases/ffmpeg-4.3.1.tar.gz
RUN tar -xvf ffmpeg-4.3.1.tar.gz
WORKDIR /ffmpeg-4.3.1
RUN ./configure --enable-gpl \
--enable-libaom \
--enable-libfdk-aac \
Expand All @@ -74,12 +74,11 @@ RUN ./configure --enable-gpl \

RUN ldconfig

# Empty the image of all that source code
RUN rm -rf /ffmpeg-4.2.1 && rm /ffmpeg-4.2.1.tar.gz && rm -rf /lame-3.99.5 && rm -rf /lame-3.99.5.tar.gz

FROM compilation_build

# Prepare the /av volume
FROM debian:bullseye-slim
COPY --from=compilation_build /usr/local/bin /usr/local/bin
COPY --from=compilation_build /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu
WORKDIR /usr/local/bin
VOLUME /av
WORKDIR /av

0 comments on commit 798afb0

Please sign in to comment.