Skip to content

Commit f121a83

Browse files
CLOUD-483: Use google container builder to build docker image (#117)
* CLOUD-483: Use google container builder to build docker image * Update Jenkinsfile * Update Jenkinsfile
1 parent 47a0aad commit f121a83

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

.ci/Jenkinsfile

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -441,10 +441,9 @@ 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",
444+
image: "paulwoelfel/docker-gcloud:v1.13",
445445
ttyEnabled: true,
446446
command: 'cat',
447-
envVars: [envVar(key: "DOCKER_API_VERSION", value: "1.23")],
448447
resourceRequestCpu: '100m', resourceRequestMemory: '200Mi'),
449448
containerTemplate(
450449
name: "php",
@@ -456,8 +455,6 @@ def withBuildNode(String phpVersion, body) {
456455
envVar(key: "COMPOSER_AUTH", value: "{\"github-oauth\":{\"github.com\": \"$token\"}}")],
457456
resourceRequestCpu: '500m',
458457
resourceRequestMemory: '1000Mi')
459-
], volumes: [
460-
hostPathVolume(hostPath: "/var/run/docker.sock", mountPath: "/var/run/docker.sock")
461458
]) {
462459
node("build-" + uuid) {
463460
dir('/home/jenkins') {
@@ -483,14 +480,12 @@ def withDockerGcloud(body) {
483480
podTemplate(name: "php-api-client-gcloud", label: "dockergcloud-" + uuid, containers: [
484481
containerTemplate(
485482
name: "docker",
486-
image: "paulwoelfel/docker-gcloud",
483+
image: "paulwoelfel/docker-gcloud:v1.13",
487484
ttyEnabled: true,
488485
command: 'cat',
489486
resourceRequestCpu: '100m',
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")
487+
resourceRequestMemory: '200Mi'
488+
)
494489
]) {
495490
node("dockergcloud-" + uuid) {
496491
container("docker") {
@@ -601,10 +596,6 @@ def queue(String phpApiImageName, String pimImageName, String pimVersion, String
601596
}]
602597
}]
603598
""")
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-
608599
]) {
609600
node("pubsub-" + uuid) {
610601
def messages = body()
@@ -666,8 +657,7 @@ def clearTemplateNames() {
666657
def saveDockerData(String gcrName, String gCloudcontainerName = "docker") {
667658
container(gCloudcontainerName) {
668659
sh "echo 'FROM alpine:3.6\nADD . /data\n' > Dockerfile"
669-
sh "docker build -t ${gcrName} ."
670-
sh "gcloud docker -- push ${gcrName}"
660+
sh "gcloud container builds submit --tag ${gcrName} ."
671661
}
672662
}
673663

0 commit comments

Comments
 (0)