Skip to content

Add Dockerfile for ARM64 architecture support and update README instructions#827

Open
z4y4ts wants to merge 2 commits intohuggingface:mainfrom
z4y4ts:main
Open

Add Dockerfile for ARM64 architecture support and update README instructions#827
z4y4ts wants to merge 2 commits intohuggingface:mainfrom
z4y4ts:main

Conversation

@z4y4ts
Copy link

@z4y4ts z4y4ts commented Feb 13, 2026

What does this PR do?

This will make it easier to use the TEI on Apple Silicone machines.

The new Dockerfile-arm64 is based on the Dockerfile. The differences are:

  • Stripped down MKL support, as it's Intel-only
  • Use arm64-compatible sccache and protobuf

Fixes #611

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline?
  • Was this discussed/approved via a GitHub issue or the forum? Please add a link to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the documentation guidelines.
  • Did you write any new necessary tests? If applicable, did you include or update the insta snapshots?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

Copilot AI review requested due to automatic review settings February 13, 2026 16:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for building Docker images on ARM64 architecture (Apple Silicon) to enable local development on Apple M-series machines. The PR addresses issue #611 where building the Docker image on Apple M4 chips failed due to Intel-specific dependencies not being available for ARM64.

Changes:

  • Added new Dockerfile-arm64 specifically designed for ARM64 architecture without Intel MKL dependencies
  • Updated README instructions to reference the new ARM64-specific Dockerfile

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
Dockerfile-arm64 New Dockerfile for ARM64 builds, removing Intel MKL support and using ARM64-compatible sccache and protobuf binaries
README.md Updated Docker build command to reference Dockerfile-arm64 for ARM64 platforms

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


```
docker build . -f Dockerfile --platform=linux/arm64
docker build . -f Dockerfile-arm64 --platform=linux/arm64
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI/CD workflow files (.github/workflows/build.yaml and .github/workflows/test.yaml) currently trigger on changes to "Dockerfile" but not "Dockerfile-arm64". This means that changes to the new ARM64 Dockerfile won't trigger automated builds or tests. Consider updating the workflow paths to include "Dockerfile-arm64" to ensure proper CI/CD coverage for ARM64 builds.

Copilot uses AI. Check for mistakes.

```
docker build . -f Dockerfile --platform=linux/arm64
docker build . -f Dockerfile-arm64 --platform=linux/arm64
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The matrix.json file used for automated builds doesn't include an entry for the ARM64 architecture. While this PR enables manual ARM64 builds for local development, consider adding an ARM64 entry to matrix.json (similar to the existing "cpu" entry but using "Dockerfile-arm64") to enable automated ARM64 Docker image builds and publishing in the CI/CD pipeline.

Copilot uses AI. Check for mistakes.

```
docker build . -f Dockerfile --platform=linux/arm64
docker build . -f Dockerfile-arm64 --platform=linux/arm64
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding documentation about the ARM64 Dockerfile in the docs/source/en/custom_container.md file, similar to how CPU and CUDA builds are documented. This would help users understand when and how to use Dockerfile-arm64, especially for Apple Silicon development environments.

Copilot uses AI. Check for mistakes.
@alvarobartt
Copy link
Member

Hey @z4y4ts thanks for opening the PR! Given that Metal won't work over Docker, which is really the point on having a separate Dockerfile for it? What's really the benefit here, other than making it a bit lighter due to the lack of Intel MKL libs? I'm just not sure about having a separate Dockerfile for it, but happy to discuss further in case it's a real need here, thanks!

@z4y4ts
Copy link
Author

z4y4ts commented Feb 16, 2026

Hey @alvarobartt !

The key use case is to be able to do a local development on an Apple Silicone machines.

We're deploying the service to a linux cluster. Local development is done with using https://tilt.dev/

The key need is to have dev setup as close to the production as possible. So the slower performance is an acceptable trade-off as the load on dev machine is expected to be low. As long as it provides the same features/models.

I've added a separate Dockerfile because I see I'm not the only one with the same need. So it seems to be beneficial for the community.

Also, the solution described in the README does not actually work. So it's not super obvious how to make it run and takes quite a few extra steps.

If we agree this change is actually valuable, I'd like to also add it to the matrix.json to simplify macos setup even further.

Copy link
Member

@alvarobartt alvarobartt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough @z4y4ts thanks for the detailed information! I'll be happy to merge this PR and update the matrix.json to include it and build + push the arm64- image too (which I'll do in a follow up PR, as otherwise the CI won't run) 🤗

@z4y4ts
Copy link
Author

z4y4ts commented Feb 19, 2026

@alvarobartt thanks for approving!
Can you merge it? Or shall I do some extra steps?

Asking because there's no merge button for me.

@alvarobartt alvarobartt added this to the v1.10.0 milestone Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to build docker image on Apple M4 chip (required for development, not for real inference)

3 participants