##// END OF EJS Templates
packaging: allow running packaging with custom uid+gid for CentOS...
Mathias De Mare -
r41270:4c0d4bbd default
parent child Browse files
Show More
@@ -1,7 +1,7 b''
1 FROM centos:centos5
1 FROM centos:centos5
2
2
3 RUN groupadd -g 1000 build && \
3 RUN groupadd -g %GID% build && \
4 useradd -u 1000 -g 1000 -s /bin/bash -d /build -m build
4 useradd -u %UID% -g %GID% -s /bin/bash -d /build -m build
5
5
6 RUN \
6 RUN \
7 sed -i 's/^mirrorlist/#mirrorlist/' /etc/yum.repos.d/*.repo && \
7 sed -i 's/^mirrorlist/#mirrorlist/' /etc/yum.repos.d/*.repo && \
@@ -1,7 +1,7 b''
1 FROM centos:centos6
1 FROM centos:centos6
2
2
3 RUN groupadd -g 1000 build && \
3 RUN groupadd -g %GID% build && \
4 useradd -u 1000 -g 1000 -s /bin/bash -d /build -m build
4 useradd -u %UID% -g %GID% -s /bin/bash -d /build -m build
5
5
6 RUN yum install -y \
6 RUN yum install -y \
7 gcc \
7 gcc \
@@ -1,7 +1,7 b''
1 FROM centos:centos7
1 FROM centos:centos7
2
2
3 RUN groupadd -g 1000 build && \
3 RUN groupadd -g %GID% build && \
4 useradd -u 1000 -g 1000 -s /bin/bash -d /build -m build
4 useradd -u %UID% -g %GID% -s /bin/bash -d /build -m build
5
5
6 RUN yum install -y \
6 RUN yum install -y \
7 gcc \
7 gcc \
@@ -10,7 +10,15 b' 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 $*
@@ -47,7 +47,7 b' def get_dockerfile(path: pathlib.Path, a'
47 df = fh.read()
47 df = fh.read()
48
48
49 for k, v in args:
49 for k, v in args:
50 df = df.replace(b'%%%s%%' % k, v)
50 df = df.replace(bytes('%%%s%%' % k.decode(), 'utf-8'), v)
51
51
52 return df
52 return df
53
53
General Comments 0
You need to be logged in to leave comments. Login now