Не могу запустить Chrome в Docker Linux-контейнере - PullRequest
0 голосов
/ 30 ноября 2018

У меня есть основное приложение asp.net, которое использует пакеты nuget jsreport для запуска отчетов.Я пытаюсь развернуть его с помощью док-контейнера Linux.У меня возникают проблемы с запуском Chrome при запуске отчета.Я получаю сообщение об ошибке:

Failed to launch chrome!  Running as root without --no-sandbox is not supported.

Я выполнил указания на локальной странице отчетов .net (https://jsreport.net/learn/dotnet-local) относительно докера, но все еще получаю сообщение об ошибке.

Вот мой полный файл докера:

#use the .net core 2.1 runtime default image
FROM microsoft/dotnet:2.1-aspnetcore-runtime

#set the working directory to the server
WORKDIR /server

#copy all contents in the current directory to the container server directory
COPY . /server

#install node
RUN apt-get update -yq \
    && apt-get install curl gnupg -yq \
    && curl -sL https://deb.nodesource.com/setup_8.x | bash \
    && apt-get install nodejs -yq

#install jsreport-cli
RUN npm install jsreport-cli -g

#install chrome for jsreport linux
RUN apt-get update && \   
    apt-get install -y gnupg  libgconf-2-4 wget && \
    wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
    sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \
    apt-get update && \
    apt-get install -y google-chrome-unstable --no-install-recommends

ENV chrome:launchOptions:executablePath google-chrome-unstable
ENV chrome:launchOptions:args --no-sandbox

#expose port 80
EXPOSE 80

CMD dotnet Server.dll

Есть еще один шаг, который мне где-то не хватает?

...