This repository has been archived by the owner on Apr 12, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78e74af
commit 38315fc
Showing
5 changed files
with
64 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ FROM mhart/alpine-node:latest | |
|
||
LABEL description "Run Google Chrome's Lighthouse Audit in the background" | ||
|
||
LABEL version="1.0.5" | ||
LABEL version="1.0.7" | ||
|
||
LABEL author="Matthias Winkelmann <[email protected]>" | ||
LABEL coffee.matthi.vcs-url="https://github.com/MatthiasWinkelmann/lighthouse-chromium-alpine-docker" | ||
|
@@ -37,8 +37,8 @@ ENV LIGHTHOUSE_CHROMIUM_PATH /usr/bin/chromium-browser | |
ENV TZ "Europe/Berlin" | ||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV DEBCONF_NONINTERACTIVE_SEEN true | ||
ENV SCREEN_WIDTH 1360 | ||
ENV SCREEN_HEIGHT 1020 | ||
ENV SCREEN_WIDTH 750 | ||
ENV SCREEN_HEIGHT 1334 | ||
ENV SCREEN_DEPTH 24 | ||
ENV DISPLAY :99 | ||
#:99.0 | ||
|
@@ -48,8 +48,6 @@ RUN echo $TZ > /etc/timezone | |
|
||
RUN rc-update add dbus default | ||
|
||
ADD lighthouse-chromium-xvfb.sh . | ||
ADD test.sh . | ||
RUN npm --global install yarn && yarn global add lighthouse | ||
RUN mkdir output | ||
|
||
|
@@ -66,8 +64,14 @@ RUN rm -rf /var/lib/apt/lists/* \ | |
/usr/lib/node_modules/npm/html \ | ||
/usr/lib/node_modules/npm/scripts | ||
|
||
|
||
ADD lighthouse-chromium-xvfb.sh . | ||
|
||
# Alpine's grep is a BusyBox binary which doesn't provide | ||
# the -R (recursive, following symlinks) switch. | ||
#ADD grep ./grep | ||
# RUN alias grep=/lighthouse/grep | ||
|
||
ENTRYPOINT ["/lighthouse/lighthouse-chromium-xvfb.sh"] | ||
|
||
CMD ["--skip-autolaunch","--disable-cpu-throttling=true","--output-path=/tmp/test-report.html", "--output=pretty", "https://matthi.coffee/2017/lighthouse-chromium-headless-docker"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,21 +4,47 @@ | |
|
||
This image allows you to quickly run [lighthouse](https://github.com/GoogleChrome/lighthouse) in a headless container. That's useful if you want to run it from a CI server, or in the background of your workstation. | ||
|
||
To install: | ||
## Installation | ||
|
||
### From Github | ||
|
||
Github URL: <https://github.com/MatthiasWinkelmann/lighthouse-chromium-alpine-docker> | ||
|
||
```shell | ||
git clone [email protected]:MatthiasWinkelmann/lighthouse-chromium-alpine-docker.git | ||
docker build -t lighthouse-chromium-alpine-docker | ||
docker build -t lighthouse lighthouse-chromium-alpine-docker | ||
``` | ||
|
||
### From Docker Hub | ||
|
||
Docker Hub URL: <https://hub.docker.com/r/matthiaswinkelmann/lighthouse-chromium-alpine/> | ||
|
||
```shell | ||
docker pull matthiaswinkelmann/lighthouse-chromium-alpine | ||
``` | ||
|
||
## Usage | ||
|
||
Processes within the container cannot easily access the host's file system. You can either print to STDOUT and redirect to a file, or mount a local folder in the container, as shown here: | ||
|
||
### Quickstart: Print to STDOUT | ||
|
||
```shell | ||
run -v ./output/:/lighthouse/output/ lighthouse-chromium-alpine-docker --output-path=/lighthouse/output/results.html --save-assets --save-artifacts --output=html https://google.com | ||
docker run lighthouse --output-path=stdout https://google.com | ||
``` | ||
|
||
Run the tesT: | ||
### Saving to file | ||
|
||
```shell | ||
docker run -it --rm --entrypoint=sh lighthouse test.sh | ||
docker run -v ./output/:/lighthouse/output/ lighthouse --output-path=/lighthouse/output/results.html --save-assets --save-artifacts https://google.com | ||
``` | ||
|
||
## Testing | ||
|
||
```shell | ||
docker run lighthouse | ||
``` | ||
|
||
## Links | ||
|
||
Canonical URL: <https://matthi.coffee/2017/lighthouse-chromium-headless-docker> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
sut: | ||
build: . | ||
command: /lighthouse/test.sh |