Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] azure - Executable doesn't exist at /ms-playwright/chromium-1097/chrome-linux/chrome #2886

Closed
Hubert409 opened this issue Mar 18, 2024 · 2 comments

Comments

@Hubert409
Copy link

Hubert409 commented Mar 18, 2024

Hi,
I want to use playwright with azure, locally everything works.
Application deployment is done using pipelines.
After running on Azure and running the function, I get the following message:

Executable doesn't exist at /ms-playwright/chromium-1097/chrome-linux/chrome Looks like Playwright was just installed or updated. Please run the following command to download new browsers: pwsh bin/Debug/netX/playwright.ps1 install

My docker:
`FROM mcr.microsoft.com/azure-functions/dotnet:4 AS base
WORKDIR /home/site/wwwroot
EXPOSE 80

RUN apt-get update -yq
&& apt-get install wget -yq
&& wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
&& dpkg -i packages-microsoft-prod.deb
&& apt-get update -yq
&& apt-get install powershell -yq

RUN apt-get update
&& apt-get install -y
build-essential
cmake
git
wget
unzip
unixodbc-dev
&& rm -rf /var/lib/apt/lists/*

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["src/Monitoring/Monitoring.csproj", "Monitoring/"]
COPY ["src/Monitoring/", "Monitoring/"]
RUN dotnet restore "Monitoring/Monitoring.csproj"
COPY . .
WORKDIR "/src/Monitoring"
RUN dotnet build "Monitoring.csproj" -c Release -o /app/build

WORKDIR "/app/build"

RUN pwsh ./playwright.ps1 install
RUN pwsh ./playwright.ps1 install chromium
RUN pwsh ./playwright.ps1 install-deps chromium

WORKDIR "/src/Monitoring"

FROM build AS publish
RUN dotnet publish "Monitoring.csproj" -c Release -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /home/site/wwwroot
COPY --from=publish /app/publish .
ENV AzureWebJobsScriptRoot=/home/site/wwwroot
AzureFunctionsJobHost__Logging__Console__IsEnabled=true`

Anyone had a similar problem?

@Hubert409 Hubert409 changed the title [Help ] Executable doesn't exist at /ms-playwright/chromium-1097/chrome-linux/chrome [Help] Executable doesn't exist at /ms-playwright/chromium-1097/chrome-linux/chrome Mar 18, 2024
@Hubert409 Hubert409 reopened this Mar 18, 2024
@Hubert409 Hubert409 changed the title [Help] Executable doesn't exist at /ms-playwright/chromium-1097/chrome-linux/chrome [Question] Executable doesn't exist at /ms-playwright/chromium-1097/chrome-linux/chrome Mar 18, 2024
@Hubert409 Hubert409 changed the title [Question] Executable doesn't exist at /ms-playwright/chromium-1097/chrome-linux/chrome [Question] azure - Executable doesn't exist at /ms-playwright/chromium-1097/chrome-linux/chrome Mar 18, 2024
@mxschmitt
Copy link
Member

Looks like you don't run the RUN pwsh ./playwright.ps1 install chromium command inside the final image.

@Hubert409
Copy link
Author

Thanks, everything works fine now

FROM base AS final
WORKDIR /home/site/wwwroot
COPY --from=publish /app/publish .

COPY --from=build /app/build/Microsoft.Playwright.dll .
COPY --from=build /app/build/playwright.ps1 .
RUN pwsh ./playwright.ps1 install
RUN pwsh ./playwright.ps1 install chromium
RUN pwsh ./playwright.ps1 install-deps chromium

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants