Zenika / alpine-chrome

Chrome Headless docker images built upon alpine official image
https://hub.docker.com/r/zenika/alpine-chrome
Apache License 2.0
1.82k stars 241 forks source link

Error connecting to zenika/alpine-chrome:with-chromedriver #197

Closed jcestibariz closed 2 years ago

jcestibariz commented 2 years ago

Describe the bug

Creating a new session produces the error: Host header or origin header is specified and is not whitelisted or localhost.

To Reproduce Steps to reproduce the behavior:

  1. Image version: zenika/alpine-chrome@sha256:020cb24474d489d08e0e63cfeaef54e0cad3e95f4035c9a32dc88307fa3d311e
  2. docker network create test
  3. docker run -it --name driver --net test --shm-size=1g --rm zenika/alpine-chrome:with-chromedriver
  4. In another terminal:
  5. docker run -it --rm --net test alpine
  6. apk add --no-cache curl
  7. curl -X POST -d '{"desiredCapabilities":{"goog:chromeOptions":{"args":["--headless","--no-sandbox"]}}}' -H 'Content-Type: application/json' http://driver:9515/session
  8. See error: Host header or origin header is specified and is not whitelisted or localhost.

What is the expected behavior? Should return a session response like: {"sessionId":"...","status":0,"value":{...}}

What is the actual behavior? Returns the error message: Host header or origin header is specified and is not whitelisted or localhost.

Possible solution Use the new options: --allowed-ips= --allowed-origins=*

Logs

Starting ChromeDriver 100.0.4896.60 (6a5d10861ce8de5fce22564658033b43cb7de047-refs/branch-heads/4896@{#875}) on port 9515
All remote connections are allowed. Use an allowlist instead!
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
[1650499321.128][SEVERE]: Unable find match for host: driver:9515

Versions

Software Version(s)
Chromium 100.0.4896.60
Image zenika/alpine-chrome@sha256:020cb24474d489d08e0e63cfeaef54e0cad3e95f4035c9a32dc88307fa3d311e
Docker Engine 20.10.14