simple asterisk build for docker image, version 20-latest

This commit is contained in:
2025-02-28 22:38:20 +01:00
commit 8c8352fb57
5 changed files with 132 additions and 0 deletions

25
20-debian/asterisk-build.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
apt-get -y install build-essential libssl-dev libedit-dev uuid-dev libxml2-dev libsqlite3-dev
cd /usr/src
curl -L http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-20-current.tar.gz > asterisk.tar.gz
tar zxf asterisk.tar.gz
cd asterisk-20.*
# set compiler flags for cross system compatibility
export ASTCFLAGS="-g -O2 -march=x86-64 -fstack-protector-strong -Wformat -Werror=format-security"
# configure to use the bundled jansson libs (less dependancy on base image)
./configure --with-jansson-bundled
make
make install
make samples
cd /usr/src
rm -rf *
apt-get -y purge build-essential
apt -y autoremove
adduser --system --home /var/lib/asterisk --shell /sbin/nologin --group asterisk
chown -R asterisk:asterisk /var/lib/asterisk