C# 运行docker.exe时vsdbg上的权限问题-exec:\"/应用程序/vsdbg \:权限被拒绝

C# 运行docker.exe时vsdbg上的权限问题-exec:\"/应用程序/vsdbg \:权限被拒绝,c#,docker,asp.net-core,dockerfile,C#,Docker,Asp.net Core,Dockerfile,我的目标是使用vsdbg调试docker容器,该容器包含asp.net核心api应用程序。 为此,请使用docker文件创建docker映像,然后运行容器。 要启动远程调试,请使用以下命令: docker exec -i a05a0439540b "/app/vsdbg" 然后得到以下错误消息: OCI runtime exec failed: exec failed: container_linux.go:344: starting container process cause

我的目标是使用vsdbg调试docker容器,该容器包含asp.net核心api应用程序。 为此,请使用docker文件创建docker映像,然后运行容器。 要启动远程调试,请使用以下命令:

docker exec -i  a05a0439540b  "/app/vsdbg"
然后得到以下错误消息:

OCI runtime exec failed: exec failed: container_linux.go:344: starting    
container process caused "exec: \"/app/vsdbg\": permission denied": unknown 
请查找以下docker文件内容:

FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim AS base
WORKDIR /app
EXPOSE 80
#EXPOSE 443

#RUN Invoke-WebRequest -OutFile c:\vs_remotetools.exe -Uri 

http://download.microsoft.com/download/1/2/2/1225c23d-3599-48c9-a314-f7d631f43241/vs_remotetools.exe;
#RUN & 'c:\rtools_setup_x64.exe' /install /quiet
#RUN  & 'c:\vs_remotetools.exe' /install /quiet

EXPOSE 4024
RUN apt-get update \
    && apt-get install -y --no-install-recommends \
    unzip \
    && curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l ./vsdbg \
    && rm -rf /var/lib/apt/lists/*

#RUN chmod 700 -R /app/vsdbg

RUN /bin/bash -c 'ls -la; chmod 777 /app/vsdbg; ls -la'

FROM mcr.microsoft.com/dotnet/core/sdk:2.2-stretch AS build
WORKDIR /src
COPY ["testDockerCore.csproj", ""]
RUN dotnet restore "testDockerCore.csproj"
COPY . .
WORKDIR "/src/"
RUN dotnet build "testDockerCore.csproj" -c Release -o /app

FROM build AS publish
RUN dotnet publish "testDockerCore.csproj" -c Release -o /app

FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "testDockerCore.dll"]
但仍然面临同样的错误

使用以下命令启动docker映像:

docker run -it -p 4200:4024 testdockercore:dev 

您能帮我解决这个问题吗。

我今天遇到了同样的问题-错误消息有点混乱。在/vsdbg目录上没有执行权限;您启动的不是“/app/vsdbg”。json需要阅读:

"debuggerPath": "/app/vsdbg/vsdbg",

我今天遇到了同样的问题——错误消息有点让人困惑。在/vsdbg目录上没有执行权限;您启动的不是“/app/vsdbg”。json需要阅读:

"debuggerPath": "/app/vsdbg/vsdbg",

运行相同的问题
chmod 777-R/root/vsdbg/vsdbg

对我来说,vsdbg位于根文件夹下,运行的chmod 777-R/root/vsdbg/vsdbg

对我来说,vsdbg位于根文件夹下