The Wayback Machine - http://web.archive.org/web/20201217021527/https://github.com/giantswarm/lighthouse
Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

README.md

Docker Repository on Quay

lighthouse

Chrome Lighthouse in Docker, plus a few utilities useful for CI.

Usage

Run lighthouse with headless Chrome

docker run --rm \
    -v $PWD:/out \
    -v $PWD/dev-shm:/dev/shm \
    quay.io/giantswarm/lighthouse \
    lighthouse \
    http://example.com/ \
        --no-enable-error-reporting \
        --output=json \
        --output-path=/out/lighthouse.json \
        --emulated-form-factor desktop \
        --plugins=lighthouse-plugin-greenhouse \
        --chrome-flags="--headless --no-sandbox"

This should result in a lighthouse.json file being generated in your directory.

Mounting a volume to /dev/shm is recommended to prevent the process from dying for a lack of available shared memory.

For a list of options for --chrome-flags, check out this huge list.

For a list of lighthouse flags, execute

docker run --rm \
    -v $PWD/dev-shm:/dev/shm \
    quay.io/giantswarm/lighthouse --help

Run lighthouse-ci

This is a useful way to execute lighthouse in CI and fail if the score is below a threshold. See andreasonny83/lighthouse-ci for details.

docker run --rm \
    -v $PWD:/out \
    -v $PWD/dev-shm:/dev/shm \
    quay.io/giantswarm/lighthouse \
    lighthouse-ci \
    http://example.com/ \
        --report=/out \
        --score=90 \
        --emulated-form-factor desktop \
        --chrome-flags="--headless --no-sandbox"

The --score=90 flag sets a threshold score to pass of 90 in this case. Check lighthouse-ci for more flags.

Run lighthouse-keeper

This allows to run lighthouse in CI for a GitHub pull request and comment back the result. See giantswarm/lighthouse-keeper for details.

compare two lighthouse reports

docker run --rm \
    -v $PWD:/workdir -w /workdir \
    quay.io/giantswarm/lighthouse \
    lighthouse-keeper compare \
      --input master.json --label master \
      --input thisbranch.json --label "this branch"

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.