Mercurial > hg > vamp-plugin-sdk
view build/docker/build.sh @ 499:8ede825a54f6
Rework canonicalisation so as to avoid theoretical possibility of integer overflow. (This is unit tested in svcore, not here - tests pass)
author | Chris Cannam |
---|---|
date | Mon, 11 Dec 2017 09:27:57 +0000 |
parents | 124752918a1b |
children |
line wrap: on
line source
#!/bin/bash dockerdir=./build/docker if [ ! -d "$dockerdir" ]; then echo "Run this script from the build root" exit 2 fi version="$1" platform="$2" if [ -z "$platform" ] || [ -z "$version" ] || [ -n "$3" ]; then echo "Usage: $0 <version> <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/vamp-plugin-sdk-$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"