# Building Arm Images with Cloud Build


This week’s big news in Google Cloud was the addition to Arm across a wide range of products, including [GCE VMs](https://cloud.google.com/blog/products/compute/tau-t2a-is-first-compute-engine-vm-on-an-arm-chip), and [GKE](https://cloud.google.com/blog/products/containers-kubernetes/gke-supports-new-arm-based-tau-t2a-vms) (both Standard and Autopilot). In an earlier post, I covered how to get an [Arm-ready Autopilot cluster](/k8s/arm-on-autopilot/) on day 1.

The [recommended](https://developer.arm.com/documentation/102475/0100/Multi-architecture-images) way to build images for Arm is with [buildx](https://docs.docker.com/buildx/working-with-buildx/). This is also how you can build multi-arch Docker images (ones that can run on both Arm and x86), which is a good idea to do for the time being due to the limited availability of Arm at launch.

But what if you’re using Google Cloud’s CI tool: Cloud Build?

While at the time of writing, the supplied [docker builder image](https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/docker) doesn’t offer Arm support, Cloud Build is able to run any containerized build step.. including the official [docker](https://hub.docker.com/_/docker) container. Thus, we can run buildx inside Cloud Build by using the docker container:

```yaml
steps:
- name: 'docker'
  args: [ 'buildx', 'create', '--name', 'mybuilder', '--use' ]
- name: 'docker'
  args: [ 'buildx', 'build', '--platform', 'linux/arm64,linux/amd64', '-t', 'us-central1-docker.pkg.dev/gke-autopilot-test/test/hello-ma:2', '--push', '.', ]
```

Once configured, [submit](https://cloud.google.com/build/docs/building/build-containers#use-buildconfig) the build like so, or setup a trigger.

```shell
gcloud builds submit --config cloudbuild.yaml .
```

For a full demo that you can try out yourself, here’s the code: <https://github.com/WilliamDenniss/multi-arch-demo>

