From b5ff4637791ff9fb191a33e0419e072327148847 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Tue, 23 May 2023 02:21:09 +0000 Subject: [PATCH] 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 https://github.com/microsoft/playwright/issues/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. --- utils/docker/Dockerfile.focal | 4 ++-- utils/docker/Dockerfile.jammy | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/docker/Dockerfile.focal b/utils/docker/Dockerfile.focal index cdc8dd5bde..2ba495eb38 100644 --- a/utils/docker/Dockerfile.focal +++ b/utils/docker/Dockerfile.focal @@ -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 diff --git a/utils/docker/Dockerfile.jammy b/utils/docker/Dockerfile.jammy index c088142b3e..c6224b6773 100644 --- a/utils/docker/Dockerfile.jammy +++ b/utils/docker/Dockerfile.jammy @@ -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