Skip to content

Commit

Permalink
feat(updates-Dockerfile-to-node:20-bullseye-(#34)): adds `docker-load…
Browse files Browse the repository at this point in the history
…` script for local image testing (#34)
  • Loading branch information
dgrebb committed Nov 22, 2023
1 parent 300ff3f commit 386c139
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 386c139

Please sign in to comment.