Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

729
Views
Cannot run PlayWright inside docker image

I`m trying to create .net 5.0 docker image with playwright. This is my DockerFile:

FROM mcr.microsoft.com/dotnet/runtime:5.0-buster-slim AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build
WORKDIR /src
COPY ["Agent.csproj", "Agent/"]
RUN dotnet restore "Agent/Agent.csproj"
COPY . "/src/Agent"
WORKDIR "/src/Agent"
RUN apt-get update -yq && apt-get upgrade -yq && apt-get install -yq curl git nano
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -yq nodejs build-essential
RUN npm install -g npm

RUN dotnet add package Microsoft.Playwright
RUN dotnet build "Agent.csproj" -c Release -o /app/build
RUN npx playwright install

But once I run inside my image command dotnet run Agent it gives me following error:

Executable doesn't exist at /root/.cache/ms-playwright/chromium-907428/chrome-linux/chrome
Please run the following command to download new browsers:              
║                                                                         
║     npx playwright install

Even though my dockerfile contains RUN npx playwright install seems like its not installing it. When I will remove it from my dockerfile and execute it manualy on running image it seems to be ok. Any ideas how I can execute properly playwright install using dockerfile?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

I think this is a known issue in Playwright. You can see the detailed discussion here, and particularly see this comment

The solution I've seen mostly working is to either delete the node_modules entirely and then re-install it again, or in case of a docker image, try the solution mentioned in this link, by setting the playwright browsers to a specific path

over 4 years ago · Santiago Trujillo Report

0

My problem was that I have installed different version of chromium vs playwright

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!