pipeline { agent any environment { REGISTRY = 'atl.vultrcr.com/vllm' IMAGE_NAME = 'vllm' IMAGE = "${REGISTRY}/${IMAGE_NAME}:latest" PLATFORMS = 'linux/amd64,linux/arm64' } parameters { string(name: 'IMAGE_TAG', defaultValue: 'custom', description: 'Docker image tag') string(name: 'GIT_REPO', defaultValue: '', description: 'Git repository URL (optional, uses workspace if empty)') string(name: 'GIT_BRANCH', defaultValue: 'master', description: 'Git branch to build') } stages { stage('Checkout') { steps { script { if (params.GIT_REPO) { git url: params.GIT_REPO, branch: params.GIT_BRANCH } } } } stage('Build & Push') { steps { script { docker.withRegistry("https://${REGISTRY}", 'ATL_VCR_VLLM') { sh """ 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 \ . """ } } } } } post { always { sh "docker buildx rm vllm-builder || true" } } }