Skip to content

Commit 5e02131

Browse files
committed
Run multiarch/qemu-user-static image for cross-arch
This approach is taken in Kolla CI and Kayobe for building cross-arch OCI images, reuse it here.
1 parent 5368186 commit 5e02131

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

roles/os_images/tasks/prereqs.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,13 @@
2929
state: directory
3030
mode: "0755"
3131
become: true
32+
33+
- name: Run multiarch/qemu-user-static image to support cross-arch build
34+
ansible.builtin.command:
35+
# We already have a precheck for presence of docker executable so use it here
36+
cmd: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
37+
become: true
38+
when: os_images_list |
39+
selectattr("architecture", "defined") |
40+
rejectattr("architecture", "equalto", ansible_facts.architecture) |
41+
length > 0

0 commit comments

Comments
 (0)