Access Denied Writing File



我试图写一个文件到docker卷,它在本地工作得很好,但是当我在vps上运行它时,我得到了这个

"An error occurred trying to start process '/usr/local/bin/wkhtmltoimage' with working directory '/app/'. Permission denied"

这是我的dockerfile

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["CVMaker.sln", "./"]
COPY ["CVMaker/CVMaker.csproj", "CVMaker/"]
COPY ["CVMaker.DAL/CVMaker.DAL.csproj", "CVMaker.DAL/"]
RUN dotnet restore "./CVMaker/CVMaker.csproj"
RUN dotnet restore "./CVMaker.DAL/CVMaker.DAL.csproj"
COPY . .
WORKDIR "/src/CVMaker"
RUN dotnet build "CVMaker.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "CVMaker.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "CVMaker.dll"]
这是我的docker运行命令
sudo docker run -d -p 8080:80 -v ~/compromaker:/usr/share/compromaker/html compromaker/compromaker:dev --rm --user root

从注释开始-不要忘记将wkhtmltoimage安装到容器中(如果需要,可能需要指定正确的路径)

相关内容

  • 没有找到相关文章

最新更新