Skip to content

Commit

Permalink
devops(docker): fix registry to be accessible by Azure Pipelines user (
Browse files Browse the repository at this point in the history
…#5672)

Turns out Azure Pipelines is doing a few modifications to the base
container. One of the important modification is that they add a new
user to the container that has a passwordless sudo permissions. This
user is used later on to run all the pipeline steps.

This patch makes sure our shared registry inside the docker containers
is accessible to all the users.

Fixes #5635
  • Loading branch information
aslushnikov authored Mar 2, 2021
1 parent f2a3d21 commit f637b03
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
12 changes: 7 additions & 5 deletions utils/docker/Dockerfile.bionic
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,17 @@ RUN apt-get update && apt-get install -y python3.8 python3-pip && \

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.
# The package should be built beforehand from tip-of-tree Playwright.
COPY ./playwright.tar.gz /tmp/playwright.tar.gz

# 2. Install playwright and then delete the installation.
# Browsers will remain downloaded in `/ms-playwright`.
RUN su pwuser -c "mkdir /tmp/pw && cd /tmp/pw && npm init -y && \
npm i /tmp/playwright.tar.gz" && \
rm -rf /tmp/pw && rm /tmp/playwright.tar.gz
# Note: make sure to set 777 to the registry so that any user can access
# registry.
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

12 changes: 7 additions & 5 deletions utils/docker/Dockerfile.focal
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,17 @@ RUN apt-get update && apt-get install -y python3.8 python3-pip && \

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.
# The package should be built beforehand from tip-of-tree Playwright.
COPY ./playwright.tar.gz /tmp/playwright.tar.gz

# 2. Install playwright and then delete the installation.
# Browsers will remain downloaded in `/ms-playwright`.
RUN su pwuser -c "mkdir /tmp/pw && cd /tmp/pw && npm init -y && \
npm i /tmp/playwright.tar.gz" && \
rm -rf /tmp/pw && rm /tmp/playwright.tar.gz
# Note: make sure to set 777 to the registry so that any user can access
# registry.
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

0 comments on commit f637b03

Please sign in to comment.