cherry-pick(release-1.9): fix registry to be accessible by Azure Pipelines user (#5672)

This cherry-picks f637b0302d

References #5635
This commit is contained in:
Andrey Lushnikov 2021-03-01 17:24:07 -08:00 committed by Andrey Lushnikov
parent f41d000cc6
commit 92132d2ea0
2 changed files with 14 additions and 10 deletions

View file

@ -79,15 +79,17 @@ RUN apt-get update && apt-get install -y python3.8 python3-pip && \
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
RUN mkdir /ms-playwright && chmod 777 /ms-playwright
# 1. Add tip-of-tree Playwright package to install its browsers. # 1. Add tip-of-tree Playwright package to install its browsers.
# The package should be built beforehand from tip-of-tree Playwright. # The package should be built beforehand from tip-of-tree Playwright.
COPY ./playwright.tar.gz /tmp/playwright.tar.gz COPY ./playwright.tar.gz /tmp/playwright.tar.gz
# 2. Install playwright and then delete the installation. # 2. Install playwright and then delete the installation.
# Browsers will remain downloaded in `/ms-playwright`. # Browsers will remain downloaded in `/ms-playwright`.
RUN su pwuser -c "mkdir /tmp/pw && cd /tmp/pw && npm init -y && \ # Note: make sure to set 777 to the registry so that any user can access
npm i /tmp/playwright.tar.gz" && \ # registry.
rm -rf /tmp/pw && rm /tmp/playwright.tar.gz RUN mdkir /ms-playwright && \
mkdir /tmp/pw && cd /tmp/pw && npm init -y && \
npm i /tmp/playwright.tar.gz && \
rm -rf /tmp/pw && rm /tmp/playwright.tar.gz && \
chmod -R 777 /ms-playwright

View file

@ -78,15 +78,17 @@ RUN apt-get update && apt-get install -y python3.8 python3-pip && \
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
RUN mkdir /ms-playwright && chmod 777 /ms-playwright
# 1. Add tip-of-tree Playwright package to install its browsers. # 1. Add tip-of-tree Playwright package to install its browsers.
# The package should be built beforehand from tip-of-tree Playwright. # The package should be built beforehand from tip-of-tree Playwright.
COPY ./playwright.tar.gz /tmp/playwright.tar.gz COPY ./playwright.tar.gz /tmp/playwright.tar.gz
# 2. Install playwright and then delete the installation. # 2. Install playwright and then delete the installation.
# Browsers will remain downloaded in `/ms-playwright`. # Browsers will remain downloaded in `/ms-playwright`.
RUN su pwuser -c "mkdir /tmp/pw && cd /tmp/pw && npm init -y && \ # Note: make sure to set 777 to the registry so that any user can access
npm i /tmp/playwright.tar.gz" && \ # registry.
rm -rf /tmp/pw && rm /tmp/playwright.tar.gz RUN mdkir /ms-playwright && \
mkdir /tmp/pw && cd /tmp/pw && npm init -y && \
npm i /tmp/playwright.tar.gz && \
rm -rf /tmp/pw && rm /tmp/playwright.tar.gz && \
chmod -R 777 /ms-playwright