Docker exec: ipconfig failing

Viewed 1690

When following the tutorial for Docker and .NET Core Build and run the sample with Docker for Linux containers ran fine but Build and run the sample with Docker for Windows containers fails with a strange error.

cd aspnetapp
docker build -t aspnetapp .
docker run -it --rm --name aspnetcore_sample aspnetapp

Then in a second cmd/PS

docker ps
docker exec aspnetcore_sample ipconfig

OCI runtime exec failed: exec failed: container_linux.go:295: starting container process caused "exec: \"ipconfig\": executable file not found in $PATH": unknown

Searching comes up empty.

1 Answers

The solution became obvious after trying a docker project with Visual Studio 2017 and using the add docker support that VS17 has built in .

Building after adding docker support to a new .NET Core MVC project:

Done building project "docker-compose.dcproj" -- FAILED.

Volume sharing is not enabled. Enable volume sharing in the Docker CE for Windows Settings.

Right-click docker taskbar icon - settings, shared drives (select the drive with code in it)

Running again.

Your Docker server host is configured for 'Linux', however the docker-compose project targets 'Windows'. docker-compose C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Sdks\Microsoft.Docker.Sdk\build\Microsoft.VisualStudio.Docker.Compose.targets 165

Had to right-click docker taskbar, "Switch to Windows Containers", required an install or update and after a reboot selecting it again. Fixed.

Related