Skip to content

Commit 52a4c38

Browse files
authored
tools: Build arm32 build images on aarch64 (#4132)
* tools: Build arm32 build images on aarch64 * Override ansible_architecture variable with armv7l
1 parent d5ccc03 commit 52a4c38

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

Jenkinsfile

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ pipeline {
3737
}
3838
stage('Ubuntu16.04 armv7l') {
3939
agent {
40-
label "docker&&linux&&armv7l"
40+
label "docker&&linux&&aarch64"
4141
}
4242
steps {
43-
dockerBuild('armv7l', 'ubuntu1604', 'Dockerfile.Ubuntu1604')
43+
dockerBuildArm32('armv7l', 'ubuntu1604', 'Dockerfile.Ubuntu1604')
4444
}
4545
}
4646
stage('Ubuntu20.04 riscv64') {
@@ -81,7 +81,22 @@ pipeline {
8181
}
8282
}
8383
}
84-
}
84+
}
85+
86+
def dockerBuildArm32(architecture, distro, dockerfile) {
87+
git poll: false, url: 'https://github.com/adoptium/infrastructure.git'
88+
def git_sha = "${env.GIT_COMMIT.trim()}"
89+
def ansible_arch = "armv7l"
90+
docker.withRegistry('https://index.docker.io/v1/', 'dockerhub') {
91+
sh """
92+
docker buildx build --platform linux/arm/v7 \
93+
--build-arg git_sha=$git_sha --build-arg ansible_arch=$ansible_arch \
94+
-f ansible/docker/$dockerfile \
95+
-t adoptopenjdk/${distro}_build_image:linux-$architecture \
96+
--push .
97+
"""
98+
}
99+
}
85100

86101
def dockerBuild(architecture, distro, dockerfile) {
87102
git poll: false, url: 'https://github.com/adoptium/infrastructure.git'

ansible/docker/Dockerfile.Ubuntu1604

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FROM ubuntu:16.04
22

33
ARG git_sha
4+
ARG ansible_arch
45
ARG user=jenkins
56

67
RUN apt-get update
@@ -22,7 +23,7 @@ RUN echo "localhost ansible_connection=local" > /ansible/hosts
2223

2324
RUN set -eux; \
2425
cd /ansible; \
25-
ansible-playbook -i hosts ansible/playbooks/AdoptOpenJDK_Unix_Playbook/main.yml -e "git_sha=$git_sha" --skip-tags="debug,hosts_file,hostname,adoptopenjdk,jenkins,nagios,superuser,docker,swap_file,crontab,nvidia_cuda_toolkit,ntp_time"
26+
ansible-playbook -i hosts ansible/playbooks/AdoptOpenJDK_Unix_Playbook/main.yml -e "git_sha=$git_sha ansible_architecture=$ansible_arch" --skip-tags="debug,hosts_file,hostname,adoptopenjdk,jenkins,nagios,superuser,docker,swap_file,crontab,nvidia_cuda_toolkit,ntp_time"
2627

2728
RUN rm -rf /ansible
2829

0 commit comments

Comments
 (0)