运行docker.exe时vsdbg的权限问题-exec:\"/app/vsdbg \:权限被拒绝 [英] permission issue on vsdbg while running docker.exe - exec: \"/app/vsdbg\: permission denied

查看:67
本文介绍了运行docker.exe时vsdbg的权限问题-exec:\"/app/vsdbg \:权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

My object is to debug the docker container using vsdbg , this container contains asp.net core api application. To do this, created docker image using docker file, and then run the container. And to start remote debugging , used below command:

docker exec -i  a05a0439540b  "/app/vsdbg"

然后收到以下错误消息:

then got below error message:

OCI runtime exec failed: exec failed: container_linux.go:344: starting    
container process caused "exec: \"/app/vsdbg\": permission denied": unknown 

请在下面找到docker文件的内容:

please find below docker file content:

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"]

但仍然面临相同的错误.

but still facing same error.

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

using below command to start docker image:

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

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

can you please help me out to resolve this problem.

推荐答案

我今天也遇到了同样的问题-错误消息有些令人困惑./vsdbg 目录没有执行权限;而不是"/app/vsdbg",您将启动.json需要读取:

I ran into this same issue today - the error message is a little confusing. There are no execute permissions on the /vsdbg directory; instead of "/app/vsdbg" you're launch.json needs to read:

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

这篇关于运行docker.exe时vsdbg的权限问题-exec:\"/app/vsdbg \:权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆