diff options
author | Leif Madsen <leif@leifmadsen.com> | 2016-02-25 11:29:05 -0500 |
---|---|---|
committer | Matthew Fredrickson <creslin@digium.com> | 2016-03-17 09:53:57 -0500 |
commit | 0da36fca6bfc2c9af076f0728e718cef05c9bac8 (patch) | |
tree | 0048e9887eb05e83cb63e93e68332ff6e6fc3540 /contrib/docker/make-package.sh | |
parent | 7ea1e181dc7c3540c9af0c3bd6d0915260c570d8 (diff) |
Add initial support to build Docker images
This work-in-progress is the first step to being able to reliably
build Asterisk containers from the Asterisk source. I'm submitting
this based on feedback gained at AstriDevCon 2015.
Information about how to use this is provided in contrib/docker/README.md
and will result in a local Asterisk container being built right from
your source. I believe this can eventually be automated via
hub.docker.com.
Change-Id: Ifa070706d40e56755797097b6ed72c1e243bd0d1
Diffstat (limited to 'contrib/docker/make-package.sh')
-rwxr-xr-x | contrib/docker/make-package.sh | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/contrib/docker/make-package.sh b/contrib/docker/make-package.sh new file mode 100755 index 000000000..261df60e3 --- /dev/null +++ b/contrib/docker/make-package.sh @@ -0,0 +1,72 @@ +#!/bin/bash +# This script intended to be run from the packager container. Please see the +# README.md file for more information on how this script is used. +# +set -ex +[ -n "$1" ] +mkdir -p /opt + +# move into the application directory where Asterisk source exists +cd /application + +# strip the source of any Git-isms +rsync -av --exclude='.git' . /tmp/application + +# move to the build directory and build Asterisk +cd /tmp/application +./configure +cd menuselect +make menuselect +cd .. +make menuselect-tree + +menuselect/menuselect --check-deps menuselect.makeopts + +# Do not include sound files. You should be mounting these from and external +# volume. +sed -i -e 's/MENUSELECT_MOH=.*$/MENUSELECT_MOH=/' menuselect.makeopts +sed -i -e 's/MENUSELECT_CORE_SOUNDS=.*$/MENUSELECT_CORE_SOUNDS=/' menuselect.makeopts + +# Build it! +make all install DESTDIR=/tmp/installdir + +rm -rf /tmp/application +cd /build + +# Use the Fine Package Management system to build us an RPM without all that +# reeking effort. +fpm -t rpm -s dir -n asterisk-custom --version "$1" \ + --depends libedit \ + --depends libxslt \ + --depends jansson \ + --depends pjproject \ + --depends openssl \ + --depends libxml2 \ + --depends unixODBC \ + --depends libcurl \ + --depends libogg \ + --depends libvorbis \ + --depends speex \ + --depends spandsp \ + --depends freetds \ + --depends net-snmp \ + --depends iksemel \ + --depends corosynclib \ + --depends newt \ + --depends lua \ + --depends sqlite \ + --depends freetds \ + --depends radiusclient-ng \ + --depends postgresql \ + --depends neon \ + --depends libical \ + --depends openldap \ + --depends sqlite2 \ + --depends mysql \ + --depends bluez \ + --depends gsm \ + --depends libuuid \ + --depends libsrtp \ + -C /tmp/installdir etc usr var + +chown -R --reference /application/contrib/docker/make-package.sh . |