From dc7b064903a1e4cf969e5d0cb0a7ce2920908e41 Mon Sep 17 00:00:00 2001 From: Daniel Gyulai Date: Tue, 3 Nov 2020 21:33:25 +0100 Subject: [PATCH] Yeet'd kaniko into oblivion in favor fo dind --- Jenkinsfile | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5476230..d9e1925 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,30 +1,37 @@ podTemplate(yaml: """ +apiVersion: v1 kind: Pod spec: + volumes: + - name: docker-socket + emptyDir: {} containers: - - name: kaniko - image: gcr.io/kaniko-project/executor:debug - imagePullPolicy: Always + - name: docker + image: docker:19.03.1 command: - - /busybox/cat + - sleep + args: + - 99d volumeMounts: - - name: certs - mountPath: /kaniko/ssl/certs - tty: true - volumes: - - name: certs - configMap: - name: ca-certificates -""" + - name: docker-socket + mountPath: /var/run + - name: docker-daemon + image: docker:19.03.1-dind + securityContext: + privileged: true + volumeMounts: + - name: docker-socket + mountPath: /var/run +''' ) { node(POD_LABEL) { stage('Git') { git url: 'https://gyulai.cloud/git/bme/covidok-backend.git', credentialsId: '1b1c30a0-590d-41d4-b775-bdb90e837bc8' - container('kaniko') { + container('docker') { stage('Build and publish dev Docker image') { - sh '/kaniko/executor --dockerfile=/home/jenkins/agent/workspace/gitea-bme_covidok-backend_master/CoviDok/Dockerfile.CI -c /home/jenkins/agent/workspace --destination=docker.local/bme/covidok' + sh 'docker build -f /home/jenkins/agent/workspace/gitea-bme_covidok-backend_master/CoviDok/Dockerfile.CI -t docker.local/bme/covidok:latest /home/jenkins/agent/workspace && docker push docker.local/bme/covidok' } } }