-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
95 lines (83 loc) · 2.11 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
FROM emscripten/emsdk:3.1.40 as build
ARG FFMPEG_VERSION=5.1.3
ARG PREFIX=/opt/ffmpeg
RUN apt-get update && apt-get install -y autoconf libtool build-essential llvm
# Get ffmpeg source.
RUN cd /root/ && \
wget http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \
tar zxf ffmpeg-${FFMPEG_VERSION}.tar.gz && rm ffmpeg-${FFMPEG_VERSION}.tar.gz
ARG CFLAGS="-O3 -Oz"
ARG LDFLAGS="$CFLAGS -s INITIAL_MEMORY=33554432"
# Compile ffmpeg.
RUN cd /root/ffmpeg-${FFMPEG_VERSION} && \
emconfigure ./configure \
--prefix=${PREFIX} \
--target-os=none \
--arch=x86_32 \
--enable-cross-compile \
--disable-debug \
--disable-x86asm \
--disable-inline-asm \
--disable-stripping \
--disable-programs \
--disable-doc \
--disable-bsfs \
--disable-network \
--disable-optimizations \
--disable-runtime-cpudetect \
--disable-hwaccels \
--enable-avcodec \
--enable-avformat \
--disable-logging \
--disable-avfilter \
--disable-avdevice \
--enable-avutil \
--disable-swresample \
--disable-postproc \
--disable-swscale \
--disable-everything \
--disable-encoders \
--enable-muxers \
--disable-filters \
--disable-outdevs \
--disable-decoders \
--enable-demuxers \
--disable-iconv \
--disable-v4l2-m2m \
--disable-amd3dnow \
--disable-mmx \
--disable-avx512 \
--disable-vulkan \
--disable-dct \
--disable-fft --disable-dwt \
--disable-lsp \
--disable-mdct \
--disable-rdft --disable-faan \
--disable-pixelutils \
--disable-valgrind-backtrace \
--enable-protocol=file \
--enable-gpl \
--enable-version3 \
--disable-pthreads \
--disable-w32threads \
--disable-os2threads \
--extra-cflags="$CFLAGS" \
--extra-cxxflags="$CFLAGS" \
--extra-ldflags="$LDFLAGS" \
--nm="llvm-nm -g" \
--ar=emar \
--as=llvm-as \
--ranlib=llvm-ranlib \
--cc=emcc \
--cxx=em++ \
--objcc=emcc \
--dep-cc=emcc
RUN cd /root/ffmpeg-${FFMPEG_VERSION} && \
emmake make -j4 && \
emmake make install
COPY ./main.cpp /build/main.cpp
COPY ./Makefile /build/Makefile
WORKDIR /build
RUN make dist/ffmime-wasm.js
FROM scratch AS mime-exporter
COPY --from=build /build/dist/* .