Skip to main content
← Back to workflows

How to Use GitHub Action for Installing QEMU Static Binaries

docker/setup-qemu-action -
GitHub Action
v3.0.0
GitHub Org's stars
Contributors
Categories
CICube banner
The GitHub Actions dashboard helps you spot bottlenecks and optimize your CI pipeline with actionable insights.
Usage
name: ci

on:
push:
branches: main

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: QEMU install
uses: docker/setup-qemu-action@v3

- name: Install Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v2
with:
push: true
platforms: linux/amd64,linux/arm64
tags: myuser/myrepo:latest

setup-qemu-action logo

setup-qemu-action

GitHub Action to install QEMU static binaries


The docker/setup-qemu-action is a GitHub Action that sets up QEMU static binaries to enable multi-platform builds within Docker workflows. This action is most helpful in setting up the environments that need to build Docker images for different architectures.

How to Configure

  1. Tailscale Version You can pin the version of Tailscale you'd like to use:

    - name: Install QEMU
    uses: docker/setup-qemu-action@v3
    with:
    version: 1.52.0
  2. Custom Inputs

    • image: The Docker image containing QEMU static binaries. Defaults to tonistiigi/binfmt:latest.
    • platforms: A comma-separated list of platforms to install (e.g., arm64,riscv64,arm). Defaults to all.
  3. Outputs

    • platforms: A comma-separated list of available platforms.

Example Workflow

Below is an example of a workflow where the QEMU setup is added to the multi-platform build of Docker:

name: Multi-Platform Build

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: QEMU Configuration
uses: docker/setup-qemu-action@v3

- name: Install Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login into DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: myuser/myrepo:latest

The included configuration YAML sets up QEMU and Docker Buildx, which means you can very smoothly build multi-platform builds in your CI/CD without struggle. This allows for a setup that ensures varied architectures are built and pushed to Docker images of constant quality and performance on all the platforms.

Monitoring GitHub Actions Workflows

CICube is a GitHub Actions monitoring tool that provides you with detailed insights into your workflows to further optimize your CI/CD pipeline. With CICube, you will be able to track your workflow runs, understand where the bottlenecks are, and tease out the best from your build times. Go to cicube.io now and create a free account to better optimize your GitHub Actions workflows!

CICube GitHub Actions Workflow Duration Monitoring