build file
Some checks failed
test/timeline-server/pipeline/head There was a failure building this commit

This commit is contained in:
jiangh277
2025-12-24 16:15:20 +08:00
parent abdbd88aa6
commit 0383bf3afd

8
Jenkinsfile vendored
View File

@@ -10,6 +10,7 @@ pipeline {
REGISTRY = 'timeline-registry:5000' REGISTRY = 'timeline-registry:5000'
PROJECT_NAME = 'timeline-server' PROJECT_NAME = 'timeline-server'
DOCKER_REGISTRY = 'timeline-registry:5000' DOCKER_REGISTRY = 'timeline-registry:5000'
DOCKER_BUILDKIT = '1' // 启用 BuildKit
} }
parameters { parameters {
@@ -93,6 +94,8 @@ pipeline {
stage('Build Docker Images') { stage('Build Docker Images') {
steps { steps {
script { script {
// 启用 Docker BuildKit
withEnv(['DOCKER_BUILDKIT=1']) {
def services = ['gateway', 'user', 'story', 'file'] def services = ['gateway', 'user', 'story', 'file']
def imageTags = [:] def imageTags = [:]
@@ -106,8 +109,8 @@ pipeline {
writeFile file: "${serviceDir}/Dockerfile", text: getDockerfileContent(serviceDir) writeFile file: "${serviceDir}/Dockerfile", text: getDockerfileContent(serviceDir)
} }
// 构建镜像 // 构建镜像,使用 BuildKit
sh "docker build -t ${imageName} -t ${latestImageName} ${serviceDir}/." sh "docker build --platform linux/amd64 -t ${imageName} -t ${latestImageName} ${serviceDir}/."
imageTags[service] = imageName imageTags[service] = imageName
} }
@@ -115,6 +118,7 @@ pipeline {
} }
} }
} }
}
stage('Push Images') { stage('Push Images') {
steps { steps {