-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.alpine
74 lines (60 loc) · 3.17 KB
/
Dockerfile.alpine
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
ARG ALPINE_VERSION=3.15
FROM alpine:${ALPINE_VERSION} as build
MAINTAINER "Vitali Khlebko [email protected]"
ENV FS_VERSION=v1.10
ENV FS_TAG=v1.10.10
ENV SOFIA_TAG=v1.13.16
# Hand-checked packages
# RUN apk update && apk add git automake autoconf libtool alpine-sdk \
# zlib-dev jpeg-dev sqlite-dev curl-dev pcre-dev speex-dev speexdsp-dev ldns-dev libedit-dev tiff-dev \
# yasm bsd-compat-headers unixodbc-dev libuuid libpq opus-dev \
RUN apk update && apk add git automake autoconf libtool alpine-sdk \
zlib-dev jpeg-dev sqlite-dev curl-dev pcre-dev speex-dev speexdsp-dev ldns-dev libedit-dev tiff-dev \
yasm bsd-compat-headers unixodbc-dev libuuid libpq opus-dev \
coreutils db-dev flac-dev flite-dev gdbm-dev gnutls-dev ilbc-dev lame-dev libexecinfo-dev libjpeg-turbo-dev \
libogg-dev libpri-dev libressl-dev libshout-dev libsndfile-dev libvorbis-dev linux-headers lua5.2-dev \
mpg123-dev ncurses-dev net-snmp-dev perl-dev portaudio-dev postgresql-dev sngtc_client-dev util-linux-dev \
xmlrpc-c-dev php7-dev erlang-dev spandsp3-dev
# https://github.com/freeswitch/sofia-sip
RUN cd /tmp &&\
git clone https://github.com/freeswitch/sofia-sip.git sofia-sip &&\
cd sofia-sip &&\
git checkout ${SOFIA_TAG} &&\
git config pull.rebase true &&\
sh autogen.sh &&\
./configure &&\
make && make install
ADD *.patch /tmp/
# https://freeswitch.org/confluence/display/FREESWITCH/Debian+8+Jessie#Debian8Jessie-BuildingFromSource
RUN cd /tmp &&\
git clone https://github.com/signalwire/freeswitch.git freeswitch &&\
cd freeswitch &&\
git checkout ${FS_TAG} &&\
git config pull.rebase true &&\
git apply /tmp/signalwire-disabled.patch &&\
git apply /tmp/custom-modules.patch &&\
git apply /tmp/libvpx.patch &&\
rm /tmp/*.patch &&\
./bootstrap.sh -j &&\
./configure --enable-portable-binary \
--prefix=/usr --localstatedir=/var --sysconfdir=/etc \
--with-gnu-ld --with-erlang --with-openssl \
--enable-core-odbc-support --enable-zrtp \
--enable-core-pgsql-support &&\
make && make install
RUN rm -rf /tmp/freeswitch && rm -rf /tmp/sofia-sip
FROM alpine:${ALPINE_VERSION}
RUN apk update && apk add libpq libuuid sqlite-dev curl-dev pcre-dev speex-dev speexdsp-dev libedit-dev unixodbc-dev \
jpeg-dev opus-dev tiff-dev libsndfile-dev lua5.2-dev ldns-dev ilbc spandsp3-dev && rm -rf /var/cache/apk/*
#COPY --from=build /etc/freeswitch /etc/freeswitch
COPY --from=build /run/freeswitch /run/freeswitch
COPY --from=build ["/usr/bin/freeswitch", "/usr/bin/fs_cli", "/usr/bin/fs_encode", "/usr/bin/fs_ivrd", \
"/usr/bin/fsxs", "/usr/bin/gentls_cert", "/usr/bin/fs_tts", "/usr/bin/tone2wav", "/usr/bin/"]
COPY --from=build /usr/include/freeswitch /usr/include/freeswitch
COPY --from=build /usr/lib/freeswitch /usr/lib/freeswitch
COPY --from=build /usr/lib/libfreeswitch.* /usr/lib/
COPY --from=build /usr/local/lib/libsofia-sip-ua.* /usr/lib/
COPY --from=build /usr/lib/pkgconfig/freeswitch.pc /usr/lib/pkgconfig/
COPY --from=build /usr/share/freeswitch /usr/share/freeswitch
COPY --from=build /var/log/freeswitch /var/log/freeswitch
ENTRYPOINT ["/usr/bin/freeswitch"]