-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
110 lines (98 loc) · 2.35 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
###############################
# Build the FFmpeg-build image.
FROM alpine:latest as build
ARG PREFIX=/opt/ffmpeg
ARG LD_LIBRARY_PATH=/opt/ffmpeg/lib
ARG MAKEFLAGS="-j4"
# FFmpeg build dependencies.
RUN apk add --update \
build-base \
coreutils \
freetype-dev \
gcc \
lame-dev \
libogg-dev \
libass \
libass-dev \
libvpx-dev \
libvorbis-dev \
libwebp-dev \
libtheora-dev \
opus-dev \
openssl \
openssl-dev \
pkgconf \
pkgconfig \
rtmpdump-dev \
wget \
tar \
x264-dev \
x265-dev \
yasm
# Get fdk-aac from community.
RUN echo http://dl-cdn.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories && \
apk add --update fdk-aac-dev
# Get rav1e from testing.
RUN echo http://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \
apk add --update rav1e-dev
# Get ffmpeg source.
RUN cd /tmp && wget https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && tar xf ffmpeg-snapshot.tar.bz2 && rm ffmpeg-snapshot.tar.bz2
# Compile ffmpeg.
RUN cd /tmp/ffmpeg && \
./configure \
--enable-version3 \
--enable-gpl \
--enable-nonfree \
--enable-small \
--enable-libmp3lame \
--enable-libx264 \
--enable-libx265 \
--enable-libvpx \
--enable-libtheora \
--enable-libvorbis \
--enable-libopus \
--enable-libfdk-aac \
--enable-libass \
--enable-libwebp \
--enable-librtmp \
--enable-librav1e \
--enable-postproc \
--enable-avresample \
--enable-libfreetype \
--enable-openssl \
--disable-debug \
--disable-doc \
--disable-ffplay \
--extra-cflags="-I${PREFIX}/include" \
--extra-ldflags="-L${PREFIX}/lib" \
--extra-libs="-lpthread -lm" \
--prefix="${PREFIX}" && \
make && make install && make distclean
# Cleanup.
RUN rm -rf /var/cache/apk/* /tmp/*
##########################
# Build the release image.
FROM alpine:latest
LABEL "MAINTAINER"="Farshid Ashouri <[email protected]>"
LABEL "FFMPEG_VERSION"="latest"
LABEL "FFMPEG_TIER"="non-free"
ENV PATH=/opt/ffmpeg/bin:$PATH
RUN apk add --update \
ca-certificates \
openssl \
pcre \
lame \
libogg \
libass \
libvpx \
libvorbis \
libwebp \
libtheora \
opus \
rtmpdump \
x264-dev \
x265-dev
COPY --from=build /opt/ffmpeg /opt/ffmpeg
COPY --from=build /usr/lib/libfdk-aac.so.2 /usr/lib/libfdk-aac.so.2
COPY --from=build /usr/lib/librav1e.so.0 /usr/lib/librav1e.so.0
CMD ["/usr/local/bin/ffmpeg"]