-
Notifications
You must be signed in to change notification settings - Fork 132
/
Dockerfile
67 lines (65 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
FROM centos:centos7
LABEL maintainer='Doug Smith <info@laboratoryb.org>' contributors='Christophe Langenberg <christophe@langenberg.be>'
ENV build_date 2016-05-14
ENV AUTOBUILD_UNIXTIME 1418234402
ENV rebuild_date 2015-05-15
RUN yum update -y \
&& yum install -y \
kernel-headers \
wget \
gcc \
gcc-c++ \
cpp \
ncurses \
ncurses-devel \
libxml2 \
libxml2-devel \
sqlite \
sqlite-devel \
openssl-devel \
newt-devel \
kernel-devel \
libuuid-devel \
net-snmp-devel \
xinetd \
tar \
make \
git \
&& yum clean all \
&& cd /tmp \
# Download asterisk.
&& git clone -b certified/11.6 --depth 1 https://gerrit.asterisk.org/asterisk \
&& cd asterisk \
# make asterisk.
# Configure
&& ./configure --libdir=/usr/lib64 1> /dev/null \
# Remove the native build option
&& make -j$(nproc) menuselect.makeopts \
&& menuselect/menuselect \
--disable BUILD_NATIVE \
--enable cdr_csv \
--enable chan_sip \
--enable res_snmp \
--enable res_http_websocket \
menuselect.makeopts \
# Continue with a standard make.
&& make -j$(nproc) 1> /dev/null \
&& make -j$(nproc) install 1> /dev/null \
&& make -j$(nproc) samples 1> /dev/null \
# clean up the cached make files
&& make dist-clean \
# Update max number of open files.
&& sed -i -e 's/# MAXFILES=/MAXFILES=/' /usr/sbin/safe_asterisk \
# Set tty
&& sed -i 's/TTY=9/TTY=/g' /usr/sbin/safe_asterisk \
# Create and configure asterisk for running asterisk user.
&& useradd -m asterisk -s /sbin/nologin \
&& chown -R asterisk:asterisk /var/run/asterisk \
/etc/asterisk/ \
/var/lib/asterisk \
/var/log/asterisk \
/var/spool/asterisk \
/usr/lib64/asterisk/
# Running asterisk with user asterisk.
USER asterisk
CMD /usr/sbin/asterisk -fvvvvv