Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing arm64 arch in docker manifest causing docker build to error out #10276

Open
tomrod10 opened this issue Jan 5, 2025 · 7 comments
Open
Assignees
Labels
Lead: @mekarpeles Issues overseen by Mek (Staff: Program Lead) [managed] Module: Docker Issues related to the configuration or use of Docker. [managed] Priority: 3 Issues that we can consider at our leisure. [managed] Type: Bug Something isn't working. [managed]

Comments

@tomrod10
Copy link

tomrod10 commented Jan 5, 2025

Problem

Tried setting up/running OL locally via docker and I get the following error when I run docker compose build from the root directory: failed to solve: openlibrary/olbase:latest: failed to resolve source metadata for docker.io/openlibrary/olbase:latest: no match for platform in manifest: not found

I'm running into this on my M3 MacBook Air. Additionally, I attempted this on my Linux (Intel chip/amd64 arch) machine and was able to get it up and running without a hitch.

Seems like the docker manifest is missing arm64/linux platform.

Screenshot 2025-01-04 at 16 38 15

Note: I'm still newish to Docker so I have limited knowledge on this area. Regardless, I'm happy to learn more and tackle this if possible. Thanks!

Reproducing the bug

To check docker manifest

  1. Open your terminal
  2. Go to the root directory ~/openlibrary
  3. run the following command docker manifest inspect openlibrary/olbase:latest
  4. See the printed content on your terminal

To repro the issue

  1. Have access to a computer/laptop with an arm64 architecture CPU
  2. Install Docker referencing OL readme guide
  3. cd into the root directory ~/openlibrary
  4. run the following command docker compose build on the terminal
  5. Wait and check build logs
  • Expected behavior:

  • Docker build to not error out and successfully build the image

  • Actual behavior:

  • Docker build runs into error and exits the build process

Context

  • OS (Windows, Mac, etc): Mac (arm64 arch)
  • Environment (prod, dev, local): dev

Breakdown

Requirements Checklist

  • [ ]

Related files

Stakeholders


Instructions for Contributors

  • Please run these commands to ensure your repository is up to date before creating a new branch to work on this issue and each time after pushing code to Github, because the pre-commit bot may add commits to your PRs upstream.
@tomrod10 tomrod10 added Needs: Breakdown This big issue needs a checklist or subissues to describe a breakdown of work. [managed] Needs: Lead Needs: Triage This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed] Type: Bug Something isn't working. [managed] labels Jan 5, 2025
@mekarpeles mekarpeles added the Module: Docker Issues related to the configuration or use of Docker. [managed] label Jan 5, 2025
@mekarpeles
Copy link
Member

Can you use buildx to enable Docker emulation for ARM64?

docker buildx create --use
docker run --privileged --rm tonistiigi/binfmt --install all

@RayBB
Copy link
Collaborator

RayBB commented Jan 5, 2025

Following because I also had this issue and ultimately built ol base from scratch. Would be nice if we published arm images but I know that's work.

@mekarpeles mekarpeles added the Lead: @mekarpeles Issues overseen by Mek (Staff: Program Lead) [managed] label Jan 6, 2025
@mekarpeles
Copy link
Member

@cdrini says this problem may go away once our nginx setup gets rid of openresty (as our docker container approaches can converge and won't need separate profiles)

@mekarpeles mekarpeles added Priority: 3 Issues that we can consider at our leisure. [managed] and removed Needs: Breakdown This big issue needs a checklist or subissues to describe a breakdown of work. [managed] Needs: Triage This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed] Needs: Lead labels Jan 6, 2025
@tomrod10
Copy link
Author

tomrod10 commented Jan 8, 2025

Can you use buildx to enable Docker emulation for ARM64?

docker buildx create --use
docker run --privileged --rm tonistiigi/binfmt --install all

Ran these and then attempted to run docker compose build and the same error came up.

@tomrod10
Copy link
Author

tomrod10 commented Jan 8, 2025

Following because I also had this issue and ultimately built ol base from scratch. Would be nice if we published arm images but I know that's work.

I ended up doing this ^^^

For reference I did the following:

  1. Built a local image of olbase with linux/arm64 as the platform:
  • docker buildx build --platform linux/arm64 --file docker/Dockerfile.olbase . --tag olbase:latest
  1. Edit Dockerfile.oldev to reference the local image of olbase
  • FROM olbase:latest
  1. Run docker compose build
  2. Run docker compose up
  3. Navigate to localhost:8080
  • Open Library Dev version should load

@github-actions github-actions bot added the Needs: Response Issues which require feedback from lead label Jan 8, 2025
@mekarpeles
Copy link
Member

Thank you @tomrod10 for struggling through! We'll see if we can improve this workflow moving forward, but for now, since we have two cases where we've gotten it to work, marking as resolved

@mekarpeles mekarpeles removed the Needs: Response Issues which require feedback from lead label Jan 12, 2025
@RayBB
Copy link
Collaborator

RayBB commented Jan 12, 2025

We should add it to the setup docs if manual steps are going to be required for anyone on a M1 chip to run OL.

@RayBB RayBB reopened this Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Lead: @mekarpeles Issues overseen by Mek (Staff: Program Lead) [managed] Module: Docker Issues related to the configuration or use of Docker. [managed] Priority: 3 Issues that we can consider at our leisure. [managed] Type: Bug Something isn't working. [managed]
Projects
Status: Done
Development

No branches or pull requests

3 participants