Skip to content

Commit b5ff463

Browse files
committed
cherry-pick(#23213): devops: do not use NPX during docker container build
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.
1 parent 4417a97 commit b5ff463

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

utils/docker/Dockerfile.focal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ RUN mkdir /ms-playwright && \
3737
mkdir /ms-playwright-agent && \
3838
cd /ms-playwright-agent && npm init -y && \
3939
npm i /tmp/playwright-core.tar.gz && \
40-
npx playwright-core mark-docker-image "${DOCKER_IMAGE_NAME_TEMPLATE}" && \
41-
npx playwright-core install --with-deps && rm -rf /var/lib/apt/lists/* && \
40+
npm exec --no -- playwright-core mark-docker-image "${DOCKER_IMAGE_NAME_TEMPLATE}" && \
41+
npm exec --no -- playwright-core install --with-deps && rm -rf /var/lib/apt/lists/* && \
4242
rm /tmp/playwright-core.tar.gz && \
4343
chmod -R 777 /ms-playwright

utils/docker/Dockerfile.jammy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ RUN mkdir /ms-playwright && \
3535
mkdir /ms-playwright-agent && \
3636
cd /ms-playwright-agent && npm init -y && \
3737
npm i /tmp/playwright-core.tar.gz && \
38-
npx playwright-core mark-docker-image "${DOCKER_IMAGE_NAME_TEMPLATE}" && \
39-
npx playwright-core install --with-deps && rm -rf /var/lib/apt/lists/* && \
38+
npm exec --no -- playwright-core mark-docker-image "${DOCKER_IMAGE_NAME_TEMPLATE}" && \
39+
npm exec --no -- playwright-core install --with-deps && rm -rf /var/lib/apt/lists/* && \
4040
rm /tmp/playwright-core.tar.gz && \
4141
rm -rf /ms-playwright-agent && \
4242
chmod -R 777 /ms-playwright

0 commit comments

Comments
 (0)