Changed build container image to buildkit

This commit is contained in:
Marcin-Ramotowski 2025-06-08 10:55:44 +00:00
parent b14e6cf873
commit 43a6e7c67b

16
Jenkinsfile vendored
View File

@ -33,12 +33,16 @@ pipeline {
stage('Build & Push Docker') {
steps {
container('docker') {
sh '''
docker build -t ${DOCKER_IMAGE} .
echo "${ACR_PASSWORD}" | docker login marcin00.azurecr.io -u ${ACR_USERNAME} --password-stdin
docker push ${DOCKER_IMAGE}
'''
container('buildkitd') {
sh '''
buildctl build \
--frontend dockerfile.v0 \
--local context=. \
--local dockerfile=. \
--output type=image,name=${DOCKER_IMAGE},push=true \
--export-cache type=registry,ref=${DOCKER_IMAGE}-cache,mode=max \
--import-cache type=registry,ref=${DOCKER_IMAGE}-cache
'''
}
}
}