Giter Club home page Giter Club logo

dockerfiles's Introduction

Hello, nice to meet you. 👋

I ♥ the open web. Co-host The Web Platform Podcast. Google Developer Expert. Film photographer and mediocre darkroom printer. Maker of sometimes interesting things. Coder of open source curiosities. Always exploring.

PhD student and DM Design and Innovation Fellow @ Weatherhead School of Management at Case Western Reserve University.

☕ powered, 👪 driven, working our (new) tiny 🐤🦆🐢🐇🐹🦜🐝 farm.

Contact

You can reach me on Mastodon or via email at [email protected] or you can follow along on my adventures at https://justinribeiro.com.

dockerfiles's People

Contributors

brunosabot avatar chrisatomix avatar donut87 avatar fghpdf avatar justinribeiro avatar lyrixx avatar maxcanna avatar paulirish avatar philippmayrth avatar seyfer avatar warting avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dockerfiles's Issues

Getting permission denied error with lighthouse image

I have tried with both SYS_ADMIN and SECCOMP with several different URLs and the response is always the same error.

Runtime error encountered: EACCES: permission denied, open '/home/chrome/reports/www.redacted.com_2020-07-20_12-36-48.report.html'
Error: EACCES: permission denied, open '/home/chrome/reports/www.redacted.com_2020-07-20_12-36-48.report.html'

If I try touch somefile within the reports directory I get an access denied error.

My current workaround is to create a new directory, /home/chrome/new-reports and run lighthouse from there. Once the reports are generated I copy them to my host using docker container cp.

1.562 E: Unable to locate package google-chrome-stable - 404!

Hello, im having trouble installing chrome

To isolate the issue I changed the docker file like this:

# Install deps + add Chrome Stable + purge all the things
RUN apt-get update && apt-get install -y \
  apt-transport-https \
  ca-certificates \
  curl \
  gnupg \
  --no-install-recommends \
  && curl -sSL https://deb.nodesource.com/setup_12.x | bash - \
  && curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
  && echo "deb https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list 

RUN apt-get update && apt-get install -y google-chrome-stable 

RUN apt-get update && apt-get install -y \

Dockerfile:38

36 | && echo "deb https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list
37 |
38 | >>> RUN apt-get update && apt-get install -y google-chrome-stable
39 |
40 | RUN apt-get update && apt-get install -y \

Turns out I get a 404 on https://dl.google.com/linux/chrome/deb/

I googled and found issues from years past that suggested it was a country issue - so tried running via VPN from various countries, but still no luck.

image

Is it just me? Very strange.

[chrome-headless] The SUID sandbox helper binary was found, but is not configured correctly

Attempting to run the current version of the chrome-headless image fails with this error:

[1:1:1025/214033.788392:FATAL:setuid_sandbox_host.cc(157)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /opt/google/chrome/chrome-sandbox is owned by root and has mode 4755.

I believe this is because the Dockerfile forcibly overrides ownership of the contents of /opt/google/chrome and thus clears the set-id bit on /opt/google/chrome/chrome-sandbox. That directory belongs to the google-chrome-stable package, so it shouldn't need its ownership changed.

Deleting the line

&& mkdir -p /opt/google/chrome && chown -R chrome:chrome /opt/google/chrome

(and the backslash at the end of the previous line) from the Dockerfile produces an image that works, at least in --cap-add=SYS_ADMIN mode. (I've never been able to get the seccomp approach to do anything other than crash on startup.)

Allow to lock version for headless Chrome

By yesterday's update of chrome to Google Chrome to 66.0.3359.117 (https://github.com/alpeware/chrome-headless-stable/tree/66.0.3359.117), our complete test architecture on Travis stopped working.

Eg it requires now to set Host header to localhost or IP address:

curl http://chrome:9222/json/version
Host header is specified and is not an IP address or localhost

Spend quite some time to identify the issue and now need to spend some more time to resolve. Would be cool if could fix the version so we are sure we are testing still the same thing.

Example does not work: ReferenceError

Hello, as far as I can see your example should work out of the box, but it doesn't.

What did I do?

I put example.js to the root directory, made a subdirectory output from there and started your instruction:

# echo example.js | docker run -i --rm --security-opt seccomp=$HOME/chrome.json \
>     --mount type=bind,source="$(pwd)"/output,target=/output \
>     --name puppeteer-headless \
>     justinribeiro/puppeteer-headless \
>     node -e "`cat $_`"
[eval]:1
example.js
^

ReferenceError: example is not defined
    at [eval]:1:1
    at ContextifyScript.Script.runInThisContext (vm.js:50:33)
    at Object.runInThisContext (vm.js:139:38)
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:653:30)
    at evalScript (bootstrap_node.js:479:27)
    at startup (bootstrap_node.js:180:9)
    at bootstrap_node.js:625:3

Unfortunately, I cannot debug this by myself. What am I doing wrong? Can you help me?

Explanation

I have a docker puppeteer container with node myself and it works, I am just curious to test with your container as I stumbled upon a recommendation somewhere.

My container use has to be throttled somewhat as CPU tends to rise when too many parallel requests are running. I suppose this is perfectly normal, but maybe your solution works better.

justinribeiro/lighthouse timeout

when i run this i get a timeout.
but the exemple from the readme works.

It looks like disconnecting from browser takes 2 minutes :)
its a bit excessive because when auditing this website (https://justinribeiro.com) it disconnects in 4ms.
do you have any clue ?

#> mkdir test
#> cd test
#> docker run --rm -itv "$(pwd):/home/chrome/reports" --cap-add=SYS_ADMIN justinribeiro/lighthouse
#> lighthouse --chrome-flags="--headless --disable-gpu" https://flatbay.fr/fr
  ChromeLauncher Waiting for browser. +0ms
  ChromeLauncher Waiting for browser... +1ms
  ChromeLauncher Waiting for browser..... +506ms
  ChromeLauncher Waiting for browser.....✓ +1ms
  config:warn Trace not requested by an audit, dropping trace in defaultPass +565ms
  status Connecting to browser +2ms
  status Resetting state with about:blank +15ms
  status Benchmarking machine +20ms
  status Initializing… +1s
  status Running defaultPass pass FullPageScreenshot +637ms
  status Resetting state with about:blank +0ms
  status Setting up network for the pass trace +9ms
  status Beginning devtoolsLog and trace +2ms
  status Loading page & waiting for onload +0ms
  status Gathering in-page: FullPageScreenshot +3s
  status Gathering devtoolsLog & network records +0ms
  status Gathering: FullPageScreenshot +10ms
  status Disconnecting from browser... +2m
  ChromeLauncher Killing Chrome instance 501 +2ms
Runtime error encountered: Waiting for DevTools protocol response has exceeded the allotted time. (Method: Runtime.evaluate)
LHError: PROTOCOL_TIMEOUT
    at Timeout._onTimeout (/usr/lib/node_modules/lighthouse/lighthouse-core/gather/driver.js:376:21)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7)

Setting --proxy-server

Hi,

Thanks very much for your very useful chrome-headless docker container. I am trying to set up a chrome container that uses my local web proxy. However, I am not sure how to set the "--proxy-server" argument value for the chrome-headless container... Is it ever supported? If so, I would really appreciate your feedback.

Update lighthouse

It looks like the image for lighthouse is outdated - version 6.5.0

Could you please update it?

Lighthouse docker image fix

Hello,

I had trouble getting started with the Lighthouse docker image.

Running an audit in the docker image goes fine but fails when saving the HTML report to /home/chrome/reports inside of the docker images with due to permissions with the message:

  status Evaluating: Document avoids plugins +1ms
  status Evaluating: Document has a valid `rel=canonical` +0ms
  status Evaluating: Page is mobile friendly +1ms
  status Evaluating: Structured data is valid +1ms
  status Generating results... +0ms
  ChromeLauncher Killing Chrome instance 23 +40ms
Runtime error encountered: EACCES: permission denied, open '/home/chrome/reports/justinribeiro.com_2019-03-16_15-52-57.report.html'
Error: EACCES: permission denied, open '/home/chrome/reports/justinribeiro.com_2019-03-16_15-52-57.report.html'

The directory /home/chrome/reports inside of the docker container is still owned by root. The command chown -R chrome:chrome /home/chrome in the Dockerfile does not seem to register, as ls -la /home/chrome shows:

drwxr-xr-x 3 chrome chrome 4096 Oct 18 05:49 .
drwxr-xr-x 1 root   root   4096 Oct 18 05:49 ..
drwxr-xr-x 2 root   root   4096 Mar 16 15:34 reports

This is probably related to this SO question.

On the other hand, I went around and toyed around with the Dockerfile and found out the building it fails at step 5 npm install -g lighthouse because NPM is missing.
This is because NPM is not shipped by default with Nodejs in Debian and need to be specified explicitly.

This, surprisingly, solves of course, the error about NPM being missing AND the above mentioned permissions error and ls -la /hone/chrome from inside the new built image outputs:

drwxr-xr-x 3 chrome chrome 4096 Mar 16 16:06 .
drwxr-xr-x 1 root   root   4096 Mar 16 16:06 ..
drwxr-xr-x 2 chrome chrome 4096 Mar 16 16:06 reports

Trying to run lighthouse against a host that is in another container

First, thank you for making this docker image.

When I am trying to run lighthouse(from your container) against my localhost(which is in another container), it gives me an error that the connection is refused.

This is the command that I am running inside the docker container.

lighthouse --chrome-flags="--headless --disable-gpu" http://localhost:8000

Now I installed lighthouse cli on my machine. And I tested it against my localhost. It works as expected and it is giving me the results back.

Was wondering if you encountered this error before.

Also, I am using your image via a docker-compose file

version: '3'

services:
    lighthouse:
        image: justinribeiro/lighthouse
        volumes:
            - .:/home/chrome/reports
        cap_add:
            - SYS_ADMIN
        ports:
            - "8000:8000"

Let me know if you need more clarification on this issue.

Request: Ability to set uid/gid of chrome user

Love the container, thanks for it!

One of the challenges I'm facing is that the uid/gid that comes out for mounted volumes does is not controllable (unless I'm missing something).

Do you have any solutions or would gosu be a good solution here? I always hate to fork docker containers just to change uid/gid to my needs:

https://stackoverflow.com/questions/36781372/docker-using-gosu-vs-user

https://denibertovic.com/posts/handling-permissions-with-docker-volumes/

Cannot open display error

This seemed to work a few days ago but anytime today I open a fresh container I get the error in logs

(google-chrome-stable:1): Gtk-WARNING **: cannot open display:

Ideas?
Cheers

chrome-headless: Fontconfig error

I cannot access <host>:9222/json/version. It return text/html, not application/json nor json formatted text. I think chrome was dead and it return error html page.

I find some error in docker compose logs.

headless_chrome_1  | [0510/184749.130251:ERROR:gpu_process_transport_factory.cc(1007)] Lost UI shared context.
headless_chrome_1  |
headless_chrome_1  | DevTools listening on ws://0.0.0.0:9222/devtools/browser/eed68d51-7784-42ff-925d-e6ad4e2e8fd9
headless_chrome_1  | Fontconfig warning: "/etc/fonts/fonts.conf", line 5: unknown element "its:rules"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/fonts.conf", line 6: unknown element "its:translateRule"
headless_chrome_1  | Fontconfig error: "/etc/fonts/fonts.conf", line 6: invalid attribute 'translate'
headless_chrome_1  | Fontconfig error: "/etc/fonts/fonts.conf", line 6: invalid attribute 'selector'
headless_chrome_1  | Fontconfig error: "/etc/fonts/fonts.conf", line 7: invalid attribute 'xmlns:its'
headless_chrome_1  | Fontconfig error: "/etc/fonts/fonts.conf", line 7: invalid attribute 'version'
headless_chrome_1  | Fontconfig warning: "/etc/fonts/fonts.conf", line 9: unknown element "description"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/10-hinting-slight.conf", line 4: unknown element "its:rules"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/10-hinting-slight.conf", line 5: unknown element "its:translateRule"
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/10-hinting-slight.conf", line 5: invalid attribute 'translate'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/10-hinting-slight.conf", line 5: invalid attribute 'selector'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/10-hinting-slight.conf", line 6: invalid attribute 'xmlns:its'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/10-hinting-slight.conf", line 6: invalid attribute 'version'
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/10-hinting-slight.conf", line 8: unknown element "description"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 4: unknown element "its:rules"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 5: unknown element "its:translateRule"
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 5: invalid attribute 'translate'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 5: invalid attribute 'selector'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 6: invalid attribute 'xmlns:its'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 6: invalid attribute 'version'
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 8: unknown element "description"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/11-lcdfilter-default.conf", line 4: unknown element "its:rules"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/11-lcdfilter-default.conf", line 5: unknown element "its:translateRule"
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/11-lcdfilter-default.conf", line 5: invalid attribute 'translate'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/11-lcdfilter-default.conf", line 5: invalid attribute 'selector'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/11-lcdfilter-default.conf", line 6: invalid attribute 'xmlns:its'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/11-lcdfilter-default.conf", line 6: invalid attribute 'version'
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/11-lcdfilter-default.conf", line 8: unknown element "description"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/20-unhint-small-vera.conf", line 4: unknown element "its:rules"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/20-unhint-small-vera.conf", line 5: unknown element "its:translateRule"
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/20-unhint-small-vera.conf", line 5: invalid attribute 'translate'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/20-unhint-small-vera.conf", line 5: invalid attribute 'selector'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/20-unhint-small-vera.conf", line 6: invalid attribute 'xmlns:its'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/20-unhint-small-vera.conf", line 6: invalid attribute 'version'
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/20-unhint-small-vera.conf", line 8: unknown element "description"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/30-metric-aliases.conf", line 4: unknown element "its:rules"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/30-metric-aliases.conf", line 5: unknown element "its:translateRule"
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/30-metric-aliases.conf", line 5: invalid attribute 'translate'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/30-metric-aliases.conf", line 5: invalid attribute 'selector'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/30-metric-aliases.conf", line 6: invalid attribute 'xmlns:its'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/30-metric-aliases.conf", line 6: invalid attribute 'version'
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/30-metric-aliases.conf", line 8: unknown element "description"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 4: unknown element "its:rules"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 5: unknown element "its:translateRule"
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/40-nonlatin.conf", line 5: invalid attribute 'translate'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/40-nonlatin.conf", line 5: invalid attribute 'selector'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/40-nonlatin.conf", line 6: invalid attribute 'xmlns:its'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/40-nonlatin.conf", line 6: invalid attribute 'version'
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 8: unknown element "description"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/45-generic.conf", line 4: unknown element "its:rules"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/45-generic.conf", line 5: unknown element "its:translateRule"
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/45-generic.conf", line 5: invalid attribute 'translate'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/45-generic.conf", line 5: invalid attribute 'selector'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/45-generic.conf", line 6: invalid attribute 'xmlns:its'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/45-generic.conf", line 6: invalid attribute 'version'
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/45-generic.conf", line 8: unknown element "description"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 4: unknown element "its:rules"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 5: unknown element "its:translateRule"
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/45-latin.conf", line 5: invalid attribute 'translate'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/45-latin.conf", line 5: invalid attribute 'selector'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/45-latin.conf", line 6: invalid attribute 'xmlns:its'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/45-latin.conf", line 6: invalid attribute 'version'
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 8: unknown element "description"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/49-sansserif.conf", line 4: unknown element "its:rules"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/49-sansserif.conf", line 5: unknown element "its:translateRule"
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/49-sansserif.conf", line 5: invalid attribute 'translate'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/49-sansserif.conf", line 5: invalid attribute 'selector'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/49-sansserif.conf", line 6: invalid attribute 'xmlns:its'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/49-sansserif.conf", line 6: invalid attribute 'version'
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/49-sansserif.conf", line 8: unknown element "description"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 4: unknown element "its:rules"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 5: unknown element "its:translateRule"
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/50-user.conf", line 5: invalid attribute 'translate'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/50-user.conf", line 5: invalid attribute 'selector'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/50-user.conf", line 6: invalid attribute 'xmlns:its'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/50-user.conf", line 6: invalid attribute 'version'
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 8: unknown element "description"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/51-local.conf", line 4: unknown element "its:rules"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/51-local.conf", line 5: unknown element "its:translateRule"
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/51-local.conf", line 5: invalid attribute 'translate'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/51-local.conf", line 5: invalid attribute 'selector'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/51-local.conf", line 6: invalid attribute 'xmlns:its'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/51-local.conf", line 6: invalid attribute 'version'
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/51-local.conf", line 8: unknown element "description"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/60-generic.conf", line 4: unknown element "its:rules"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/60-generic.conf", line 5: unknown element "its:translateRule"
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/60-generic.conf", line 5: invalid attribute 'translate'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/60-generic.conf", line 5: invalid attribute 'selector'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/60-generic.conf", line 6: invalid attribute 'xmlns:its'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/60-generic.conf", line 6: invalid attribute 'version'
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/60-generic.conf", line 8: unknown element "description"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/60-latin.conf", line 4: unknown element "its:rules"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/60-latin.conf", line 5: unknown element "its:translateRule"
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/60-latin.conf", line 5: invalid attribute 'translate'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/60-latin.conf", line 5: invalid attribute 'selector'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/60-latin.conf", line 6: invalid attribute 'xmlns:its'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/60-latin.conf", line 6: invalid attribute 'version'
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/60-latin.conf", line 8: unknown element "description"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/65-fonts-persian.conf", line 34: unknown element "its:rules"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/65-fonts-persian.conf", line 35: unknown element "its:translateRule"
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/65-fonts-persian.conf", line 35: invalid attribute 'translate'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/65-fonts-persian.conf", line 35: invalid attribute 'selector'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/65-fonts-persian.conf", line 36: invalid attribute 'xmlns:its'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/65-fonts-persian.conf", line 36: invalid attribute 'version'
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/65-nonlatin.conf", line 4: unknown element "its:rules"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/65-nonlatin.conf", line 5: unknown element "its:translateRule"
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/65-nonlatin.conf", line 5: invalid attribute 'translate'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/65-nonlatin.conf", line 5: invalid attribute 'selector'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/65-nonlatin.conf", line 6: invalid attribute 'xmlns:its'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/65-nonlatin.conf", line 6: invalid attribute 'version'
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/65-nonlatin.conf", line 8: unknown element "description"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/69-unifont.conf", line 4: unknown element "its:rules"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/69-unifont.conf", line 5: unknown element "its:translateRule"
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/69-unifont.conf", line 5: invalid attribute 'translate'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/69-unifont.conf", line 5: invalid attribute 'selector'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/69-unifont.conf", line 6: invalid attribute 'xmlns:its'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/69-unifont.conf", line 6: invalid attribute 'version'
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/70-no-bitmaps.conf", line 4: unknown element "its:rules"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/70-no-bitmaps.conf", line 5: unknown element "its:translateRule"
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/70-no-bitmaps.conf", line 5: invalid attribute 'translate'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/70-no-bitmaps.conf", line 5: invalid attribute 'selector'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/70-no-bitmaps.conf", line 6: invalid attribute 'xmlns:its'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/70-no-bitmaps.conf", line 6: invalid attribute 'version'
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/70-no-bitmaps.conf", line 8: unknown element "description"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/80-delicious.conf", line 4: unknown element "its:rules"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/80-delicious.conf", line 5: unknown element "its:translateRule"
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/80-delicious.conf", line 5: invalid attribute 'translate'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/80-delicious.conf", line 5: invalid attribute 'selector'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/80-delicious.conf", line 6: invalid attribute 'xmlns:its'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/80-delicious.conf", line 6: invalid attribute 'version'
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/90-synthetic.conf", line 4: unknown element "its:rules"
headless_chrome_1  | Fontconfig warning: "/etc/fonts/conf.d/90-synthetic.conf", line 5: unknown element "its:translateRule"
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/90-synthetic.conf", line 5: invalid attribute 'translate'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/90-synthetic.conf", line 5: invalid attribute 'selector'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/90-synthetic.conf", line 6: invalid attribute 'xmlns:its'
headless_chrome_1  | Fontconfig error: "/etc/fonts/conf.d/90-synthetic.conf", line 6: invalid attribute 'version'
headless_chrome_1  | Fontconfig error: Cannot load config file from /etc/fonts/fonts.conf

and it is my docker-compose.yml file

ersion: '3'
services:
  bot_item4:
    image: item4/yui:latest
    volumes:
      - ./item4:/yui/data
    environment:
      - YUI_CONFIG_FILE_PATH=data/yui.config.toml
    depends_on:
      - db
      - headless_chrome
    links:
      - db
      - headless_chrome
    command: ./data/run.sh
  bot_9xd:
    image: item4/yui:latest
    volumes:
      - ./9xd:/yui/data
    environment:
      - YUI_CONFIG_FILE_PATH=data/yui.config.toml
    depends_on:
      - db
      - headless_chrome
    links:
      - db
      - headless_chrome
    command: ./data/run.sh
  bot_xnuk:
    image: item4/yui:latest
    volumes:
      - ./xnuk:/yui/data
    environment:
      - YUI_CONFIG_FILE_PATH=data/yui.config.toml
    depends_on:
      - db
      - headless_chrome
    links:
      - db
      - headless_chrome
    command: ./data/run.sh
  db:
    image: postgres:alpine
    volumes:
      - ./postgres/data:/var/lib/postgresql/data
    environment:
      - POSTGRES_PASSWORD=<super secret>
    healthcheck:
      test: "pg_isready -h localhost -p 5432 -q -U postgres"
      interval: 3s
      timeout: 1s
      retries: 10
  headless_chrome:
    image: justinribeiro/chrome-headless
    cap_add:
    - SYS_ADMIN
    command: --headless --disable-gpu --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222

chrome report crash after run images

--2021-03-05 04:38:31-- https://clients2.google.com/cr/report
Resolving clients2.google.com (clients2.google.com)... 172.217.174.206, 2404:6800:4005:801::200e
Connecting to clients2.google.com (clients2.google.com)|172.217.174.206|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
Saving to: '/dev/fd/4'

 0KCrash dump id:  03eb3544a21fd90e 
                                                  5.69M

can't get /json/version by hostname

I'm using docker-compose, here is .yml

version: '3'

services:
  crawler:
    build: ./images/crawler
    environment:
      - DEV_MOD=YES
    volumes:
      - ../../:/var/www/app
    networks:
      - crawler
    stdin_open: true
    tty: true
    ports:
      - "3333:3333"
    depends_on:
      - redis
      - chrome

  chrome:
    image: justinribeiro/chrome-headless
    privileged: true
    networks:
      - crawler
    ports:
      - "9222:9222"

  redis:
    image: redis:5-alpine
    networks:
      - crawler
    ports:
      - "6379:6379"

networks:
  crawler:
    ipam:
      config:
        - subnet: 172.50.0.0/24

I try get data by wget from crawler container:

If I using hostname of chrome container, I get error
/var/www/app # wget http://chrome:9222/json/version
Connecting to chrome:9222 (172.50.0.3:9222)
wget: server returned error: HTTP/1.1 500 Internal Server Error

If I using ip of chrome container, I get 200 responce.
/var/www/app # wget http://172.50.0.3:9222/json/version
Connecting to 172.50.0.3:9222 (172.50.0.3:9222)
version 100% |****************************************************| 422 0:00:00 ETA

Is it chrome issue or my docker-compose config?

Unable to connect to Chrome - Gtk-WARNING **: 04:33:21.729: cannot open display

I am trying to use the justinribeiro/lighthouse image but following the default steps i get an error because Chrome Launcher fails to start the browser.

My docker-compose

  speedtest:
    image: justinribeiro/lighthouse
    #build: docker/lighthouse_ci
    volumes:
      - reports:/home/chrome/reports
    command: ['lighthouse', '--chrome-flags="--headless --disable-gpu --no-sandbox"', 'http://web/component/FullVerticalLayout']
    #command: ['lighthouse_ci', 'http://web/component/FullVerticalLayout']
    depends_on:
      - web
    cap_add:
      - SYS_ADMIN
    healthcheck:
      test: ["CMD", "curl", "-f", "http://web/component/FullVerticalLayout"]
      interval: 1m30s
      timeout: 10s
      retries: 3
      start_period: 40s

And the full error

# command: ['lighthouse', '--chrome-flags="--headless --disable-gpu"', 'http://web/component/FullVerticalLayout']
$ docker-compose logs speedtest
Attaching to myreviews-styleguide_speedtest_1
speedtest_1  | Wed, 01 Apr 2020 04:29:09 GMT ChromeLauncher Waiting for browser.
speedtest_1  | Wed, 01 Apr 2020 04:29:09 GMT ChromeLauncher Waiting for browser...
speedtest_1  | Wed, 01 Apr 2020 04:29:09 GMT ChromeLauncher Waiting for browser.....
speedtest_1  | Wed, 01 Apr 2020 04:29:10 GMT ChromeLauncher Waiting for browser.......
speedtest_1  | Wed, 01 Apr 2020 04:29:10 GMT ChromeLauncher Waiting for browser.........
speedtest_1  | Wed, 01 Apr 2020 04:29:11 GMT ChromeLauncher Waiting for browser...........
speedtest_1  | Wed, 01 Apr 2020 04:29:11 GMT ChromeLauncher Waiting for browser.............
speedtest_1  | Wed, 01 Apr 2020 04:29:12 GMT ChromeLauncher Waiting for browser...............
speedtest_1  | Wed, 01 Apr 2020 04:29:12 GMT ChromeLauncher Waiting for browser.................
speedtest_1  | Wed, 01 Apr 2020 04:29:13 GMT ChromeLauncher Waiting for browser...................
speedtest_1  | Wed, 01 Apr 2020 04:29:13 GMT ChromeLauncher Waiting for browser.....................
speedtest_1  | Wed, 01 Apr 2020 04:29:14 GMT ChromeLauncher Waiting for browser.......................
speedtest_1  | Wed, 01 Apr 2020 04:29:14 GMT ChromeLauncher Waiting for browser.........................
speedtest_1  | Wed, 01 Apr 2020 04:29:15 GMT ChromeLauncher Waiting for browser...........................
speedtest_1  | Wed, 01 Apr 2020 04:29:15 GMT ChromeLauncher Waiting for browser.............................
speedtest_1  | Wed, 01 Apr 2020 04:29:16 GMT ChromeLauncher Waiting for browser...............................
speedtest_1  | Wed, 01 Apr 2020 04:29:16 GMT ChromeLauncher Waiting for browser.................................
speedtest_1  | Wed, 01 Apr 2020 04:29:17 GMT ChromeLauncher Waiting for browser...................................
speedtest_1  | Wed, 01 Apr 2020 04:29:17 GMT ChromeLauncher Waiting for browser.....................................
speedtest_1  | Wed, 01 Apr 2020 04:29:18 GMT ChromeLauncher Waiting for browser.......................................
speedtest_1  | Wed, 01 Apr 2020 04:29:18 GMT ChromeLauncher Waiting for browser.........................................
speedtest_1  | Wed, 01 Apr 2020 04:29:19 GMT ChromeLauncher Waiting for browser...........................................
speedtest_1  | Wed, 01 Apr 2020 04:29:19 GMT ChromeLauncher Waiting for browser.............................................
speedtest_1  | Wed, 01 Apr 2020 04:29:20 GMT ChromeLauncher Waiting for browser...............................................
speedtest_1  | Wed, 01 Apr 2020 04:29:20 GMT ChromeLauncher Waiting for browser.................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:21 GMT ChromeLauncher Waiting for browser...................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:21 GMT ChromeLauncher Waiting for browser.....................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:22 GMT ChromeLauncher Waiting for browser.......................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:22 GMT ChromeLauncher Waiting for browser.........................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:23 GMT ChromeLauncher Waiting for browser...........................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:23 GMT ChromeLauncher Waiting for browser.............................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:24 GMT ChromeLauncher Waiting for browser...............................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:24 GMT ChromeLauncher Waiting for browser.................................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:25 GMT ChromeLauncher Waiting for browser...................................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:25 GMT ChromeLauncher Waiting for browser.....................................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:26 GMT ChromeLauncher Waiting for browser.......................................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:26 GMT ChromeLauncher Waiting for browser.........................................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:27 GMT ChromeLauncher Waiting for browser...........................................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:27 GMT ChromeLauncher Waiting for browser.............................................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:28 GMT ChromeLauncher Waiting for browser...............................................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:28 GMT ChromeLauncher Waiting for browser.................................................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:29 GMT ChromeLauncher Waiting for browser...................................................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:29 GMT ChromeLauncher Waiting for browser.....................................................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:30 GMT ChromeLauncher Waiting for browser.......................................................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:30 GMT ChromeLauncher Waiting for browser.........................................................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:31 GMT ChromeLauncher Waiting for browser...........................................................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:31 GMT ChromeLauncher Waiting for browser.............................................................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:32 GMT ChromeLauncher Waiting for browser...............................................................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:32 GMT ChromeLauncher Waiting for browser.................................................................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:33 GMT ChromeLauncher Waiting for browser...................................................................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:33 GMT ChromeLauncher Waiting for browser.....................................................................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:34 GMT ChromeLauncher Waiting for browser.......................................................................................................
speedtest_1  | Wed, 01 Apr 2020 04:29:34 GMT ChromeLauncher:error connect ECONNREFUSED 127.0.0.1:38355
speedtest_1  | Wed, 01 Apr 2020 04:29:34 GMT ChromeLauncher:error Logging contents of /tmp/lighthouse.8XwwCiV/chrome-err.log
speedtest_1  | Wed, 01 Apr 2020 04:29:34 GMT ChromeLauncher:error 
speedtest_1  | (google-chrome-stable:21): Gtk-WARNING **: 04:29:10.695: cannot open display: 
speedtest_1  | 
speedtest_1  | Unable to connect to Chrome

The command is executed as per your readme. I also tried with --no-sandbox after seeing this option in another ticket in this repo that was previously closed.

$ docker inspect 76fe09a8e0f1 | grep -A 4 Cmd
            "Cmd": [
                "lighthouse",
                "--chrome-flags=\"--headless --disable-gpu --no-sandbox\"",
                "http://web/component/FullVerticalLayout"
            ],

Any ideas what I might be missing?

I have also tried to use the lighthouse_ci image as per this ticket on their repo. GoogleChromeLabs/lighthousebot#86

Lighthouse: No usable sandbox!

Hey,

Even after the changes in the pull request #46, the Lighthouse audit crashes with the message:

  ChromeLauncher Waiting for browser....................................................................................................... +503ms
  ChromeLauncher:error connect ECONNREFUSED 127.0.0.1:43449 +3ms
  ChromeLauncher:error Logging contents of /tmp/lighthouse.5V3TSDY/chrome-err.log +2ms
  ChromeLauncher:error [0316/163340.738658:FATAL:zygote_host_impl_linux.cc(116)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox_development.md for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.
  ChromeLauncher:error Failed to generate minidump. +1ms
Unable to connect to Chrome

Also, note that it runs successfully with the Chrome option --no-sandbox:

lighthouse --chrome-flags="--headless --disable-gpu --no-sandbox" https://example.com

Puppeteer's README suggests some changes to solve the error

Would that be of interest to you? Knowing that, apparently there is official support for Docker from the Lighthouse team as discussed in here https://github.com/GoogleChrome/lighthouse/issues/3715

Timedout error and crazy behaviour

Hi all,
I always run into this error when mutiple people call the pdf.toBuffer() function from https://github.com/westy92/html-pdf-chrome the same time / mutiple API calls are made synchronously to create a pdf..

Error: connect ETIMEDOUT 159.XX.XXX.XXX:9222
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16)
    at TCPConnectWrap.callbackTrampoline (internal/async_hooks.js:130:17)

I use the headless-chrome instance in a docker container on a Hetzner server.
The docker-compose file looks like:

version: "2"
services:
  chrome:
    image: justinribeiro/chrome-headless:latest
    command: ["chromium-browser", "--headless", "--disable-gpu", "--no-sandbox", "--remote-debugging-address=0.0.0.0", "--remote-debugging-port=9222", "--disable-extensions", "--disable-dev-shm-usage", "--disable-features=dbus", "--disable-software-rasterizer"]
    restart: always
    ports:
      - "9222:9222"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://159.XX.XXX.XXX:9222"]
      interval: 10s
      timeout: 5s
      retries: 5
    logging:
      options:
        max-size: "10m"
        max-file: "3"
    mem_limit: 4g 
    cpus: 3.0 

The chrome instance looks like this.
CleanShot 2024-02-15 at 19 09 09@2x

@justinribeiro Is there anything I need to consider?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.