Mercurial > hg
diff contrib/dockerrpm @ 24969:227b9b2a57a3
dockerlib: extract initcontainer() method
This helps contain all the logic around creating containers.
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 06 May 2015 10:45:51 -0400 |
parents | 80c9e99d68e0 |
children | 1292700d31b5 |
line wrap: on
line diff
--- a/contrib/dockerrpm Wed May 06 10:45:07 2015 -0400 +++ b/contrib/dockerrpm Wed May 06 10:45:51 2015 -0400 @@ -3,25 +3,14 @@ . $(dirname $0)/dockerlib.sh BUILDDIR=$(dirname $0) -ROOTDIR=$(cd $BUILDDIR/..; pwd) +export ROOTDIR=$(cd $BUILDDIR/..; pwd) checkdocker PLATFORM="$1" -[ "$PLATFORM" ] || { echo "Error: platform name must be specified"; exit 1; } shift # extra params are passed to buildrpm -DFILE="$ROOTDIR/contrib/docker/$PLATFORM" -[ -f "$DFILE" ] || { echo "Error: docker file $DFILE not found"; exit 1; } - -CONTAINER="hg-dockerrpm-$PLATFORM" - -DBUILDUSER=build -( -cat $DFILE -echo RUN groupadd $DBUILDUSER -g `id -g` -echo RUN useradd $DBUILDUSER -u `id -u` -g $DBUILDUSER -) | $DOCKER build --tag $CONTAINER - +initcontainer $PLATFORM RPMBUILDDIR=$ROOTDIR/packages/$PLATFORM contrib/buildrpm --rpmbuilddir $RPMBUILDDIR --prepare $*