comparison contrib/packaging/dockerrpm @ 41234:4c0d4bbdc395

packaging: allow running packaging with custom uid+gid for CentOS rpmbuild in CentOS 7 has a bug causing rpmbuild to fail with "Bad owner/group" if spec or source files are owned by a different user: https://github.com/rpm-software-management/rpm/issues/2 This makes it very annoying to try and build the CentOS RPMs on CentOS with Docker. As an alternative, this change makes it possible to do so, using an environment variable. Differential Revision: https://phab.mercurial-scm.org/D5571
author Mathias De Mare <mathias.de_mare@nokia.com>
date Fri, 11 Jan 2019 14:55:31 +0100
parents e5916f1236f3
children 433cdcb37321
comparison
equal deleted inserted replaced
41233:92b3811fd15f 41234:4c0d4bbdc395
8 8
9 DOCKER=$($BUILDDIR/hg-docker docker-path) 9 DOCKER=$($BUILDDIR/hg-docker docker-path)
10 10
11 CONTAINER=hg-docker-$PLATFORM 11 CONTAINER=hg-docker-$PLATFORM
12 12
13 $BUILDDIR/hg-docker build $BUILDDIR/docker/$PLATFORM $CONTAINER 13 if [[ -z "${HG_DOCKER_OWN_USER}" ]]; then
14 DOCKERUID=1000
15 DOCKERGID=1000
16 else
17 DOCKERUID=$(id -u)
18 DOCKERGID=$(id -g)
19 fi
20
21 $BUILDDIR/hg-docker build --build-arg UID=$DOCKERUID --build-arg GID=$DOCKERGID $BUILDDIR/docker/$PLATFORM $CONTAINER
14 22
15 RPMBUILDDIR=$ROOTDIR/packages/$PLATFORM 23 RPMBUILDDIR=$ROOTDIR/packages/$PLATFORM
16 $ROOTDIR/contrib/packaging/buildrpm --rpmbuilddir $RPMBUILDDIR --prepare $* 24 $ROOTDIR/contrib/packaging/buildrpm --rpmbuilddir $RPMBUILDDIR --prepare $*
17 25
18 DSHARED=/mnt/shared 26 DSHARED=/mnt/shared