forked from litnimax/alpine-asterisk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.build
38 lines (26 loc) · 1.21 KB
/
Dockerfile.build
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
# vim:set ft=dockerfile:
FROM alpine:edge
ENV maintainer litnimaxster@gmail.com
RUN apk update && apk upgrade
RUN apk add libltdl unixodbc psqlodbc
RUN apk add sudo findutils less curl sngrep ngrep tcpdump
RUN rm -rf /usr/lib/asterisk/modules/* && rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
# Prepare packager account for building Asterisk
RUN mkdir -p /var/cache/distfiles && \
adduser -D packager && \
addgroup packager abuild && \
chgrp abuild /var/cache/distfiles && \
chmod g+w /var/cache/distfiles && \
echo "packager ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
VOLUME ["/work"]
# TODO: move this to dependencies of building Asterisk
RUN apk update && apk add alpine-sdk libtool bsd-compat-headers ncurses-dev popt-dev newt-dev zlib-dev libedit-dev libressl-dev libxml2-dev \
lua-dev libcap-dev jansson-dev util-linux-dev libresample sqlite-dev unixodbc-dev libsrtp-dev
# Build Asterisk
ADD ./aports/asterisk/ /home/packager/asterisk/
RUN ls /home/packager/asterisk/ && su - packager -c /home/packager/asterisk/build.sh
# Copy templates
COPY ./etc/asterisk/*tmpl /etc/asterisk/
COPY ./etc/*tmpl /etc/
EXPOSE 5060/udp
CMD su - packager -c /home/packager/asterisk/build.sh