Enable optional parallel build of docker images (#978)

* Enable optional parallel build of docker images

By default, docker does image builds in a single thread. For our containers, this is a little slow on my system. Using `parallel` allows for *optional* improvements in speed there.

Before: 41s
After: 22s

* Move parallel help text to stderr
This commit is contained in:
Thomas Rampelberg 2018-06-20 15:57:29 -07:00 committed by GitHub
parent 0ff1bb4ad8
commit ad659874bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 6 deletions

View File

@ -9,11 +9,24 @@ fi
bindir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
$bindir/docker-build-controller
$bindir/docker-build-web
$bindir/docker-build-proxy-init
containers=$(cat <<-END
controller
web
proxy-init
grafana
proxy
END
)
if [ -z "${CONDUIT_SKIP_CLI_CONTAINER:-}" ]; then
$bindir/docker-build-cli-bin
containers=$(printf "$containers\ncli-bin")
fi
$bindir/docker-build-grafana
$bindir/docker-build-proxy
if which parallel >/dev/null; then
cmd="parallel $bindir/docker-build-{}"
else
printf "Install parallel to speed the build up (brew install parallel)\n" >&2
cmd="xargs -I{} /bin/sh -c $bindir/docker-build-{}"
fi
echo "$containers" | $cmd