-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
66 lines (60 loc) · 3.37 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
FROM ubuntu:focal as build
RUN sed -i -e 's:# deb-src :deb-src :' /etc/apt/sources.list && \
apt-get update && \
export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && \
apt-get -y install debconf-utils wget && \
echo "libvpb1 libvpb1/countrycode string 1" | debconf-set-selections && \
echo "tzdata tzdata/Areas select Etc" | debconf-set-selections && \
echo "tzdata tzdata/Zones/Etc select UTC" | debconf-set-selections && \
echo "Etc/UTC" > /etc/timezone && \
apt-get -y build-dep asterisk
ARG asterisk_version
RUN wget -O asterisk.tar.gz http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-${asterisk_version}.tar.gz && \
tar xzf asterisk.tar.gz
RUN cd asterisk-${asterisk_version} && \
./configure --with-dahdi=no --with-pri=no \
&& make menuselect.makeopts \
&& menuselect/menuselect --disable BUILD_NATIVE menuselect.makeopts \
&& make ASTDBDIR=/var/lib/asterisk/db -j$(grep -c ^processor /proc/cpuinfo) && make install
FROM ubuntu:focal
RUN apt-get update && \
apt-get -y install debconf-utils && \
echo "libvpb1 libvpb1/countrycode string 1" | debconf-set-selections && \
echo "tzdata tzdata/Areas select Etc" | debconf-set-selections && \
echo "tzdata tzdata/Zones/Etc select UTC" | debconf-set-selections && \
echo "Etc/UTC" > /etc/timezone && \
export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && \
apt-get -y install gosu libcap2 libedit2 libjansson4 libpopt0 libsqlite3-0 libssl1.1 \
libsystemd0 liburiparser1 libuuid1 libxml2 libxslt1.1 libjack0 libresample1 \
libodbc1 libpq5 libsdl1.2debian libcurl4 libgsm1 liblua5.1-0 libgmime-3.0-0 \
libical3 libiksemel3 libneon27-gnutls libportaudio2 libpri1.4 libradcli4 \
libspandsp2 libspeex1 libspeexdsp1 libsqlite0 libsrtp2-1 libss7-2.0 libsybdb5 \
libtonezone2.0 libvorbisfile3 libsnmp35 && \
apt-get clean
COPY --from=build /var/spool/asterisk /var/spool/asterisk
COPY --from=build /var/lib/asterisk /var/lib/asterisk
COPY --from=build /usr/lib/asterisk /usr/lib/asterisk
COPY --from=build /usr/lib/libasteriskpj.so \
/usr/lib/libasteriskssl.so \
/usr/lib/
COPY --from=build /usr/sbin/astcanary \
/usr/sbin/astdb2bdb \
/usr/sbin/astdb2sqlite3 \
/usr/sbin/asterisk \
/usr/sbin/astgenkey \
/usr/sbin/astversion \
/usr/sbin/autosupport \
/usr/sbin/rasterisk \
/usr/sbin/safe_asterisk \
/usr/sbin/
VOLUME [ "/var/lib/asterisk/db", "/var/spool/asterisk/voicemail" ]
RUN groupadd -g 999 asterisk && useradd -s /bin/false -d /var/lib/asterisk -g asterisk -u 999 asterisk && \
mkdir -p /var/run/asterisk /var/log/asterisk && \
chown -R asterisk:asterisk /var/lib/asterisk && \
chown -R asterisk:asterisk /var/spool/asterisk && \
chown -R asterisk:asterisk /var/log/asterisk && \
chown asterisk:asterisk /var/run/asterisk && \
ldconfig
ADD docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT [ "/docker-entrypoint.sh" ]
CMD ["asterisk", "-mqf"]