more asterisks
This commit is contained in:
parent
6781441751
commit
fac295f9d4
@ -1,11 +1,12 @@
|
||||
# vim:set ft=dockerfile:
|
||||
FROM alpine:3.8
|
||||
FROM alpine:3.10
|
||||
|
||||
MAINTAINER Andrius Kairiukstis <andrius@kairiukstis.com>
|
||||
|
||||
RUN apk add --update \
|
||||
asterisk \
|
||||
asterisk-sample-config \
|
||||
&& rm -rf /usr/lib/asterisk/modules/*pjsip* \
|
||||
&& asterisk -U asterisk \
|
||||
&& sleep 5 \
|
||||
&& pkill -9 asterisk \
|
17
debian-buster-certified-13.21-cert4/Dockerfile
Normal file
17
debian-buster-certified-13.21-cert4/Dockerfile
Normal file
@ -0,0 +1,17 @@
|
||||
# vim:set ft=dockerfile:
|
||||
FROM debian:buster-slim
|
||||
|
||||
LABEL maintainer="Andrius Kairiukstis <k@andrius.mobi>"
|
||||
|
||||
ENV ASTERISK_VERSION asterisk-certified-13.21-cert4
|
||||
ENV OPUS_CODEC asterisk-13.0/x86-64/codec_opus-13.0_current-x86_64
|
||||
|
||||
COPY build-asterisk.sh /
|
||||
RUN /build-asterisk.sh
|
||||
|
||||
EXPOSE 5060/udp 5060/tcp
|
||||
VOLUME /var/lib/asterisk/sounds /var/lib/asterisk/keys /var/lib/asterisk/phoneprov /var/spool/asterisk /var/log/asterisk
|
||||
|
||||
COPY docker-entrypoint.sh /
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
CMD ["/usr/sbin/asterisk", "-vvvdddf", "-T", "-W", "-U", "asterisk", "-p"]
|
130
debian-buster-certified-13.21-cert4/build-asterisk.sh
Executable file
130
debian-buster-certified-13.21-cert4/build-asterisk.sh
Executable file
@ -0,0 +1,130 @@
|
||||
#!/bin/bash
|
||||
PROGNAME=$(basename $0)
|
||||
|
||||
if test -z ${ASTERISK_VERSION}; then
|
||||
echo "${PROGNAME}: ASTERISK_VERSION required" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -ex
|
||||
|
||||
useradd --system asterisk
|
||||
|
||||
apt-get update -qq
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||
autoconf \
|
||||
binutils-dev \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
curl \
|
||||
file \
|
||||
libcurl4-openssl-dev \
|
||||
libedit-dev \
|
||||
libgsm1-dev \
|
||||
libjansson4 \
|
||||
libjansson-dev \
|
||||
libogg-dev \
|
||||
libpopt-dev \
|
||||
libresample1-dev \
|
||||
libspandsp-dev \
|
||||
libspeex-dev \
|
||||
libspeexdsp-dev \
|
||||
libsqlite3-dev \
|
||||
libsrtp2-dev \
|
||||
libssl-dev \
|
||||
libvorbis-dev \
|
||||
libxml2-dev \
|
||||
libxslt1-dev \
|
||||
procps \
|
||||
portaudio19-dev \
|
||||
unixodbc \
|
||||
unixodbc-bin \
|
||||
unixodbc-dev \
|
||||
odbcinst \
|
||||
uuid \
|
||||
uuid-dev \
|
||||
xmlstarlet
|
||||
|
||||
apt-get purge -y --auto-remove
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
mkdir -p /usr/src/asterisk
|
||||
cd /usr/src/asterisk
|
||||
|
||||
curl -vsL http://downloads.asterisk.org/pub/telephony/certified-asterisk/releases/${ASTERISK_VERSION}.tar.gz | tar --strip-components 1 -xz
|
||||
|
||||
# 1.5 jobs per core works out okay
|
||||
: ${JOBS:=$(( $(nproc) + $(nproc) / 2 ))}
|
||||
|
||||
./configure --with-resample --with-pjproject-bundled
|
||||
make menuselect/menuselect menuselect-tree menuselect.makeopts
|
||||
|
||||
# disable BUILD_NATIVE to avoid platform issues
|
||||
menuselect/menuselect --disable BUILD_NATIVE menuselect.makeopts
|
||||
|
||||
# enable good things
|
||||
menuselect/menuselect --enable BETTER_BACKTRACES menuselect.makeopts
|
||||
|
||||
# codecs
|
||||
# menuselect/menuselect --enable codec_opus menuselect.makeopts
|
||||
# menuselect/menuselect --enable codec_silk menuselect.makeopts
|
||||
|
||||
# # download more sounds
|
||||
# for i in CORE-SOUNDS-EN MOH-OPSOUND EXTRA-SOUNDS-EN; do
|
||||
# for j in ULAW ALAW G722 GSM SLN16; do
|
||||
# menuselect/menuselect --enable $i-$j menuselect.makeopts
|
||||
# done
|
||||
# done
|
||||
|
||||
# we don't need any sounds in docker, they will be mounted as volume
|
||||
menuselect/menuselect --disable-category MENUSELECT_CORE_SOUNDS
|
||||
menuselect/menuselect --disable-category MENUSELECT_MOH
|
||||
menuselect/menuselect --disable-category MENUSELECT_EXTRA_SOUNDS
|
||||
|
||||
make -j ${JOBS} all
|
||||
make install
|
||||
|
||||
# copy default configs
|
||||
# cp /usr/src/asterisk/configs/basic-pbx/*.conf /etc/asterisk/
|
||||
make samples
|
||||
|
||||
# set runuser and rungroup
|
||||
sed -i -E 's/^;(run)(user|group)/\1\2/' /etc/asterisk/asterisk.conf
|
||||
|
||||
# Install opus, for some reason menuselect option above does not working
|
||||
mkdir -p /usr/src/codecs/opus \
|
||||
&& cd /usr/src/codecs/opus \
|
||||
&& curl -vsL http://downloads.digium.com/pub/telephony/codec_opus/${OPUS_CODEC}.tar.gz | tar --strip-components 1 -xz \
|
||||
&& cp *.so /usr/lib/asterisk/modules/ \
|
||||
&& cp codec_opus_config-en_US.xml /var/lib/asterisk/documentation/
|
||||
|
||||
mkdir -p /etc/asterisk/ \
|
||||
/var/spool/asterisk/fax
|
||||
|
||||
chown -R asterisk:asterisk /etc/asterisk \
|
||||
/var/*/asterisk \
|
||||
/usr/*/asterisk
|
||||
chmod -R 750 /var/spool/asterisk
|
||||
|
||||
cd /
|
||||
rm -rf /usr/src/asterisk \
|
||||
/usr/src/codecs
|
||||
|
||||
# remove *-dev packages
|
||||
devpackages=`dpkg -l|grep '\-dev'|awk '{print $2}'|xargs`
|
||||
DEBIAN_FRONTEND=noninteractive apt-get --yes purge \
|
||||
autoconf \
|
||||
build-essential \
|
||||
bzip2 \
|
||||
cpp \
|
||||
m4 \
|
||||
make \
|
||||
patch \
|
||||
perl \
|
||||
perl-modules \
|
||||
pkg-config \
|
||||
xz-utils \
|
||||
${devpackages}
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
exec rm -f /build-asterisk.sh
|
25
debian-buster-certified-13.21-cert4/docker-entrypoint.sh
Executable file
25
debian-buster-certified-13.21-cert4/docker-entrypoint.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
# run as user asterisk by default
|
||||
ASTERISK_USER=${ASTERISK_USER:-asterisk}
|
||||
|
||||
if [ "$1" = "" ]; then
|
||||
COMMAND="/usr/sbin/asterisk -T -W -U ${ASTERISK_USER} -p -vvvdddf"
|
||||
else
|
||||
COMMAND="$@"
|
||||
fi
|
||||
|
||||
if [ "${ASTERISK_UID}" != "" ] && [ "${ASTERISK_GID}" != "" ]; then
|
||||
# recreate user and group for asterisk
|
||||
# if they've sent as env variables (i.e. to macth with host user to fix permissions for mounted folders
|
||||
|
||||
deluser asterisk && \
|
||||
adduser --gecos "" --no-create-home --uid ${ASTERISK_UID} --disabled-password ${ASTERISK_USER} \
|
||||
|| exit
|
||||
fi
|
||||
|
||||
chown -R ${ASTERISK_USER}: /var/log/asterisk \
|
||||
/var/lib/asterisk \
|
||||
/var/run/asterisk \
|
||||
/var/spool/asterisk; \
|
||||
exec ${COMMAND}
|
17
debian-jessie-slim-1.6.2.24/Dockerfile
Normal file
17
debian-jessie-slim-1.6.2.24/Dockerfile
Normal file
@ -0,0 +1,17 @@
|
||||
# vim:set ft=dockerfile:
|
||||
FROM debian:jessie-slim
|
||||
|
||||
LABEL maintainer="Andrius Kairiukstis <k@andrius.mobi>"
|
||||
|
||||
ENV ASTERISK_VERSION 1.6.2.24
|
||||
ENV ASTERISK_ADDONS_VERSION 1.6.2.4
|
||||
|
||||
COPY build-asterisk.sh /
|
||||
RUN /build-asterisk.sh
|
||||
|
||||
EXPOSE 5060/udp 5060/tcp
|
||||
VOLUME /var/lib/asterisk/sounds /var/lib/asterisk/keys /var/lib/asterisk/phoneprov /var/spool/asterisk /var/log/asterisk
|
||||
|
||||
COPY docker-entrypoint.sh /
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
CMD ["/usr/sbin/asterisk", "-vvvdddf", "-T", "-W", "-U", "asterisk", "-p"]
|
125
debian-jessie-slim-1.6.2.24/build-asterisk.sh
Executable file
125
debian-jessie-slim-1.6.2.24/build-asterisk.sh
Executable file
@ -0,0 +1,125 @@
|
||||
#!/bin/bash
|
||||
PROGNAME=$(basename $0)
|
||||
|
||||
if test -z ${ASTERISK_VERSION}; then
|
||||
echo "${PROGNAME}: ASTERISK_VERSION required" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -ex
|
||||
|
||||
useradd --system asterisk
|
||||
|
||||
apt-get update -qq
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||
autoconf \
|
||||
binutils-dev \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
curl \
|
||||
file \
|
||||
libcurl4-openssl-dev \
|
||||
libedit-dev \
|
||||
libgsm1-dev \
|
||||
libjansson-dev \
|
||||
libogg-dev \
|
||||
libpopt-dev \
|
||||
libresample1-dev \
|
||||
libspandsp-dev \
|
||||
libspeex-dev \
|
||||
libspeexdsp-dev \
|
||||
libsqlite3-dev \
|
||||
libssl-dev \
|
||||
libvorbis-dev \
|
||||
libxml2-dev \
|
||||
libxslt1-dev \
|
||||
portaudio19-dev \
|
||||
unixodbc \
|
||||
unixodbc-bin \
|
||||
unixodbc-dev \
|
||||
odbcinst \
|
||||
uuid \
|
||||
uuid-dev \
|
||||
xmlstarlet
|
||||
|
||||
apt-get purge -y --auto-remove
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
mkdir -p /usr/src/asterisk \
|
||||
/usr/src/asterisk/addons
|
||||
|
||||
cd /usr/src/asterisk/addons
|
||||
curl -vsL http://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-addons-${ASTERISK_ADDONS_VERSION}.tar.gz | tar --strip-components 1 -xz
|
||||
|
||||
cd /usr/src/asterisk
|
||||
curl -vsL http://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-${ASTERISK_VERSION}.tar.gz | tar --strip-components 1 -xz
|
||||
|
||||
# 1.5 jobs per core works out okay
|
||||
: ${JOBS:=$(( $(nproc) + $(nproc) / 2 ))}
|
||||
|
||||
mkdir -p /etc/asterisk/ \
|
||||
/var/spool/asterisk/fax
|
||||
|
||||
./configure --libdir=/usr/lib64
|
||||
make menuselect/menuselect menuselect-tree menuselect.makeopts
|
||||
|
||||
# we don't need any sounds in docker, they will be mounted as volume
|
||||
menuselect/menuselect --disable-category MENUSELECT_CORE_SOUNDS menuselect.makeopts
|
||||
menuselect/menuselect --disable-category MENUSELECT_MOH menuselect.makeopts
|
||||
menuselect/menuselect --disable-category MENUSELECT_EXTRA_SOUNDS menuselect.makeopts
|
||||
|
||||
make -j ${JOBS} all
|
||||
make install
|
||||
|
||||
# copy default configs
|
||||
# cp /usr/src/asterisk/configs/basic-pbx/*.conf /etc/asterisk/
|
||||
make samples
|
||||
make dist-clean
|
||||
|
||||
# set runuser and rungroup
|
||||
sed -i -E 's/^;(run)(user|group)/\1\2/' /etc/asterisk/asterisk.conf
|
||||
sed -i -e 's/# MAXFILES=/MAXFILES=/' /usr/sbin/safe_asterisk
|
||||
|
||||
cd /usr/src/asterisk/addons
|
||||
|
||||
./configure --libdir=/usr/lib64
|
||||
make menuselect/menuselect menuselect-tree menuselect.makeopts
|
||||
|
||||
# disable saycountpl
|
||||
menuselect/menuselect --disable app_saycountpl
|
||||
|
||||
# enable ooh323
|
||||
menuselect/menuselect --enable chan_ooh323 menuselect.makeopts
|
||||
|
||||
make -j ${JOBS} all
|
||||
make install
|
||||
make samples
|
||||
|
||||
chown -R asterisk:asterisk /etc/asterisk \
|
||||
/var/*/asterisk \
|
||||
/usr/*/asterisk \
|
||||
/usr/lib64/asterisk
|
||||
chmod -R 750 /var/spool/asterisk
|
||||
|
||||
cd /
|
||||
rm -rf /usr/src/asterisk \
|
||||
/usr/src/codecs
|
||||
|
||||
# remove *-dev packages
|
||||
devpackages=`dpkg -l|grep '\-dev'|awk '{print $2}'|xargs`
|
||||
DEBIAN_FRONTEND=noninteractive apt-get --yes purge \
|
||||
autoconf \
|
||||
build-essential \
|
||||
bzip2 \
|
||||
cpp \
|
||||
m4 \
|
||||
make \
|
||||
patch \
|
||||
perl \
|
||||
perl-modules \
|
||||
pkg-config \
|
||||
xz-utils \
|
||||
${devpackages}
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
exec rm -f /build-asterisk.sh
|
25
debian-jessie-slim-1.6.2.24/docker-entrypoint.sh
Executable file
25
debian-jessie-slim-1.6.2.24/docker-entrypoint.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
# run as user asterisk by default
|
||||
ASTERISK_USER=${ASTERISK_USER:-asterisk}
|
||||
|
||||
if [ "$1" = "" ]; then
|
||||
COMMAND="/usr/sbin/asterisk -T -W -U ${ASTERISK_USER} -p -vvvdddf"
|
||||
else
|
||||
COMMAND="$@"
|
||||
fi
|
||||
|
||||
if [ "${ASTERISK_UID}" != "" ] && [ "${ASTERISK_GID}" != "" ]; then
|
||||
# recreate user and group for asterisk
|
||||
# if they've sent as env variables (i.e. to macth with host user to fix permissions for mounted folders
|
||||
|
||||
deluser asterisk && \
|
||||
adduser --gecos "" --no-create-home --uid ${ASTERISK_UID} --disabled-password ${ASTERISK_USER} \
|
||||
|| exit
|
||||
fi
|
||||
|
||||
chown -R ${ASTERISK_USER}: /var/log/asterisk \
|
||||
/var/lib/asterisk \
|
||||
/var/run/asterisk \
|
||||
/var/spool/asterisk; \
|
||||
exec ${COMMAND}
|
16
debian-jessie-slim-1.8.32.3/Dockerfile
Normal file
16
debian-jessie-slim-1.8.32.3/Dockerfile
Normal file
@ -0,0 +1,16 @@
|
||||
# vim:set ft=dockerfile:
|
||||
FROM debian:jessie-slim
|
||||
|
||||
LABEL maintainer="Andrius Kairiukstis <k@andrius.mobi>"
|
||||
|
||||
ENV ASTERISK_VERSION 1.8.32.3
|
||||
|
||||
COPY build-asterisk.sh /
|
||||
RUN /build-asterisk.sh
|
||||
|
||||
EXPOSE 5060/udp 5060/tcp
|
||||
VOLUME /var/lib/asterisk/sounds /var/lib/asterisk/keys /var/lib/asterisk/phoneprov /var/spool/asterisk /var/log/asterisk
|
||||
|
||||
COPY docker-entrypoint.sh /
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
CMD ["/usr/sbin/asterisk", "-vvvdddf", "-T", "-W", "-U", "asterisk", "-p"]
|
119
debian-jessie-slim-1.8.32.3/build-asterisk.sh
Executable file
119
debian-jessie-slim-1.8.32.3/build-asterisk.sh
Executable file
@ -0,0 +1,119 @@
|
||||
#!/bin/bash
|
||||
PROGNAME=$(basename $0)
|
||||
|
||||
if test -z ${ASTERISK_VERSION}; then
|
||||
echo "${PROGNAME}: ASTERISK_VERSION required" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -ex
|
||||
|
||||
useradd --system asterisk
|
||||
|
||||
apt-get update -qq
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||
autoconf \
|
||||
binutils-dev \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
curl \
|
||||
file \
|
||||
libcurl4-openssl-dev \
|
||||
libedit-dev \
|
||||
libgsm1-dev \
|
||||
libjansson-dev \
|
||||
libogg-dev \
|
||||
libpopt-dev \
|
||||
libresample1-dev \
|
||||
libspandsp-dev \
|
||||
libspeex-dev \
|
||||
libspeexdsp-dev \
|
||||
libsqlite3-dev \
|
||||
libsrtp0-dev \
|
||||
libssl-dev \
|
||||
libvorbis-dev \
|
||||
libxml2-dev \
|
||||
libxslt1-dev \
|
||||
portaudio19-dev \
|
||||
unixodbc \
|
||||
unixodbc-bin \
|
||||
unixodbc-dev \
|
||||
odbcinst \
|
||||
uuid \
|
||||
uuid-dev \
|
||||
xmlstarlet
|
||||
|
||||
apt-get purge -y --auto-remove
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
mkdir -p /usr/src/asterisk
|
||||
cd /usr/src/asterisk
|
||||
|
||||
curl -vsL http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-${ASTERISK_VERSION}.tar.gz | tar --strip-components 1 -xz || \
|
||||
curl -vsL http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-${ASTERISK_VERSION}.tar.gz | tar --strip-components 1 -xz || \
|
||||
curl -vsL http://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-${ASTERISK_VERSION}.tar.gz | tar --strip-components 1 -xz
|
||||
|
||||
# 1.5 jobs per core works out okay
|
||||
: ${JOBS:=$(( $(nproc) + $(nproc) / 2 ))}
|
||||
|
||||
./configure --with-resample --with-pjproject-bundled
|
||||
make menuselect/menuselect menuselect-tree menuselect.makeopts
|
||||
|
||||
# disable BUILD_NATIVE to avoid platform issues
|
||||
menuselect/menuselect --disable BUILD_NATIVE menuselect.makeopts
|
||||
|
||||
# enable good things
|
||||
menuselect/menuselect --enable BETTER_BACKTRACES menuselect.makeopts
|
||||
|
||||
# # download more sounds
|
||||
# for i in CORE-SOUNDS-EN MOH-OPSOUND EXTRA-SOUNDS-EN; do
|
||||
# for j in ULAW ALAW G722 GSM SLN16; do
|
||||
# menuselect/menuselect --enable $i-$j menuselect.makeopts
|
||||
# done
|
||||
# done
|
||||
|
||||
# we don't need any sounds in docker, they will be mounted as volume
|
||||
menuselect/menuselect --disable-category MENUSELECT_CORE_SOUNDS
|
||||
menuselect/menuselect --disable-category MENUSELECT_MOH
|
||||
menuselect/menuselect --disable-category MENUSELECT_EXTRA_SOUNDS
|
||||
|
||||
make -j ${JOBS} all
|
||||
make install
|
||||
|
||||
# copy default configs
|
||||
# cp /usr/src/asterisk/configs/basic-pbx/*.conf /etc/asterisk/
|
||||
make samples
|
||||
|
||||
# set runuser and rungroup
|
||||
sed -i -E 's/^;(run)(user|group)/\1\2/' /etc/asterisk/asterisk.conf
|
||||
|
||||
mkdir -p /etc/asterisk/ \
|
||||
/var/spool/asterisk/fax
|
||||
|
||||
chown -R asterisk:asterisk /etc/asterisk \
|
||||
/var/*/asterisk \
|
||||
/usr/*/asterisk
|
||||
chmod -R 750 /var/spool/asterisk
|
||||
|
||||
cd /
|
||||
rm -rf /usr/src/asterisk \
|
||||
/usr/src/codecs
|
||||
|
||||
# remove *-dev packages
|
||||
devpackages=`dpkg -l|grep '\-dev'|awk '{print $2}'|xargs`
|
||||
DEBIAN_FRONTEND=noninteractive apt-get --yes purge \
|
||||
autoconf \
|
||||
build-essential \
|
||||
bzip2 \
|
||||
cpp \
|
||||
m4 \
|
||||
make \
|
||||
patch \
|
||||
perl \
|
||||
perl-modules \
|
||||
pkg-config \
|
||||
xz-utils \
|
||||
${devpackages}
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
exec rm -f /build-asterisk.sh
|
25
debian-jessie-slim-1.8.32.3/docker-entrypoint.sh
Executable file
25
debian-jessie-slim-1.8.32.3/docker-entrypoint.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
# run as user asterisk by default
|
||||
ASTERISK_USER=${ASTERISK_USER:-asterisk}
|
||||
|
||||
if [ "$1" = "" ]; then
|
||||
COMMAND="/usr/sbin/asterisk -T -W -U ${ASTERISK_USER} -p -vvvdddf"
|
||||
else
|
||||
COMMAND="$@"
|
||||
fi
|
||||
|
||||
if [ "${ASTERISK_UID}" != "" ] && [ "${ASTERISK_GID}" != "" ]; then
|
||||
# recreate user and group for asterisk
|
||||
# if they've sent as env variables (i.e. to macth with host user to fix permissions for mounted folders
|
||||
|
||||
deluser asterisk && \
|
||||
adduser --gecos "" --no-create-home --uid ${ASTERISK_UID} --disabled-password ${ASTERISK_USER} \
|
||||
|| exit
|
||||
fi
|
||||
|
||||
chown -R ${ASTERISK_USER}: /var/log/asterisk \
|
||||
/var/lib/asterisk \
|
||||
/var/run/asterisk \
|
||||
/var/spool/asterisk; \
|
||||
exec ${COMMAND}
|
17
debian-stretch-certified-13.21-cert4/Dockerfile
Normal file
17
debian-stretch-certified-13.21-cert4/Dockerfile
Normal file
@ -0,0 +1,17 @@
|
||||
# vim:set ft=dockerfile:
|
||||
FROM debian:stretch-slim
|
||||
|
||||
LABEL maintainer="Andrius Kairiukstis <k@andrius.mobi>"
|
||||
|
||||
ENV ASTERISK_VERSION asterisk-certified-13.21-cert4
|
||||
ENV OPUS_CODEC asterisk-13.0/x86-64/codec_opus-13.0_current-x86_64
|
||||
|
||||
COPY build-asterisk.sh /
|
||||
RUN /build-asterisk.sh
|
||||
|
||||
EXPOSE 5060/udp 5060/tcp
|
||||
VOLUME /var/lib/asterisk/sounds /var/lib/asterisk/keys /var/lib/asterisk/phoneprov /var/spool/asterisk /var/log/asterisk
|
||||
|
||||
COPY docker-entrypoint.sh /
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
CMD ["/usr/sbin/asterisk", "-vvvdddf", "-T", "-W", "-U", "asterisk", "-p"]
|
128
debian-stretch-certified-13.21-cert4/build-asterisk.sh
Executable file
128
debian-stretch-certified-13.21-cert4/build-asterisk.sh
Executable file
@ -0,0 +1,128 @@
|
||||
#!/bin/bash
|
||||
PROGNAME=$(basename $0)
|
||||
|
||||
if test -z ${ASTERISK_VERSION}; then
|
||||
echo "${PROGNAME}: ASTERISK_VERSION required" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -ex
|
||||
|
||||
useradd --system asterisk
|
||||
|
||||
apt-get update -qq
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
|
||||
autoconf \
|
||||
binutils-dev \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
curl \
|
||||
file \
|
||||
libcurl4-openssl-dev \
|
||||
libedit-dev \
|
||||
libgsm1-dev \
|
||||
libjansson-dev \
|
||||
libogg-dev \
|
||||
libpopt-dev \
|
||||
libresample1-dev \
|
||||
libspandsp-dev \
|
||||
libspeex-dev \
|
||||
libspeexdsp-dev \
|
||||
libsqlite3-dev \
|
||||
libsrtp0-dev \
|
||||
libssl-dev \
|
||||
libvorbis-dev \
|
||||
libxml2-dev \
|
||||
libxslt1-dev \
|
||||
portaudio19-dev \
|
||||
unixodbc \
|
||||
unixodbc-bin \
|
||||
unixodbc-dev \
|
||||
odbcinst \
|
||||
uuid \
|
||||
uuid-dev \
|
||||
xmlstarlet
|
||||
|
||||
apt-get purge -y --auto-remove
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
mkdir -p /usr/src/asterisk
|
||||
cd /usr/src/asterisk
|
||||
|
||||
curl -vsL http://downloads.asterisk.org/pub/telephony/certified-asterisk/releases/${ASTERISK_VERSION}.tar.gz | tar --strip-components 1 -xz
|
||||
|
||||
# 1.5 jobs per core works out okay
|
||||
: ${JOBS:=$(( $(nproc) + $(nproc) / 2 ))}
|
||||
|
||||
./configure --with-resample --with-pjproject-bundled
|
||||
make menuselect/menuselect menuselect-tree menuselect.makeopts
|
||||
|
||||
# disable BUILD_NATIVE to avoid platform issues
|
||||
menuselect/menuselect --disable BUILD_NATIVE menuselect.makeopts
|
||||
|
||||
# enable good things
|
||||
menuselect/menuselect --enable BETTER_BACKTRACES menuselect.makeopts
|
||||
|
||||
# codecs
|
||||
# menuselect/menuselect --enable codec_opus menuselect.makeopts
|
||||
# menuselect/menuselect --enable codec_silk menuselect.makeopts
|
||||
|
||||
# # download more sounds
|
||||
# for i in CORE-SOUNDS-EN MOH-OPSOUND EXTRA-SOUNDS-EN; do
|
||||
# for j in ULAW ALAW G722 GSM SLN16; do
|
||||
# menuselect/menuselect --enable $i-$j menuselect.makeopts
|
||||
# done
|
||||
# done
|
||||
|
||||
# we don't need any sounds in docker, they will be mounted as volume
|
||||
menuselect/menuselect --disable-category MENUSELECT_CORE_SOUNDS
|
||||
menuselect/menuselect --disable-category MENUSELECT_MOH
|
||||
menuselect/menuselect --disable-category MENUSELECT_EXTRA_SOUNDS
|
||||
|
||||
make -j ${JOBS} all
|
||||
make install
|
||||
|
||||
# copy default configs
|
||||
# cp /usr/src/asterisk/configs/basic-pbx/*.conf /etc/asterisk/
|
||||
make samples
|
||||
|
||||
# set runuser and rungroup
|
||||
sed -i -E 's/^;(run)(user|group)/\1\2/' /etc/asterisk/asterisk.conf
|
||||
|
||||
# Install opus, for some reason menuselect option above does not working
|
||||
mkdir -p /usr/src/codecs/opus \
|
||||
&& cd /usr/src/codecs/opus \
|
||||
&& curl -vsL http://downloads.digium.com/pub/telephony/codec_opus/${OPUS_CODEC}.tar.gz | tar --strip-components 1 -xz \
|
||||
&& cp *.so /usr/lib/asterisk/modules/ \
|
||||
&& cp codec_opus_config-en_US.xml /var/lib/asterisk/documentation/
|
||||
|
||||
mkdir -p /etc/asterisk/ \
|
||||
/var/spool/asterisk/fax
|
||||
|
||||
chown -R asterisk:asterisk /etc/asterisk \
|
||||
/var/*/asterisk \
|
||||
/usr/*/asterisk
|
||||
chmod -R 750 /var/spool/asterisk
|
||||
|
||||
cd /
|
||||
rm -rf /usr/src/asterisk \
|
||||
/usr/src/codecs
|
||||
|
||||
# remove *-dev packages
|
||||
devpackages=`dpkg -l|grep '\-dev'|awk '{print $2}'|xargs`
|
||||
DEBIAN_FRONTEND=noninteractive apt-get --yes purge \
|
||||
autoconf \
|
||||
build-essential \
|
||||
bzip2 \
|
||||
cpp \
|
||||
m4 \
|
||||
make \
|
||||
patch \
|
||||
perl \
|
||||
perl-modules \
|
||||
pkg-config \
|
||||
xz-utils \
|
||||
${devpackages}
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
exec rm -f /build-asterisk.sh
|
25
debian-stretch-certified-13.21-cert4/docker-entrypoint.sh
Executable file
25
debian-stretch-certified-13.21-cert4/docker-entrypoint.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
# run as user asterisk by default
|
||||
ASTERISK_USER=${ASTERISK_USER:-asterisk}
|
||||
|
||||
if [ "$1" = "" ]; then
|
||||
COMMAND="/usr/sbin/asterisk -T -W -U ${ASTERISK_USER} -p -vvvdddf"
|
||||
else
|
||||
COMMAND="$@"
|
||||
fi
|
||||
|
||||
if [ "${ASTERISK_UID}" != "" ] && [ "${ASTERISK_GID}" != "" ]; then
|
||||
# recreate user and group for asterisk
|
||||
# if they've sent as env variables (i.e. to macth with host user to fix permissions for mounted folders
|
||||
|
||||
deluser asterisk && \
|
||||
adduser --gecos "" --no-create-home --uid ${ASTERISK_UID} --disabled-password ${ASTERISK_USER} \
|
||||
|| exit
|
||||
fi
|
||||
|
||||
chown -R ${ASTERISK_USER}: /var/log/asterisk \
|
||||
/var/lib/asterisk \
|
||||
/var/run/asterisk \
|
||||
/var/spool/asterisk; \
|
||||
exec ${COMMAND}
|
Loading…
Reference in New Issue
Block a user