Lighthouse analyzes web apps and web pages, collecting modern performance metrics and insights on developer best practices. This container allows you to use lighthouse in conjunction with the --headless
option of Chrome M59+.
docker run -itv ~/your-local-dir:/home/chrome/reports --cap-add=SYS_ADMIN justinribeiro/lighthouse
Using the ever-awesome Jessie Frazelle SECCOMP profile for Chrome, we don't have to use the hammer that is SYS_ADMIN:
$ wget https://raw.githubusercontent.com/jfrazelle/dotfiles/master/etc/docker/seccomp/chrome.json -O ~/chrome.json
$ docker run -itv ~/your-local-dir:/home/chrome/reports --security-opt seccomp=$HOME/chrome.json justinribeiro/lighthouse
Once you're in the container, using the --chrome-flags
option available in lighthouse, we can automatically start Chrome in headless mode within the container light so:
lighthouse --chrome-flags="--headless --disable-gpu" https://justinribeiro.com
Use my other chrome-headless container for that.