Skip to content

Commit

Permalink
Build all images for linux/amd64 and linux/arm64 infinispan#165
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanemerson committed Aug 5, 2022
1 parent 8252614 commit fcdf94e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
13 changes: 5 additions & 8 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,16 @@ pipeline {
script {

// Build a multi-arch image for the Openjdk image
['server-openjdk'].each { name ->
['server-openjdk', 'server-native', 'cli'].each { name ->
def image = 'infinispan/' + (name.equals('server-openjdk') ? 'server' : name)
def imageFQN = "${image}:${IMAGE_TAG}"
sh "cekit -v --descriptor ${name}.yaml --target target-${name} build --overrides '{'version': '${IMAGE_TAG}'}' --dry-run docker"
sh "docker run --rm --privileged quay.io/infinispan-test/qemu-user-static --reset -p yes"
sh "docker buildx rm multiarch || true"
sh "docker buildx create --name multiarch --use"
sh "docker buildx build --platform linux/amd64,linux/arm64 -t infinispan/server:${IMAGE_TAG} target-${name}/image"
sh "docker buildx build --platform linux/amd64,linux/arm64 -t ${imageFQN} target-${name}/image"
// Build the image again separately to overcome https://github.com/docker/buildx/issues/59 so that we can still archive the image
sh "docker buildx build --load -t infinispan/server:${IMAGE_TAG} target-${name}/image"
}

// Multi-arch images are not possible for the native images due to ISPN-13920, so build for adm64 only
['server-native', 'cli'].each { name ->
sh "cekit -v --descriptor ${name}.yaml build --overrides '{'version': '${IMAGE_TAG}'}' docker"
sh "docker buildx build --load -t ${imageFQN} target-${name}/image"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Jenkinsfile-release
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ IMAGE_CONFIG = [
],
'server-native': [
descriptor : 'server-native.yaml',
platforms : 'linux/amd64',
platforms : 'linux/amd64,linux/arm64',
server : [
name : 'quarkus-src',
url : "https://github.com/infinispan/infinispan-quarkus/archive/${QUARKUS_VERSION}.tar.gz",
Expand All @@ -31,7 +31,7 @@ IMAGE_CONFIG = [
],
'cli': [
descriptor : 'cli.yaml',
platforms : 'linux/amd64',
platforms : 'linux/amd64,linux/arm64',
cli : [
name : 'quarkus-src',
url : "https://github.com/infinispan/infinispan-quarkus/archive/${QUARKUS_VERSION}.tar.gz",
Expand Down

0 comments on commit fcdf94e

Please sign in to comment.