Skip to content

Commit 0743601

Browse files
committed
fixes #2 - add multiarch image + crossbuilding
1 parent f34c065 commit 0743601

File tree

6 files changed

+55
-7
lines changed

6 files changed

+55
-7
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.build
2+
*.yaml

Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
1-
FROM femtopixel/google-chrome-headless
1+
FROM femtopixel/google-chrome-headless:0.2.0
22

33
MAINTAINER Jay MOULIN <jaymoulin@gmail.com> <http://twitter.com/moulinjay>
44

5+
ARG ARM=0
56
USER root
67

78
# Install deps + add Chrome Stable + purge all the things
8-
RUN apt-get update && apt-get install -y apt-transport-https ca-certificates curl gnupg --no-install-recommends && \
9-
curl -sSL https://deb.nodesource.com/setup_9.x | bash - && \
9+
RUN apt-get remove gnupg -y && apt-get install --reinstall gnupg2 dirmngr -y && \
10+
if [ ${ARM-0} ]; then apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 40976EAF437D05B5; \
11+
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 3B4FE6ACC0B21F32; fi && \
12+
rm -rf /var/lib/apt/lists/* && \
13+
apt-get autoclean && apt-get update && apt-get install -y apt-transport-https ca-certificates curl gnupg --no-install-recommends && \
14+
curl -sSL https://deb.nodesource.com/setup_9.x | bash - && \
1015
apt-get update && apt-get install -y nodejs --no-install-recommends && \
16+
if [ ${ARM-0} ]; then npm config set unsafe-perm true; fi && \
1117
npm --global install yarn && \
1218
apt-get purge --auto-remove -y curl gnupg && \
1319
rm -rf /var/lib/apt/lists/* && \
14-
yarn global add lighthouse && \
20+
npm install --global lighthouse && \
1521
mkdir -p /home/chrome/reports && chown -R chrome:chrome /home/chrome
1622

1723
# some place we can mount and view lighthouse reports

Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
CACHE ?= --no-cache=1
2+
VERSION ?= 0.3.0
3+
FULLVERSION ?= ${VERSION}
4+
archs = arm32v7 amd64 i386
5+
.PHONY: all build publish latest version
6+
all: build publish
7+
build:
8+
$(foreach arch,$(archs), \
9+
cat Dockerfile | sed "s/FROM femtopixel\/google-chrome-headless:0.2.0/FROM femtopixel\/google-chrome-headless:0.2.0-$(arch)/g" > .build; \
10+
if [ $(arch) = arm32v7 ]; then \
11+
docker build -t femtopixel/google-lighthouse:${VERSION}-$(arch) --build-arg ARM=1 -f .build ${CACHE} .;\
12+
else \
13+
docker build -t femtopixel/google-lighthouse:${VERSION}-$(arch) --build-arg ARM=0 -f .build ${CACHE} .;\
14+
fi;\
15+
)
16+
publish:
17+
docker push femtopixel/google-lighthouse
18+
cat manifest.yml | sed "s/\$$VERSION/${VERSION}/g" > manifest2.yaml
19+
cat manifest2.yaml | sed "s/\$$FULLVERSION/${FULLVERSION}-debian/g" > manifest.yaml
20+
manifest-tool push from-spec manifest.yaml
21+
latest: build
22+
cat manifest.yml | sed "s/\$$VERSION/${VERSION}/g" > manifest2.yaml
23+
cat manifest2.yaml | sed "s/\$$FULLVERSION/latest/g" > manifest.yaml
24+
manifest-tool push from-spec manifest.yaml

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ Google Lighthouse - Docker Image
77
[![Bitcoin donation](https://github.com/jaymoulin/jaymoulin.github.io/raw/master/btc.png "Bitcoin donation")](https://m.freewallet.org/id/374ad82e/btc)
88
[![Litecoin donation](https://github.com/jaymoulin/jaymoulin.github.io/raw/master/ltc.png "Litecoin donation")](https://m.freewallet.org/id/374ad82e/ltc)
99
[![PayPal donation](https://github.com/jaymoulin/jaymoulin.github.io/raw/master/ppl.png "PayPal donation")](https://www.paypal.me/jaymoulin)
10-
[![Beerpay donation](https://beerpay.io/femtopixel/docker-google-lighthouse/badge.svg "Beerpay donation")](https://beerpay.io/femtopixel/docker-google-lighthouse)
11-
1210

1311
[Lighthouse](https://developers.google.com/web/tools/lighthouse/) analyzes web apps and web pages, collecting modern performance metrics and insights on developer best practices.
1412

entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -e
33

44
# first arg is `-f` or `--some-option`
55
if [ "${1#http}" != "$1" ]; then
6-
set -- lighthouse --chrome-flags="--headless --disable-gpu" "$@"
6+
set -- lighthouse --enable-error-reporting --chrome-flags="--headless --disable-gpu" "$@"
77
fi
88

99
exec "$@"

manifest.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
image: femtopixel/google-lighthouse:$FULLVERSION
2+
manifests:
3+
-
4+
image: femtopixel/google-lighthouse:$VERSION-arm32v7
5+
platform:
6+
architecture: arm
7+
variant: v7
8+
os: linux
9+
-
10+
image: femtopixel/google-lighthouse:$VERSION-i386
11+
platform:
12+
architecture: 386
13+
os: linux
14+
-
15+
image: femtopixel/google-lighthouse:$VERSION-amd64
16+
platform:
17+
architecture: amd64
18+
os: linux

0 commit comments

Comments
 (0)