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

Can't use with M2 Mac #51

Open
jaydee18 opened this issue Aug 21, 2023 · 5 comments
Open

Can't use with M2 Mac #51

jaydee18 opened this issue Aug 21, 2023 · 5 comments

Comments

@jaydee18
Copy link

I'm getting this error when attempting to use the latest image on my M2 Macbook:

chrome The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

@yukinying
Copy link
Owner

Did you use the "Chrome Headless Browser Stable" image as described in the README.md?

@celiolatorraca
Copy link

I am also having the same issue

The container crashes at startup and the only log i get is:

Error: Can't open display:

Here's the command I am running in this case:

docker run -it -P --shm-size=1g -p 58192:58192 yukinying/chrome-headless-browser-stable:118.0.5993.70 --disable-datasaver-prompt --no-first-run --disable-extensions --remote-debugging-address=0.0.0.0 --remote-debugging-port=58192 --headless --disable-gpu --hide-scrollbars

@yukinying
Copy link
Owner

Please check the instructions in https://github.com/yukinying/chrome-headless-browser-docker#how-to-run-the-container. I think you would need to add the cap-add=SYS_ADMIN flag as said in the instruction.

@i-kosh
Copy link

i-kosh commented Nov 1, 2023

m2 pro
on our project we use this image to take screenshots of storybook components and i trying to investigate problem with rendering differences on x86 and arm platforms

so i tried to launch docker with --platform=linux/amd64 and ran into same issue Error: Can't open display:
adding cap-add=SYS_ADMIN did not help

command i used

docker run --rm -it --platform=linux/amd64 --cap-add=SYS_ADMIN yukinying/chrome-headless-browser-stable:100.0.4896.127

needles to say the issue only occurs if i truing to run with --platform=linux/amd64, arm image (linux/arm64/v8) work fine, except rendering differences

upd: tried on latest - same

@celiolatorraca
Copy link

Still having the same issue
I was already using cap-add=SYS_ADMIN,

Here's the exact command I run:

docker run --init -it --rm --name chrome --shm-size=1024m -p=127.0.0.1:9222:9222 --cap-add=SYS_ADMIN \
  yukinying/chrome-headless-browser-stable:latest

And the output is only:

Error: Can't open display:

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

No branches or pull requests

4 participants