From 386c139d4491b016d35c7ed5b886247bf6f08b24 Mon Sep 17 00:00:00 2001 From: Dan Grebb Date: Thu, 26 Oct 2023 22:09:02 -0400 Subject: [PATCH] feat(updates-Dockerfile-to-node:20-bullseye-(#34)): adds `docker-load` script for local image testing (#34) --- docker/Dockerfile | 6 ++++-- package.json | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 2bb554031..d4e57190a 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,5 +1,5 @@ # use bullseye node base, as debian does provide a chromium for arm64 and amd64 flavour -FROM node:16-bullseye +FROM node:20-bullseye ARG BACKSTOPJS_VERSION ARG DEBIAN_FRONTEND=noninteractive @@ -26,7 +26,9 @@ chromium >/dev/null && apt-get -qq clean >/dev/null && rm -rf /var/lib/apt/lists ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true # playwright shared browser path (does install a 2nd chromium - can't be skipped) ENV PLAYWRIGHT_BROWSERS_PATH=/opt/pw-browsers -RUN mkdir ${PLAYWRIGHT_BROWSERS_PATH} && npm install -g --unsafe-perm=true --allow-root backstopjs@${BACKSTOPJS_VERSION} +RUN mkdir ${PLAYWRIGHT_BROWSERS_PATH} && npm install -g --unsafe-perm=true --allow-root dgrebb/backstopjs#feature/34-node-20 && npx playwright install +# TODO: replace above backsstop package source with below +# backstopjs@${BACKSTOPJS_VERSION} # set executable path ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium diff --git a/package.json b/package.json index 31fd715c2..751b36d7d 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "stop": "cd test/configs/ && node ../../cli/index.js stop", "publish-npm": "npm publish", "build-docker": "PV=$(node -p -e \"require('./package.json').version\"); echo $PV; docker buildx build --platform linux/amd64,linux/arm64 -t backstopjs/backstopjs:$PV --build-arg BACKSTOPJS_VERSION=$PV docker; docker buildx build --platform linux/amd64,linux/arm64 -t backstopjs/backstopjs:latest --build-arg BACKSTOPJS_VERSION=$PV docker", + "docker-load": "PV=$(node -p -e \"require('./package.json').version\"); echo $PV; docker buildx build --load -t backstopjs/backstopjs:$PV docker", "publish-docker": "PV=$(node -p -e \"require('./package.json').version\"); docker buildx build --push --platform linux/amd64,linux/arm64 -t backstopjs/backstopjs:$PV --build-arg BACKSTOPJS_VERSION=$PV docker; docker buildx build --push --platform linux/amd64,linux/arm64 -t backstopjs/backstopjs:latest --build-arg BACKSTOPJS_VERSION=$PV docker", "build-and-publish": "npm run publish-npm && npm run build-docker && npm run publish-docker", "init-docker-builder": "docker buildx create --name backstopbuilder --use --bootstrap"