title: Permission denied error when writing file on docker container
body: <p>I am getting a permission denied when trying to stream a pdf file to the browser. I have set the read, write and execute permissions for the temp folder in the DockerFile. Any pointers on what I be doing wrong? 
  I am hosting the ASP.Net Core application as a Azure App service and docker Linux container, if that matters. </p>
  
  <p><strong>StackTrace:</strong></p>
  
  <pre><code>Exception occured: Syncfusion.Pdf.PdfException: /usr/bin/xvfb-run: 183: /usr/bin/xvfb-run: /app/QtBinariesLinux/Syncfusion.WebKitWrapper: Permission denied    
     at Syncfusion.HtmlConverter.HtmlConverter.ConvertHtmlToPdf(String url, Int32 width, Int32 height)
  </code></pre>
  
  <p><strong>Dockerfile:</strong></p>
  
  <pre><code>FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim AS base
  RUN chmod a+rwx -R /usr/bin/xvfb-run
  WORKDIR /app
  EXPOSE 80
  EXPOSE 443
  
  FROM mcr.microsoft.com/dotnet/core/sdk:2.2-stretch AS build
  WORKDIR /src
  COPY ["Scrubber/Scrubber.csproj", "Scrubber/"]
  COPY ["SimplerProducts.MicrosoftEntityFrameworkCoreStorage/SimplerProducts.MicrosoftEntityFrameworkCoreStorage.csproj", "SimplerProducts.MicrosoftEntityFrameworkCoreStorage/"]
  RUN dotnet restore "Scrubber/Scrubber.csproj"
  COPY . .
  WORKDIR "/src/Scrubber"
  RUN dotnet build "Scrubber.csproj" -c Release -o /app
  
  FROM build AS publish
  RUN dotnet publish "Scrubber.csproj" -c Release -o /app
  
  FROM base AS final
  WORKDIR /app
  COPY --from=publish /app .
  ENTRYPOINT ["dotnet", "Scrubber.dll"]
  </code></pre>
  
  <p><strong>CSharp code:</strong></p>
  
  <pre><code>public IActionResult OnPostExportToPDFAsync()
      {
        var htmlToPdfConverter = new HtmlToPdfConverter
        {
          ConverterSettings = new WebKitConverterSettings
          {
            WebKitPath = Path.Combine(HostingEnvironment.ContentRootPath, "QtBinariesLinux"),
            TempPath = Path.GetTempPath(),
            SplitTextLines = false,
            SplitImages = false,
            EnableRepeatTableHeader = true,
            EnableRepeatTableFooter = true,
      }
        };
        var pdfDocument = htmlToPdfConverter.Convert("http://www.google.com");
        var memoryStream = new MemoryStream();
        pdfDocument.Save(memoryStream);
        return File(memoryStream.ToArray(), System.Net.Mime.MediaTypeNames.Application.Pdf, "Sample.pdf");
      }
  </code></pre>