simple image to run aspnetcore applications with remote debugging enabled
186
FROM microsoft/dotnet:aspnetcore-runtime
RUN apt-get update \
&& apt-get install -y --no-install-recommends unzip \
&& apt-get install -y procps \
&& rm -rf /var/lib/apt/lists/* \
&& curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l /vsdbg
Based on the runtime only image, need other stage to build dotnet. Debug works only if dotnet is built/published with Debug configuration. ( See -c Debug )
FROM microsoft/dotnet:sdk AS build-env
WORKDIR /app
# Copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore
# Copy everything else and build
COPY . ./
RUN dotnet publish -c Debug -o out
# Build runtime image
FROM mcraa/dotnet-vsdbg
WORKDIR /app
COPY --from=build-env /app/out .
CMD dotnet app.dll
Content type
Image
Digest
Size
162.4 MB
Last updated
over 6 years ago
docker pull mcraa/dotnet-vsdbg:2.2