Skip to content

Commit

Permalink
cherry-pick(#23213): devops: do not use NPX during docker container b…
Browse files Browse the repository at this point in the history
…uild

The postmortem of the broken docker image:
- We use `playwright-core` package when bootstrapping our docker
container.
- Due to accidental removal of `bin` entry in the `playwright-core` (see
  #23206), the `npx
  playwright install --with-deps` was using the last published
  Playwright version instead of a locally-built playwright binary

This patch starts using `npx exec --no` to make sure that we never call
remote commands during docker image build.
  • Loading branch information
aslushnikov committed May 24, 2023
1 parent 4417a97 commit b5ff463
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions utils/docker/Dockerfile.focal
Expand Up @@ -37,7 +37,7 @@ RUN mkdir /ms-playwright && \
mkdir /ms-playwright-agent && \
cd /ms-playwright-agent && npm init -y && \
npm i /tmp/playwright-core.tar.gz && \
npx playwright-core mark-docker-image "${DOCKER_IMAGE_NAME_TEMPLATE}" && \
npx playwright-core install --with-deps && rm -rf /var/lib/apt/lists/* && \
npm exec --no -- playwright-core mark-docker-image "${DOCKER_IMAGE_NAME_TEMPLATE}" && \
npm exec --no -- playwright-core install --with-deps && rm -rf /var/lib/apt/lists/* && \
rm /tmp/playwright-core.tar.gz && \
chmod -R 777 /ms-playwright
4 changes: 2 additions & 2 deletions utils/docker/Dockerfile.jammy
Expand Up @@ -35,8 +35,8 @@ RUN mkdir /ms-playwright && \
mkdir /ms-playwright-agent && \
cd /ms-playwright-agent && npm init -y && \
npm i /tmp/playwright-core.tar.gz && \
npx playwright-core mark-docker-image "${DOCKER_IMAGE_NAME_TEMPLATE}" && \
npx playwright-core install --with-deps && rm -rf /var/lib/apt/lists/* && \
npm exec --no -- playwright-core mark-docker-image "${DOCKER_IMAGE_NAME_TEMPLATE}" && \
npm exec --no -- playwright-core install --with-deps && rm -rf /var/lib/apt/lists/* && \
rm /tmp/playwright-core.tar.gz && \
rm -rf /ms-playwright-agent && \
chmod -R 777 /ms-playwright

0 comments on commit b5ff463

Please sign in to comment.