My issue arises when running my code on a Linux system within a Docker container. The code, which downloads and launches Puppeteer, works flawlessly on my Windows machine. Here's the relevant snippet:
var browserFetcher = new BrowserFetcher();
var installedBrowser = await browserFetcher.DownloadAsync(BrowserTag.Latest);
var browser = await Puppeteer.LaunchAsync(new LaunchOptions
{
Headless = true,
ExecutablePath = browserFetcher.GetExecutablePath(installedBrowser.BuildId)
});
I specifically utilize GetExecutablePath(installedBrowser.BuildId) to avoid hardcoding directories. However, upon building and running the Docker container with an Alpine Linux image, I encounter the following error:
Error: An error occurred trying to start process '/app/Chrome/Linux-124.0.6335.0/chrome-linux64/chrome' with working directory '/app'. No such file or directory
Upon inspecting the container using /bin/sh, I find the necessary files exist:

I'm perplexed by this issue. If further information is required, please let me know. Thank you.
DockerfileThe long list of dependencies in the third build stage is to support the browser runtime.
Program.csThe example
Program.cswill run and then exit. When it exits the container will terminate.You can, however, get a more persistent container by commenting out the
CMDline in theDockerfile. Then just run it manually.