Exception when downloading chrome in docker
See original GitHub issueHi,
I am trying to run puppeteer sharp in docker (I know it is not fully supported but I found some posts where people made it work) but every time I try to download the browser I get the following exception:
Exception when downloading the browser: System.DllNotFoundException: Unable to load shared library 'MonoPosixHelper' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libMonoPosixHelper: cannot open shared object file: No such file or directory
at PuppeteerSharp.Helpers.Linux.LinuxSysCall.FromFilePermissions(FilePermissions value, UInt32& rval)
at PuppeteerSharp.BrowserFetcher.DownloadAsync(Int32 revision)
at ADM.Jobs.Program.Main(String[] args) in /usr/src/jobs/Program.cs:line 18
This is probably not an issue in PuppeteerSharp, but I was wondering if someone had the same issue and knows how to solve it.
This is the code I am using
try
{
await new BrowserFetcher().DownloadAsync(BrowserFetcher.DefaultRevision);
}
catch (Exception e)
{
Console.WriteLine($"Exception when downloading the browser: {e}");
throw;
}
Console.WriteLine("Browser downloaded!");
and this is the docker file:
FROM microsoft/dotnet:latest
WORKDIR /usr/src
COPY . ./
RUN dotnet build
RUN dotnet publish -o app
ENTRYPOINT ["dotnet", "app/Test.dll"]
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
How to install Google chrome in a docker container
There are actually two ways to install Chrome on a docker container: If you download the deb file manually, you can install it...
Read more >Chrome Installation could not be found in docker image ...
Chrome does not seem to be installed even though there are no error messages when running on docker build or it is possible...
Read more >selenium/standalone-chrome-debug can't download files
One of the test should download a few files, store it in the specified volume folder and then check if that file exist...
Read more >[Code example]-Chrome download failed in Selenium docker
I'm trying to download a file with Selenium running on docker and getting the error Failed - insufficient permissions as can be seen...
Read more >Selenium webdriver, chromedriver and chrome with docker ...
I have the following error after configuring a custom docker image for my spider selenium.common.exceptions.WebDriverException: Message: unknown error: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Resolved by https://github.com/kblok/puppeteer-sharp/issues/1035
As for the docker part, you’ll need something like this:
And add your docker stuff after
I don’t think it’s something Puppeteer-Sharp should do. We could create a Docker image with this setting.