contrib/packaging/dockerrpm
changeset 41234 4c0d4bbdc395
parent 38458 e5916f1236f3
child 43355 433cdcb37321
--- a/contrib/packaging/dockerrpm	Fri Jan 11 13:14:25 2019 +0100
+++ b/contrib/packaging/dockerrpm	Fri Jan 11 14:55:31 2019 +0100
@@ -10,7 +10,15 @@
 
 CONTAINER=hg-docker-$PLATFORM
 
-$BUILDDIR/hg-docker build $BUILDDIR/docker/$PLATFORM $CONTAINER
+if [[ -z "${HG_DOCKER_OWN_USER}" ]]; then
+    DOCKERUID=1000
+    DOCKERGID=1000
+else
+    DOCKERUID=$(id -u)
+    DOCKERGID=$(id -g)
+fi
+
+$BUILDDIR/hg-docker build --build-arg UID=$DOCKERUID --build-arg GID=$DOCKERGID $BUILDDIR/docker/$PLATFORM $CONTAINER
 
 RPMBUILDDIR=$ROOTDIR/packages/$PLATFORM
 $ROOTDIR/contrib/packaging/buildrpm --rpmbuilddir $RPMBUILDDIR --prepare $*