changeset 54:e7787ab0f696

Provisional Docker build
author Chris Cannam
date Thu, 06 Feb 2020 16:45:29 +0000
parents c1e5e3f02e48
children 9bc973cd5855
files deploy/linux/build-docker.sh deploy/linux/docker/Dockerfile.gen deploy/linux/docker/Dockerfile.in
diffstat 3 files changed, 164 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/linux/build-docker.sh	Thu Feb 06 16:45:29 2020 +0000
@@ -0,0 +1,40 @@
+#!/bin/bash
+#
+# Docker required
+
+set -eu
+
+current=$(hg id | awk '{ print $1; }')
+
+case "$current" in
+    *+) echo "ERROR: Current working copy has been modified - unmodified copy required so we know we can check it out separately and obtain the same contents"; exit 2;;
+    *);;
+esac
+
+echo
+echo "Building from revision $current..."
+
+dockerdir=deploy/linux/docker
+
+cat "$dockerdir"/Dockerfile.in | \
+    perl -p -e "s/\[\[REVISION\]\]/$current/g" > \
+         "$dockerdir"/Dockerfile.gen
+
+fgrep 'hg.sr.ht' ~/.ssh/known_hosts > "$dockerdir"/known_hosts
+cp ~/.ssh/id_rsa_build "$dockerdir"/id_rsa_build
+chmod 600 "$dockerdir"/known_hosts "$dockerdir"/id_rsa_build
+trap "rm $dockerdir/known_hosts $dockerdir/id_rsa_build" 0
+
+dockertag="cannam/vamp-plugin-pack-installer-$current"
+
+sudo docker build -t "$dockertag" -f "$dockerdir"/Dockerfile.gen "$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 )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/linux/docker/Dockerfile.gen	Thu Feb 06 16:45:29 2020 +0000
@@ -0,0 +1,62 @@
+FROM ubuntu:14.04
+MAINTAINER Chris Cannam <cannam@all-day-breakfast.com>
+RUN apt-get update && \
+    apt-get install -y \
+    software-properties-common \
+    build-essential \
+    libbz2-dev \
+    libfftw3-dev \
+    libfishsound1-dev \
+    libid3tag0-dev \
+    liblo-dev \
+    liblrdf0-dev \
+    libmad0-dev \
+    liboggz2-dev \
+    libopus-dev \
+    libopusfile-dev \
+    libpulse-dev \
+    libasound2-dev \
+    libjack-dev \
+    libsamplerate-dev \
+    libsndfile-dev \
+    libsord-dev \
+    libxml2-utils \
+    libgl1-mesa-dev \
+    raptor-utils \
+    librubberband-dev \
+    git \
+    mercurial \
+    curl wget \
+    mlton \
+    autoconf automake libtool lintian
+
+RUN apt-add-repository -y ppa:beineri/opt-qt-5.10.1-trusty
+RUN apt-get update && \
+    apt-get install -y \
+    qt510base \
+    qt510svg
+RUN apt-get clean && rm -rf /var/lib/apt/lists/*
+
+RUN locale-gen en_US.UTF-8
+ENV LANG en_US.UTF-8  
+ENV LANGUAGE en_US:en  
+ENV LC_ALL en_US.UTF-8
+
+RUN hg clone -rc1e5e3f02e48 https://code.soundsoftware.ac.uk/hg/vamp-plugin-pack
+
+WORKDIR /root
+
+COPY id_rsa_build .ssh/id_rsa_build
+COPY known_hosts .ssh/known_hosts
+RUN chmod 600 .ssh/id_rsa_build .ssh/known_hosts
+RUN echo '{"accounts": {"sourcehut": "~breakfastquay"}}' > .repoint.json
+RUN ( echo '[ui]' ; echo 'ssh = ssh -i /root/.ssh/id_rsa_build' ) > .hgrc
+
+WORKDIR /vamp-plugin-pack
+ENV QTDIR /opt/qt510
+ENV PATH /opt/qt510/bin:$PATH
+RUN ./repoint install
+RUN qmake -r
+RUN make -j3
+
+RUN tar cvf output.tar vamp-plugin-pack-installer && cp output.tar ..
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/linux/docker/Dockerfile.in	Thu Feb 06 16:45:29 2020 +0000
@@ -0,0 +1,62 @@
+FROM ubuntu:14.04
+MAINTAINER Chris Cannam <cannam@all-day-breakfast.com>
+RUN apt-get update && \
+    apt-get install -y \
+    software-properties-common \
+    build-essential \
+    libbz2-dev \
+    libfftw3-dev \
+    libfishsound1-dev \
+    libid3tag0-dev \
+    liblo-dev \
+    liblrdf0-dev \
+    libmad0-dev \
+    liboggz2-dev \
+    libopus-dev \
+    libopusfile-dev \
+    libpulse-dev \
+    libasound2-dev \
+    libjack-dev \
+    libsamplerate-dev \
+    libsndfile-dev \
+    libsord-dev \
+    libxml2-utils \
+    libgl1-mesa-dev \
+    raptor-utils \
+    librubberband-dev \
+    git \
+    mercurial \
+    curl wget \
+    mlton \
+    autoconf automake libtool lintian
+
+RUN apt-add-repository -y ppa:beineri/opt-qt-5.10.1-trusty
+RUN apt-get update && \
+    apt-get install -y \
+    qt510base \
+    qt510svg
+RUN apt-get clean && rm -rf /var/lib/apt/lists/*
+
+RUN locale-gen en_US.UTF-8
+ENV LANG en_US.UTF-8  
+ENV LANGUAGE en_US:en  
+ENV LC_ALL en_US.UTF-8
+
+RUN hg clone -r[[REVISION]] https://code.soundsoftware.ac.uk/hg/vamp-plugin-pack
+
+WORKDIR /root
+
+COPY id_rsa_build .ssh/id_rsa_build
+COPY known_hosts .ssh/known_hosts
+RUN chmod 600 .ssh/id_rsa_build .ssh/known_hosts
+RUN echo '{"accounts": {"sourcehut": "~breakfastquay"}}' > .repoint.json
+RUN ( echo '[ui]' ; echo 'ssh = ssh -i /root/.ssh/id_rsa_build' ) > .hgrc
+
+WORKDIR /vamp-plugin-pack
+ENV QTDIR /opt/qt510
+ENV PATH /opt/qt510/bin:$PATH
+RUN ./repoint install
+RUN qmake -r
+RUN make -j3
+
+RUN tar cvf output.tar vamp-plugin-pack-installer && cp output.tar ..