Hi!
I am unable to install dotnet tools in Docker.
I am using docker image
mcr.microsoft.com/dotnet/core/runtime:3.0-buster-slim
There is no SDK so we need to install it.
docker exec -it my_container /bin/bash
apt update
apt install gnupg
apt install wget
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg
sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/
wget -q https://packages.microsoft.com/config/debian/10/prod.list
sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
sudo chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg
sudo chown root:root /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-3.0
Now I can finally install dotnet-dump to dump problematic process. But I get following error:
root@7b401dc43c94:/dotnetcore# dotnet tool install -g dotnet-dump
System.ComponentModel.Win32Exception (0x80004005): The FileName property should not be a directory unless UseShellExecute is set.
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at Microsoft.DotNet.Cli.Utils.Command.Execute()
at Microsoft.DotNet.Tools.Tool.Install.ProjectRestorer.Restore(FilePath project, PackageLocation packageLocation, String verbosity)
at Microsoft.DotNet.ToolPackage.ToolPackageInstaller.<>c__DisplayClass5_0.<InstallPackage>b__0()
at Microsoft.DotNet.Cli.TransactionalAction.Run[T](Func`1 action, Action commit, Action rollback)
at Microsoft.DotNet.ToolPackage.ToolPackageInstaller.InstallPackage(PackageLocation packageLocation, PackageId packageId, VersionRange versionRange, String targetFramework, String verbosity)
at Microsoft.DotNet.Tools.Tool.Install.ToolInstallGlobalOrToolPathCommand.Execute()
at Microsoft.DotNet.Tools.Tool.Install.ToolInstallCommand.Execute()
at Microsoft.DotNet.Cli.DotNetTopLevelCommandBase.RunCommand(String[] args)
at Microsoft.DotNet.Tools.Tool.ToolCommand.Run(String[] args)
at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient)
at Microsoft.DotNet.Cli.Program.Main(String[] args)
Any advice?
We're actively looking at mechanisms for reliably installing these tools without the SDK requirement, so keep an eye out for that.
That exception smells like https://github.com/dotnet/corefx/issues/40850 (more links: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1843018, https://github.com/moby/moby/issues/39875).
Thank you, upgrading ubuntu kernel worked. Thank you
Most helpful comment
We're actively looking at mechanisms for reliably installing these tools without the SDK requirement, so keep an eye out for that.
That exception smells like https://github.com/dotnet/corefx/issues/40850 (more links: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1843018, https://github.com/moby/moby/issues/39875).