Azure / Azure/azure-functions-docker

Linux premium image does not have libraries needed to run headless Chrome

Open
#333 20 comments 1 reaction 0 assignees View on GitHub
Dominant language
Dockerfile
Stars
280
Forks
126
PR merge metrics
No merged PRs in 30d

Description

Running [PuppeteerSharp](https://www.puppeteersharp.com/) on an Azure Functions Linux premium plan reports the error below, however it works fine on a Linux consumption plan. Would it be possible to get the libraries required to run headless Chrome, like libX11, added to the Linux premium images?
```
/tmp/Linux-706915/chrome-linux/chrome: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory
```

These are the App Service plans I tested:

### Doesn't work (Premium)
```
const appServicePlan = new appservice.Plan(appServicePlanName, {
reserved: true,
kind: "elastic",
sku: { tier: "ElasticPremium", size: "EP1" },
});
```

### Works fine (Consumption)
```
const appServicePlan = new appservice.Plan(appServicePlanName, {
reserved: true,
kind: "FunctionApp",
sku: { tier: "Dynamic", size: "Y1" },
});
```

Here's the C# .NET Core 3.1 application code running in my Azure Function:

```
var browserFetcherOptions = new BrowserFetcherOptions { Path = Path.GetTempPath() };
var browserFetcher = await new BrowserFetcher(browserFetcherOptions).DownloadAsync(BrowserFetcher.DefaultRevision);
var browser = await Puppeteer.LaunchAsync(new LaunchOptions
{
Headless = true,
ExecutablePath = browserFetcher.ExecutablePath
});
using var page = await browser.NewPageAsync();
await page.GoToAsync(baseUrl);
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.