@@ -441,9 +441,10 @@ def withBuildNode(String phpVersion, body) {
441441 podTemplate(name : " php-api-client-node" , label : " build-" + uuid, containers : [
442442 containerTemplate(
443443 name : " docker" ,
444- image : " paulwoelfel/docker-gcloud:v1.13 " ,
444+ image : " paulwoelfel/docker-gcloud" ,
445445 ttyEnabled : true ,
446446 command : ' cat' ,
447+ envVars : [envVar(key : " DOCKER_API_VERSION" , value : " 1.23" )],
447448 resourceRequestCpu : ' 100m' , resourceRequestMemory : ' 200Mi' ),
448449 containerTemplate(
449450 name : " php" ,
@@ -455,6 +456,8 @@ def withBuildNode(String phpVersion, body) {
455456 envVar(key : " COMPOSER_AUTH" , value : " {\" github-oauth\" :{\" github.com\" : \" $token \" }}" )],
456457 resourceRequestCpu : ' 500m' ,
457458 resourceRequestMemory : ' 1000Mi' )
459+ ], volumes : [
460+ hostPathVolume(hostPath : " /var/run/docker.sock" , mountPath : " /var/run/docker.sock" )
458461 ]) {
459462 node(" build-" + uuid) {
460463 dir(' /home/jenkins' ) {
@@ -480,12 +483,14 @@ def withDockerGcloud(body) {
480483 podTemplate(name : " php-api-client-gcloud" , label : " dockergcloud-" + uuid, containers : [
481484 containerTemplate(
482485 name : " docker" ,
483- image : " paulwoelfel/docker-gcloud:v1.13 " ,
486+ image : " paulwoelfel/docker-gcloud" ,
484487 ttyEnabled : true ,
485488 command : ' cat' ,
486489 resourceRequestCpu : ' 100m' ,
487- resourceRequestMemory : ' 200Mi'
488- )
490+ resourceRequestMemory : ' 200Mi' ,
491+ envVars : [envVar(key : " DOCKER_API_VERSION" , value : " 1.23" )])
492+ ], volumes : [
493+ hostPathVolume(hostPath : " /var/run/docker.sock" , mountPath : " /var/run/docker.sock" )
489494 ]) {
490495 node(" dockergcloud-" + uuid) {
491496 container(" docker" ) {
@@ -596,6 +601,10 @@ def queue(String phpApiImageName, String pimImageName, String pimVersion, String
596601 }]
597602 }]
598603 """ )
604+ ], volumes : [
605+ hostPathVolume(hostPath : " /var/run/docker.sock" , mountPath : " /var/run/docker.sock" ),
606+ hostPathVolume(hostPath : " /usr/bin/docker" , mountPath : " /usr/bin/docker" )
607+
599608 ]) {
600609 node(" pubsub-" + uuid) {
601610 def messages = body()
@@ -657,7 +666,8 @@ def clearTemplateNames() {
657666def saveDockerData (String gcrName , String gCloudcontainerName = " docker" ) {
658667 container(gCloudcontainerName) {
659668 sh " echo 'FROM alpine:3.6\n ADD . /data\n ' > Dockerfile"
660- sh " gcloud container builds submit --tag ${ gcrName} ."
669+ sh " docker build -t ${ gcrName} ."
670+ sh " gcloud docker -- push ${ gcrName} "
661671 }
662672}
663673
0 commit comments