Build multi-arch (amd64 + arm64) images with buildx
This commit is contained in:
22
Jenkinsfile
vendored
22
Jenkinsfile
vendored
@@ -5,6 +5,7 @@ pipeline {
|
||||
REGISTRY = 'atl.vultrcr.com/vllm'
|
||||
IMAGE_NAME = 'vllm'
|
||||
IMAGE = "${REGISTRY}/${IMAGE_NAME}:latest"
|
||||
PLATFORMS = 'linux/amd64,linux/arm64'
|
||||
}
|
||||
|
||||
parameters {
|
||||
@@ -24,32 +25,27 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build') {
|
||||
stage('Build & Push') {
|
||||
steps {
|
||||
script {
|
||||
docker.withRegistry("https://${REGISTRY}", 'ATL_VCR_VLLM') {
|
||||
sh """
|
||||
docker build -t ${REGISTRY}/${IMAGE_NAME}:${params.IMAGE_TAG} .
|
||||
docker buildx create --use --name vllm-builder || docker buildx use vllm-builder
|
||||
docker buildx build \
|
||||
--platform ${PLATFORMS} \
|
||||
-t ${REGISTRY}/${IMAGE_NAME}:${params.IMAGE_TAG} \
|
||||
--push \
|
||||
.
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Push') {
|
||||
steps {
|
||||
script {
|
||||
docker.withRegistry("https://${REGISTRY}", 'ATL_VCR_VLLM') {
|
||||
docker.image("${REGISTRY}/${IMAGE_NAME}:${params.IMAGE_TAG}").push()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
sh "docker rmi ${IMAGE} || true"
|
||||
sh "docker buildx rm vllm-builder || true"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user