Skip to content

Commit

Permalink
fixes #3 - Multiarch image
Browse files Browse the repository at this point in the history
  • Loading branch information
jaymoulin committed Dec 1, 2017
1 parent 5214fcd commit 2f52dd2
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
google-lighthouse-puppeteer-*.tgz
.build
*.yaml
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM femtopixel/google-lighthouse
FROM femtopixel/google-lighthouse:0.3.0

MAINTAINER Jay MOULIN <[email protected]> <https://twitter.com/moulinjay>
LABEL maintainer="Jay MOULIN <[email protected]> <https://twitter.com/moulinjay>"

#https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
RUN mkdir -p /home/chrome/testcases && cd /home/chrome && yarn add google-lighthouse-puppeteer
Expand Down
29 changes: 27 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
.PHONY=install install-npm publish publish-npm

VERSION ?= 0.3.3
CACHE ?= --no-cache=1
FULLVERSION ?= ${VERSION}
archs = arm32v7 amd64 i386
.PHONY: install install-npm publishdocker publish-npm docker build-docker publish-docker latest version
all: install publish docker
CACHE= make latest
docker: build-docker publish-docker
CACHE= make latest
install:
docker run --rm -v `pwd`:/app -ti -w /app node make install-npm
publish:
Expand All @@ -18,3 +25,21 @@ install-npm: clean
npm pack
publish-npm: install-npm
npm login && npm publish
build-docker:
$(foreach arch,$(archs), \
cat Dockerfile | sed "s/FROM femtopixel\/google-lighthouse:0.3.0/FROM femtopixel\/google-lighthouse:0.3.0-$(arch)/g" > .build; \
if [ $(arch) = arm32v7 ]; then \
docker build -t femtopixel/google-lighthouse-puppeteer:${VERSION}-$(arch) --build-arg ARM=1 -f .build ${CACHE} .;\
else \
docker build -t femtopixel/google-lighthouse-puppeteer:${VERSION}-$(arch) --build-arg ARM=0 -f .build ${CACHE} .;\
fi;\
)
publish-docker:
docker push femtopixel/google-lighthouse-puppeteer
cat manifest.yml | sed "s/\$$VERSION/${VERSION}/g" > manifest2.yaml
cat manifest2.yaml | sed "s/\$$FULLVERSION/${FULLVERSION}-debian/g" > manifest.yaml
manifest-tool push from-spec manifest.yaml
latest: build-docker
cat manifest.yml | sed "s/\$$VERSION/${VERSION}/g" > manifest2.yaml
cat manifest2.yaml | sed "s/\$$FULLVERSION/latest/g" > manifest.yaml
manifest-tool push from-spec manifest.yaml
18 changes: 18 additions & 0 deletions manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
image: femtopixel/google-lighthouse-puppeteer:$FULLVERSION
manifests:
-
image: femtopixel/google-lighthouse-puppeteer:$VERSION-arm32v7
platform:
architecture: arm
variant: v7
os: linux
-
image: femtopixel/google-lighthouse-puppeteer:$VERSION-i386
platform:
architecture: 386
os: linux
-
image: femtopixel/google-lighthouse-puppeteer:$VERSION-amd64
platform:
architecture: amd64
os: linux

0 comments on commit 2f52dd2

Please sign in to comment.