forked from datarhei/restreamer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile_armv6l
148 lines (129 loc) · 4.54 KB
/
Dockerfile_armv6l
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
FROM resin/rpi-raspbian:jessie
MAINTAINER datarhei <[email protected]>
ENV NODE_VERSION=5.9.0 \
NPM_VERSION=3.7.3 \
FFMPEG_VERSION=2.8.6 \
YASM_VERSION=1.3.0 \
LAME_VERSION=3_99_5 \
NGINX_VERSION=1.9.9 \
NGINX_RTMP_VERSION=1.1.7.10 \
SRC="/usr/local"
ENV LD_LIBRARY_PATH="${SRC}/lib" \
PKG_CONFIG_PATH="${SRC}/lib/pkgconfig" \
BUILDDEPS="autoconf automake gcc g++ libtool make nasm zlib1g-dev libssl-dev xz-utils cmake build-essential libpcre3-dev"
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes curl git libpcre3 tar perl ca-certificates ${BUILDDEPS} && \
rm -rf /var/lib/apt/lists/* && \
# node
DIR="$(mktemp -d)" && cd "${DIR}" && \
set -x && \
curl -LOks "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-armv6l.tar.gz" && \
tar xzvf "node-v${NODE_VERSION}-linux-armv6l.tar.gz" \
-C "${SRC}" \
--strip-components=1 && \
npm install -g "npm@${NPM_VERSION}" --unsafe-perm && \
npm cache clear && \
npm config set unsafe-perm true -g --unsafe-perm && \
rm -rf "${DIR}" && \
# yasm
DIR="$(mktemp -d)" && cd "${DIR}" && \
curl -LOks "https://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz" && \
tar xzvf "yasm-${YASM_VERSION}.tar.gz" && \
cd "yasm-${YASM_VERSION}" && \
./configure \
--prefix="${SRC}" \
--bindir="${SRC}/bin" && \
make -j"$(nproc)" && \
make install && \
make distclean && \
rm -rf "${DIR}" && \
# x264
DIR="$(mktemp -d)" && cd "${DIR}" && \
git clone --depth 1 "git://git.videolan.org/x264" && \
cd x264 && \
./configure \
--prefix="${SRC}" \
--bindir="${SRC}/bin" \
--enable-static \
--disable-cli && \
make -j"$(nproc)" && \
make install && \
make distclean && \
rm -rf "${DIR}" && \
# libmp3lame
DIR="$(mktemp -d)" && cd "${DIR}" && \
curl -LOks "https://github.com/rbrito/lame/archive/RELEASE__${LAME_VERSION}.tar.gz" && \
tar xzvf "RELEASE__${LAME_VERSION}.tar.gz" && \
cd "lame-RELEASE__${LAME_VERSION}" && \
./configure \
--prefix="${SRC}" \
--bindir="${SRC}/bin" \
--enable-nasm \
--disable-shared && \
make -j"$(nproc)" && \
make install && \
make distclean && \
rm -rf "${DIR}" && \
# ffmpeg
# patch: andrew-shulgin Ignore invalid sprop-parameter-sets missing PPS
DIR="$(mktemp -d)" && cd "${DIR}" && \
curl -LOks "https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz" && \
tar xzvf "ffmpeg-${FFMPEG_VERSION}.tar.gz" && \
cd "ffmpeg-${FFMPEG_VERSION}" && \
curl -Lks "https://github.com/FFmpeg/FFmpeg/commit/1c7e2cf9d33968375ee4025d2279c937e147dae2.patch" | patch -p1 && \
./configure \
--prefix="${SRC}" \
--bindir="${SRC}/bin" \
--extra-cflags="-I${SRC}/include" \
--extra-ldflags="-L${SRC}/lib" \
--extra-libs=-ldl \
--enable-nonfree \
--enable-gpl \
--enable-version3 \
--enable-avresample \
--enable-libmp3lame \
--enable-libx264 \
--enable-openssl \
--enable-postproc \
--enable-small \
--disable-debug \
--disable-doc \
--disable-ffserver && \
make -j"$(nproc)" && \
make install && \
make distclean && \
hash -r && \
cd tools && \
make qt-faststart && \
cp qt-faststart "${SRC}/bin" && \
rm -rf "${DIR}" && \
echo "${SRC}/lib" > "/etc/ld.so.conf.d/libc.conf" && \
ffmpeg -buildconf && \
# nginx-rtmp
DIR="$(mktemp -d)" && cd "${DIR}" && \
curl -LOks "https://github.com/nginx/nginx/archive/release-${NGINX_VERSION}.tar.gz" && \
tar xzvf "release-${NGINX_VERSION}.tar.gz" && \
curl -LOks "https://github.com/sergey-dryabzhinsky/nginx-rtmp-module/archive/v${NGINX_RTMP_VERSION}.tar.gz" && \
tar xzvf "v${NGINX_RTMP_VERSION}.tar.gz" && \
cd "nginx-release-${NGINX_VERSION}" && \
auto/configure \
--with-http_ssl_module \
--add-module="../nginx-rtmp-module-${NGINX_RTMP_VERSION}" && \
make -j"$(nproc)" && \
make install && \
rm -rf "${DIR}" && \
apt-get purge -y --auto-remove ${BUILDDEPS} && \
rm -rf /tmp/*
COPY . /restreamer
WORKDIR /restreamer
RUN npm install -g bower grunt grunt-cli nodemon public-ip && \
npm install && \
grunt build && \
npm prune --production && \
npm cache clean && \
bower cache clean --allow-root
ENV RS_USERNAME admin
ENV RS_PASSWORD datarhei
EXPOSE 8080
VOLUME ["/restreamer/db"]
CMD ["./run.sh"]