Skip to content

Commit 229f50b

Browse files
committed
K8SPSMDB-1528 Create multi-architecture Docker image for Fluent Bit
1 parent b6c623e commit 229f50b

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

cloud/jenkins/fluentbit_docker_build.groovy

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
void build(String IMAGE_PREFIX){
2-
sh """
3-
cd ./source/
4-
docker build --no-cache --squash -t perconalab/percona-xtradb-cluster-operator:${GIT_PD_BRANCH}-${IMAGE_PREFIX} -f fluentbit/Dockerfile fluentbit
5-
docker tag perconalab/percona-xtradb-cluster-operator:${GIT_PD_BRANCH}-${IMAGE_PREFIX} perconalab/fluentbit:${GIT_PD_BRANCH}-${IMAGE_PREFIX}
6-
"""
2+
withCredentials([usernamePassword(credentialsId: 'hub.docker.com', passwordVariable: 'PASS', usernameVariable: 'USER'), file(credentialsId: 'DOCKER_REPO_KEY', variable: 'docker_key')]) {
3+
sh """
4+
cd ./source/
5+
docker login -u '${USER}' -p '${PASS}'
6+
docker buildx create --use
7+
docker buildx --platform linux/amd64,linux/arm64 --progress plain -t perconalab/percona-xtradb-cluster-operator:${GIT_PD_BRANCH}-${IMAGE_PREFIX} --push -f fluentbit/Dockerfile fluentbit
8+
docker logout
9+
"""
10+
}
711
}
812
void checkImageForDocker(String IMAGE_PREFIX){
913
withCredentials([usernamePassword(credentialsId: 'hub.docker.com', passwordVariable: 'PASS', usernameVariable: 'USER')]) {
@@ -19,6 +23,7 @@ void checkImageForDocker(String IMAGE_PREFIX){
1923
"""
2024
}
2125
}
26+
2227
void pushImageToDocker(String IMAGE_PREFIX){
2328
withCredentials([usernamePassword(credentialsId: 'hub.docker.com', passwordVariable: 'PASS', usernameVariable: 'USER'), file(credentialsId: 'DOCKER_REPO_KEY', variable: 'docker_key')]) {
2429
sh """
@@ -81,7 +86,7 @@ pipeline {
8186
stash includes: "cloud/**", name: "cloud"
8287
}
8388
}
84-
stage('Build fluentbit docker images') {
89+
stage('Build and push fluentbit docker images') {
8590
steps {
8691
sh '''
8792
sudo rm -rf cloud
@@ -98,11 +103,11 @@ pipeline {
98103
}
99104
}
100105
}
101-
stage('Push Images to Docker registry') {
102-
steps {
103-
pushImageToDocker('logcollector')
104-
}
105-
}
106+
// stage('Push Images to Docker registry') {
107+
// steps {
108+
// pushImageToDocker('logcollector')
109+
// }
110+
// }
106111
stage('Trivy Checks') {
107112
steps {
108113
checkImageForDocker('logcollector')

0 commit comments

Comments
 (0)