Patchwork D190: docker: pass proxy arguments to docker process

login
register
mail settings
Submitter phabricator
Date July 27, 2017, 12:46 p.m.
Message ID <differential-rev-PHID-DREV-3tgmqvcv2hwvefj7yg2a-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/22563/
State Superseded, archived
Headers show

Comments

phabricator - July 27, 2017, 12:46 p.m.
Mathiasdm created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Building in Docker when behind a proxy requires passing the proxy variables.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D190

AFFECTED FILES
  contrib/dockerlib.sh
  contrib/dockerrpm

CHANGE DETAILS




To: Mathiasdm, #hg-reviewers
Cc: mercurial-devel
phabricator - July 27, 2017, 6:43 p.m.
durin42 accepted this revision.
durin42 added a comment.
This revision is now accepted and ready to land.


  queued these thanks

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D190

To: Mathiasdm, #hg-reviewers, durin42
Cc: durin42, mercurial-devel

Patch

diff --git a/contrib/dockerrpm b/contrib/dockerrpm
--- a/contrib/dockerrpm
+++ b/contrib/dockerrpm
@@ -16,10 +16,10 @@ 
 contrib/buildrpm --rpmbuilddir $RPMBUILDDIR --prepare $*
 
 DSHARED=/mnt/shared
-$DOCKER run -u $DBUILDUSER --rm -v $RPMBUILDDIR:$DSHARED $CONTAINER \
+$DOCKER run -e http_proxy -e https_proxy -u $DBUILDUSER --rm -v $RPMBUILDDIR:$DSHARED $CONTAINER \
     rpmbuild --define "_topdir $DSHARED" -ba $DSHARED/SPECS/mercurial.spec --clean
 
-$DOCKER run -u $DBUILDUSER --rm -v $RPMBUILDDIR:$DSHARED $CONTAINER \
+$DOCKER run -e http_proxy -e https_proxy -u $DBUILDUSER --rm -v $RPMBUILDDIR:$DSHARED $CONTAINER \
     createrepo $DSHARED
 
 cat << EOF > $RPMBUILDDIR/mercurial.repo
diff --git a/contrib/dockerlib.sh b/contrib/dockerlib.sh
--- a/contrib/dockerlib.sh
+++ b/contrib/dockerlib.sh
@@ -38,5 +38,5 @@ 
         echo RUN groupadd $DBUILDUSER -g `id -g` -o
         echo RUN useradd $DBUILDUSER -u `id -u` -g $DBUILDUSER -o
     fi
-  ) | $DOCKER build --tag $CONTAINER -
+  ) | $DOCKER build --build-arg http_proxy --build-arg https_proxy --tag $CONTAINER -
 }