changeset 1539:56b268b96fcb

Some Ubuntu/Fedora docker build material
author Chris Cannam
date Thu, 12 Jan 2017 14:09:44 +0000
parents 06f061c54b66
children d0e8a7b99adc
files deploy/linux/docker/Dockerfile_v3.0beta1_fedora25 deploy/linux/docker/Dockerfile_v3.0beta1_ubuntu1604 deploy/linux/docker/build.sh
diffstat 3 files changed, 93 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/linux/docker/Dockerfile_v3.0beta1_fedora25	Thu Jan 12 14:09:44 2017 +0000
@@ -0,0 +1,47 @@
+FROM fedora:25
+MAINTAINER Chris Cannam <cannam@all-day-breakfast.com>
+RUN dnf update -y && dnf groupinstall -y "Development tools"
+RUN dnf install -y \
+    gcc-c++ \
+    alsa-lib-devel \
+    bzip2-devel \
+    fftw-devel \
+    flac-devel \
+    jack-audio-connection-kit-devel \
+    libid3tag-devel \
+    liblo-devel \
+    liblrdf-devel \
+    libmad-devel \
+    liboggz-devel \
+    libfishsound-devel \
+    libsamplerate-devel \
+    libsndfile-devel \
+    libvorbis-devel \
+    portaudio-devel \
+    pulseaudio-libs-devel \
+    qt5-qtbase-devel qt5-qtsvg-devel \
+    sord-devel \
+    speex-devel \
+    rubberband-devel \
+    git mercurial \
+    curl wget \
+    autoconf automake libtool \
+    langpacks-en
+ENV LANG en_US.UTF-8  
+ENV LC_ALL en_US.UTF-8
+RUN git clone https://github.com/sandstorm-io/capnproto
+WORKDIR capnproto/c++
+RUN ./setup-autotools.sh && autoreconf -i 
+RUN ./configure --enable-static --disable-shared
+RUN make && make install
+WORKDIR ../..
+ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
+RUN hg clone https://code.soundsoftware.ac.uk/hg/sonic-visualiser
+WORKDIR sonic-visualiser
+RUN hg update -r782025ae1249
+RUN perl -i -p -e 's,#include "version.h",#include "../version.h",' main/Surveyer.cpp
+RUN perl -i -p -e 's,#include "version.h",#include "../version.h",' main/PreferencesDialog.cpp
+RUN ./configure
+RUN make -j3
+RUN cp checker/vamp-plugin-load-checker .
+# package...?
--- a/deploy/linux/docker/Dockerfile_v3.0beta1_ubuntu1604	Thu Jan 12 11:48:03 2017 +0000
+++ b/deploy/linux/docker/Dockerfile_v3.0beta1_ubuntu1604	Thu Jan 12 14:09:44 2017 +0000
@@ -41,5 +41,5 @@
 RUN ./configure
 RUN make -j3
 RUN cp checker/vamp-plugin-load-checker .
-RUN deploy/linux/deploy-deb.sh 3.0.0beta1 amd64
-RUN ls -l
+RUN deploy/linux/deploy-deb.sh 3.0beta1-1 amd64
+RUN tar cvf output.tar *.deb && cp output.tar ..
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/linux/docker/build.sh	Thu Jan 12 14:09:44 2017 +0000
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+version=$(perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h | sed 's/-//g')
+
+dockerdir=./deploy/linux/docker
+if [ ! -d "$dockerdir" ]; then
+    echo "Run this script from the build root"
+    exit 2
+fi
+
+platform="$1"
+
+if [ -z "$platform" ] || [ -n "$2" ]; then
+    echo "Usage: $0 <platform>"
+    echo "where <platform> matches the suffix of the Docker file, e.g. ubuntu1604"
+    exit 2
+fi
+
+set -eu
+
+echo "Building for version $version, platform $platform"
+dockerfile="Dockerfile_v${version}_${platform}"
+
+if [ ! -f "$dockerdir/$dockerfile" ]; then
+    echo "No matching docker file $dockerfile found in $dockerdir"
+    exit 1
+fi
+
+dockertag="cannam/sonic-visualiser-$platform"
+
+sudo docker build -t "$dockertag" -f "$dockerdir/$dockerfile" "$dockerdir"
+
+outdir="$dockerdir/output"
+mkdir -p "$outdir"
+
+container=$(sudo docker create "$dockertag")
+sudo docker cp "$container":output.tar "$outdir"
+sudo docker rm "$container"
+
+( cd "$outdir" ; tar xf output.tar && rm -f output.tar )
+
+echo
+echo "Done, output directory contains:"
+ls -ltr "$outdir"