#!/usr/bin/env bash

docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

# https://docs.docker.com/build/building/multi-platform/#qemu-without-docker-desktop

echo "Before:"
docker buildx ls

apt-get install -y binfmt_misc

docker run --privileged --rm tonistiigi/binfmt --install all

echo "After:"
docker buildx ls

# expect:
# docker buildx ls
# NAME/NODE     DRIVER/ENDPOINT   STATUS    BUILDKIT   PLATFORMS
# default*      docker
#  \_ default    \_ default       running   v0.13.1    linux/amd64, linux/386,
#  linux/arm64, linux/riscv64, linux/ppc64, linux/ppc64le, linux/s390x, linux/mips64le,
#  linux/mips64, linux/arm/v7, linux/arm/v6
