new script docker-build to preconfigure parameters for docker build, set environment variable DOCKER_USER; fixed path in docker-update

This commit is contained in:
Marc Wäckerlin
2018-12-06 14:27:42 +01:00
parent 15015372ea
commit adf279d43a
3 changed files with 24 additions and 1 deletions

18
docker-build Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/bash -x
if test $# -gt 0 -a "${1#-}" = "${1}"; then
name=$1
shift
else
name=$(pwd | sed 's,.*/,,')
fi
if test "$name" = "docker"; then
name=$(pwd | sed 's,/[^/]*$,,;s,.*/,,')
fi
if test "${name#*/}" = "${name}"; then
name=${DOCKER_USER:-mwaeckerlin}/${name}
fi
echo "**** building $name"
set -x
docker build $* --rm --force-rm -t ${name,,} .