Skip to content

Commit

Permalink
Enable building docker image from Apple M1
Browse files Browse the repository at this point in the history
  • Loading branch information
Jian Liao committed Feb 1, 2023
1 parent 7e3934f commit b3517a8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 43 deletions.
8 changes: 2 additions & 6 deletions artifactory-docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:latest
FROM node:18-alpine

ARG BACKSTOPJS_VERSION

Expand All @@ -24,18 +24,14 @@ RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/main" > /etc/apk/repositorie
ttf-cantarell \
font-noto-emoji \
wqy-zenhei \
nodejs \
yarn \
&& rm -rf /var/cache/* \
&& mkdir /var/cache/apk

COPY local.conf /etc/fonts/local.conf

# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser

RUN yarn global add backstopjs-spectrum@${BACKSTOPJS_VERSION}
RUN npm i -g backstopjs-spectrum@${BACKSTOPJS_VERSION}

# Setup adobe clean font
RUN wget --no-check-certificate https://spectrum-resources.corp.adobe.com/fonts/AdobeClean.zip -O AdobeClean.zip \
Expand Down
5 changes: 3 additions & 2 deletions artifactory-docker/Playwright_Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
FROM mcr.microsoft.com/playwright:jammy
FROM mcr.microsoft.com/playwright:next

ARG BACKSTOPJS_VERSION

ENV \
BACKSTOPJS_VERSION=$BACKSTOPJS_VERSION
BACKSTOPJS_VERSION=$BACKSTOPJS_VERSION \
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true

# Base packages
# RUN apt-get update && \
Expand Down
31 changes: 0 additions & 31 deletions artifactory-docker/local.conf

This file was deleted.

6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@
"build-and-copy-report-bundle": "npm run build-compare && npm run copy-report-bundle",
"remote": "cd test/configs/ && node ../../cli/index.js remote",
"stop": "curl http://localhost:3000/stop",
"build-docker": "PV=$(node -p -e \"require('./package.json').version\"); docker build artifactory-docker --build-arg BACKSTOPJS_VERSION=$PV -t docker-adobe-spectrum-release.dr.corp.adobe.com/backstopjs-spectrum:$PV",
"push-docker": "PV=$(node -p -e \"require('./package.json').version\"); docker push docker-adobe-spectrum-release.dr.corp.adobe.com/backstopjs-spectrum:$PV",
"build-playwright-docker": "PV=$(node -p -e \"require('./package.json').version\"); docker build -f ./artifactory-docker/Playwright_Dockerfile --build-arg BACKSTOPJS_VERSION=$PV -t docker-adobe-spectrum-release.dr.corp.adobe.com/backstopjs-spectrum-playwright:$PV .",
"push-playwright-docker": "PV=$(node -p -e \"require('./package.json').version\"); docker push docker-adobe-spectrum-release.dr.corp.adobe.com/backstopjs-spectrum-playwright:$PV"
"build-push-docker": "PV=$(node -p -e \"require('./package.json').version\"); docker buildx build -f ./artifactory-docker/Dockerfile --platform linux/arm64,linux/amd64 --build-arg BACKSTOPJS_VERSION=$PV --push -t docker-adobe-spectrum-release.dr.corp.adobe.com/backstopjs-spectrum:$PV .",
"build-push-playwright-docker": "PV=$(node -p -e \"require('./package.json').version\"); docker buildx build -f ./artifactory-docker/Playwright_Dockerfile --platform linux/arm64,linux/amd64 --build-arg BACKSTOPJS_VERSION=$PV --push -t docker-adobe-spectrum-release.dr.corp.adobe.com/backstopjs-spectrum-playwright:$PV ."
},
"lint-staged": {
"compare/src/**/*.js": [
Expand Down

0 comments on commit b3517a8

Please sign in to comment.