chromedp: chromedp/headless-shell does not run on M1 macs

What did you do? Include clear steps.

I ran docker run -p 9222:9222 --rm --name headless-shell chromedp/headless-shell on an M1 mac

What did you expect to see?

The docker container to run successfully

What did you see instead?

The docker container crashes with error

qemu: uncaught target signal 6 (Aborted) - core dumped

Cause

This is because the chromedp/headless-shell images on dockerhub do not have builds for ARM64. They are only available for linux/amd64: Screen Shot 2022-01-25 at 7 39 17 AM

Solution

@kenshaw if you could upload a multi-arch build of the headless-shell then it would work on macs with ARM chips.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 1
  • Comments: 18 (8 by maintainers)

Most upvoted comments

At the moment, this problem no longer exists:

Now the only problem is that the Github Actions does not provide ARM64 runners yet (see https://github.com/actions/runner-images/issues/2552), so we have no way to test the created image. We will review this issue once ARM64 runners are available.

This task already merged and closed. @ZekeLu When can I expect chromedp/headless-shell support on M1?

For one, I don’t know why the discussion is happening here, as the correct place for this would be on the docker-headless-shell repository.

It looks like the docker-headless-shell repository doesn’t have thee “Issues” feature enabled. We could move this discussion there once that is turned on.

Hi 👋 I have the same errors.

@kenshaw If you like use a M1 temporary you can use the instance M1 of Scalway

I tried to build the image for arm64 but I have so many errors in so many place, I’m a little bit lost, but I’m interested to help the team to build the image.

(I tried the to ran headless-shell without gpu)

[~] docker run -it --platform linux/amd64 -p 9222:9222 --rm --entrypoint /bin/bash chromedp/headless-shell:latest                                                                                                                             
root@d22c78afea32:/# cd /headless-shell
root@d22c78afea32:/headless-shell# ./headless-shell --no-sandbox --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault

PS: It’s not the best solution but in the meantime we can run the headless with google chrome 😃

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --headless --remote-debugging-port=9222 --disable-gpu --no-sandbox

@yehudamakarov I just checked – the issue here is that the GPU isn’t supported. You’ll need to alter the command flags for the container to disable the GPU, and even then I’m not sure that will work or not. I’m trying different combinations, if I’m able to get it to work I’ll report back here.

@yehudamakarov I recently bought a M1 Mac laptop and have no issues running linux/amd64 docker containers with it. You might need to install Rosetta to make it work, or upgrade to the arm64 version of Docker Desktop? I haven’t specifically tested the chromedp/headless-shell Docker image, but will do so now.

I do not have a Mac or any ARM hardware to be able to do a arm64 build. You may want to try using Rosetta. If you’d like to donate a M1 or other arm64 system (preferably rack mountable), I would make it a priority to produce a multiarch image.