Skip to content

Instantly share code, notes, and snippets.

@sandcastle
Created October 21, 2019 12:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sandcastle/faa4e0bf1f8e8d5fc6506d1c5dbb1f45 to your computer and use it in GitHub Desktop.
Save sandcastle/faa4e0bf1f8e8d5fc6506d1c5dbb1f45 to your computer and use it in GitHub Desktop.
Install .Net 3.0 diagnostic tools in a docker container
# https://github.com/dotnet/diagnostics/issues/573#issuecomment-543886037
# dotnet tools are currently available as part of SDK so we need to create them in an sdk image
# and copy them to our final runtime image
FROM mcr.microsoft.com/dotnet/core/sdk:3.0 AS tools-install
RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-sos
RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-trace
RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-dump
RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-counters
FROM mcr.microsoft.com/dotnet/core/aspnet:3.0.0
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y \
file \
lldb \
&& rm -rf /var/lib/apt/lists/*
COPY --from=tools-install /dotnetcore-tools /opt/dotnetcore-tools
ENV PATH="/opt/dotnetcore-tools:${PATH}"
RUN dotnet-sos install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment