Docker Apple M1 | M2 architecture support in Apache Software Foundation projects

22 April 2023, 2 min read

asf-docker-apple-logos

With new M1 / M2 MacBooks from Apple, the "new" arm64 architecture began to dominate the laptop market. In this short article, we describe how developers could help the open-source ecosystem to adopt their Docker images to the new platforms.

Developers with M1 / M2 MacBooks using Docker need support for the new arm64 architecture processors. For project maintainers, it means that instead of a single amd64 platform image, they must build several once for amd64 / arm64 platforms. It requires adopting their current CI tools to build multiple images and expose them within a single Docker manifest (under a specific tag name). This process is time-consuming and requires much effort, especially in open-source world.

With Robert Munteanu from Adobe, we adopted one of Apache Software Foundation's (ASF) projects, Apache Sling Starter, to the new multi-arch support procedure.

It required the following steps:

  1. Create an Apache JIRA issue asking for M1 Docker images support e.g. SLING-11714

  2. Agree with the ASF project owner to use GitHub Actions workflows that have the support for docker buildx:

I would suggest using GitHub Actions, there you can use the official suite of docker actions to build multiplatform images with little need for custom scripting [1].

source: https://lists.apache.org/thread/xd3p8nom68gkgjmjpgfylh0vyx260s5o

  1. Provide PRs with a working solution (in our case, we use Docker Maven Plugin to manage buildx container that builds and pushes images):

  2. The Apache project owner needs to raise an issue to Apache Software Foundation infrastructure team to enable GH actions secrets for pushing docker hub images e.g INFRA-23983.

  3. Once all ready, PRs can be merged.

Summarizing, adding support for the arm64 platform in open-source projects is not a complex work. Satisfaction from being the ASF contributor is worth spending a few hours after your everyday routines.


About the authors

Maciej Laskowski

Maciej Laskowski - software architect with deep hands-on experience. Continuous Delivery evangelist, architecture trade offs analyst, cloud-native solutions enthusiast.

Tomasz Michalak

Tomasz Michalak - a hands-on software architect interested in TDD and DDD who translates engineering complexity into the language of trade-offs and goals.

© 2024, Copyright ©HandsOnArchitects.com