Skip to content

Instantly share code, notes, and snippets.

@alanbchristie
Last active April 30, 2022 06:56
Show Gist options
  • Save alanbchristie/14da3444f3fed6f0adcf877a82b56804 to your computer and use it in GitHub Desktop.
Save alanbchristie/14da3444f3fed6f0adcf877a82b56804 to your computer and use it in GitHub Desktop.
Build ARM64 images with buildx
# See https://docs.docker.com/buildx/working-with-buildx
# Here I'm on macOS (11.6.5)
# and using Docker Desktop (4.7.1)
# Multi-architecture build (Docker Desktop)
# Create an isolated buildx instance...
docker buildx create --name mybuilder
docker buildx use mybuilder
# Build something for amd64 and arm64...
# Maybe the Informatics Matters Data Manager Kubernetes Job Operator (a public image)
# An example of simply creating the image locally,
# and one where the image is pushed to DockerHub...
docker buildx build --platform linux/amd64,linux/arm64 --tag informaticsmatters/data-manager-job-operator:latest --output type=image .
docker buildx build --platform linux/amd64,linux/arm64 --tag informaticsmatters/data-manager-job-operator:latest --output type=registry .
# You can replace "--output type=registry" with the shorthand option "--push"
# Inspect pushed images (to see supported architectures)...
docker buildx imagetools inspect informaticsmatters/data-manager-job-operator:latest
# When you're done building
# remove the buildx builder instance...
docker buildx rm mybuilder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment