summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Jenkinsfile24
1 files changed, 24 insertions, 0 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
index bf454a0..73c2e6f 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -68,5 +68,29 @@ pipeline {
}
}
}
+
+ stage('Docker github build') {
+ steps {
+ withCredentials([usernamePassword(
+ credentialsId: 'docker-hub',
+ usernameVariable: 'DOCKER_USER',
+ passwordVariable: 'DOCKER_PASS'
+ )]) {
+ sh '''
+ docker version
+ docker buildx version
+ docker buildx ls | grep -q multiarch || docker buildx create --name multiarch --use --bootstrap
+ echo "$DOCKER_PASS" | docker login $REGISTRY -u "$DOCKER_USER" --password-stdin
+
+ DOCKER_BUILDKIT=1 docker buildx build \
+ --platform ${PLATFORMS} \
+ -t ${IMAGE_NAME}:${GIT_SHA} \
+ -t ${IMAGE_NAME}:latest \
+ --push \
+ .
+ '''
+ }
+ }
+ }
}
}