blob: aab980bb6bb12cb0499863e7fbc4c9c3e307fa8c [file] [log] [blame]
options:
env:
- 'DOCKER_CLI_EXPERIMENTAL=enabled'
machineType: 'N1_HIGHCPU_8'
steps:
# Build kdump debugger image
# This step is needed to add a new entry to /proc/sys/fs/binfmt_misc. Docker
# uses QEMU user emulation to run arm64 programs on x86 hosts. A QEMU
# interpreter needs to be added to /proc/sys/fs/binfmt_misc to run arm64
# programs. Use tonistiigi/binfmt over linuxkit/binfmt to resolve ARM64 seg faults
# relating to libc-bin while installing crash-7.3.0. This change essentially
# swaps the host qemu to qemu v6+.
- name: 'gcr.io/cloud-builders/docker'
args: ['run', '--privileged', '--rm' ,'tonistiigi/binfmt', '--uninstall','qemu-*']
- name: 'gcr.io/cloud-builders/docker'
args: ['run', '--privileged', '--rm', 'tonistiigi/binfmt', '--install', 'all']
# The default builder (which appears to be the Docker daemon that implements
# the old, familiar `docker build` behavior) doesn't support the --platform
# flag, so we need to create a new builder.
- name: 'gcr.io/cloud-builders/docker'
args: ['buildx', 'create', '--name', 'builder']
- name: 'gcr.io/cloud-builders/docker'
args: ['buildx', 'use', 'builder']
# Images produced in this way do not appear in the Docker image registry shown
# by `docker images`, at least by default. We use the --push flag to push the
# image after building it, because a subsequent `docker push` won't find the
# image locally.
- name: 'gcr.io/cloud-builders/docker'
args: ['buildx', 'build', '--platform', 'linux/amd64,linux/arm64', '-f', 'src/cmd/cos_kdump_debugger/Dockerfile', '-t', 'gcr.io/${_OUTPUT_PROJECT}/cos_kdump_debugger:latest', '-t', 'gcr.io/${_OUTPUT_PROJECT}/cos_kdump_debugger:${TAG_NAME}', '--push', 'src/cmd/cos_kdump_debugger']
timeout: 1800s