Skip to content

nicolas-van/github-actions-multiarch-docker-image-build

Repository files navigation

github-actions-arm64-docker-image-build

Docker Multiarch Image CI

An example Github Actions configuration to build a Docker image for the following architectures:

  • linux/amd64 (typical x86-64 architecture)
  • linux/arm64 (t4g instances on AWS)
  • linux/arm/v7 (newer Raspberry Pis)
  • linux/arm/v6 (older Raspberry Pis)

You can see the workflow configuration here: .github/workflows/docker-multiarch-image.yml. It should work for most projects as long as a Dockerfile exists at the root of the repository. Builds for all architectures are performed on every push and they are published to Github Packages on tags.

This repository builds an example http server in Node.js displaying a "Hello World" for these four architectures. It was tested on the following machines:

  • An x86-64 Windows using Docker for Windows.
  • An AWS t4g instance using an ARM64 processor.

No tests were performed on Raspberry Pis until now because I'm lazy.

You can test these images yourself by using this command:

docker run --rm -it -p 8080:8080 ghcr.io/nicolas-van/github-actions-multiarch-docker-image-build:latest

It will run the Docker image and you should be able to see the "Hello World" message by connecting to port 8080 using your web browser.

You can also see metadata about the published Docker images in the Package page.

About

An example Github Actions configuration to build a Docker image for multiple architectures.

Topics

Resources

License

Stars

Watchers

Forks