DockerFile with dotnet/sdk/5 says no cmd executable in $PATH whereas with /dotnet/framework/sdk:4.8 , it works fine
Our dockerfile has .net framework 4.8 (mcr.microsoft.com/dotnet/framework/sdk:4.8) and also installs VS build tools.
This works fine.
Current requirement is to upgrade to use .net 5.0 SDK instead of 4.8 dotnet/sdk:5.0
DockerFile is as below:
#FROM mcr.microsoft.com/dotnet/framework/sdk:4.8
FROM mcr.microsoft.com/dotnet/sdk:5.0
# Restore the default Windows shell for correct batch processing.
SHELL ["cmd", "/S", "/C"]
# Download the Visual Studio Build Tools bootstrapper.
ADD https://aka.ms/vs/16/release/vs_buildtools.exe C:\Temp\vs_buildtools.exe
# Use the latest release channel.
ADD https://aka.ms/vs/16/release/channel C:\Temp\VisualStudio.chman
# Set up environment to collect install errors.
COPY Install.cmd C:\Temp\
ADD https://aka.ms/vscollect.exe C:\Temp\collect.exe
# Modify MSVC C++ compiler, CMake, and MSBuild.
RUN c:\Temp\Install.cmd C:\Temp\vs_buildtools.exe modify `
--quiet --wait --norestart --nocache `
--installPath "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools" `
--channelUri C:\Temp\VisualStudio.chman `
--installChannelUri C:\Temp\VisualStudio.chman `
--add Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools;includeRecommended `
--add Microsoft.VisualStudio.Workload.VCTools;includeRecommended `
--add Microsoft.Component.MSBuild `
--add Microsoft.VisualStudio.Component.VC.ATLMFC
# Start developer command prompt with any other commands specified.
WORKDIR /src
ENTRYPOINT ["powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]
Error I am getting is
container_linux.go:380: starting container process caused: exec: "cmd": executable file not found in $PATH
My Docker desktop uses WSL2 and Linux distribution installed is Ubuntu 20.04 LTS