Installing ASP.NET Core Docker For Windows
Introduction
Here, in this post we are going to a see how we can install Asp.Net Core Docker in our Windows. Before we start, it would be useful if we say something about the Docker right? Docker is a container software platform where container is everything we need to make our software run. The container is light in weight. You can read more about the Docker here. Hope you will like this. Now let’s begin.
Background
Was just trying to create an ASP.NET Docker application in Visual Studio 2017. Unfortunately was getting an error.
Error MSB4018 The “PrepareForBuild” task failed unexpectedly. Microsoft.DotNet.Docker.CommandLineClientException: Unable to run ‘docker-compose’. Verify that Docker for Windows is installed and running locally. For troubleshooting, please review http://aka.ms/DockerToolsTroubleshooting. —> System.ComponentModel.Win32Exception: The system cannot find the file specified
Then came to know that have not installed Docker on the machine yet, so decided to do that.
http://sibeeshpassion.com/wp-content/uploads/2017/05/Asp-Net-Core-Docker-Error-768x436.png
Asp Net Core Docker Error
Installing Docker For Windows
You can install the Docker from here. Once you download the set up file, please run the file.
http://sibeeshpassion.com/wp-content/uploads/2017/05/Docker-For-Windows.png
Docker For Windows
Start and test the Docker
Once you installed the Docker, now it is time to test whether everything is installed correctly or not. Before that make sure that the Docker is starting.
http://sibeeshpassion.com/wp-content/uploads/2017/05/Docker-is-Starting.png
Docker is Starting
There is a high possibility that to get an error “Hardware assisted virtualization and data execution protection must be enabled in the BIOS” as preceding image.
http://sibeeshpassion.com/wp-content/uploads/2017/05/Docker-Error-768x282.png
Docker Error
Before you go and change the settings in BIOS, check in Task Manager window as well.
http://sibeeshpassion.com/wp-content/uploads/2017/05/Hyper-V-support-and-Virtulization-674x600.png
Hyper V support and Virtualization
Enabling Virtualization in BIOS
To Enable the Virtualization in BIOS, go to System Configuration -> Click Virtualization Technology and enable it.
http://sibeeshpassion.com/wp-content/uploads/2017/05/BIOS-Settings-768x430.jpeg
BIOS Settings
After the restart, the Docker will ask you to start the service. Go ahead and do that.
Setting up Docker http://sibeeshpassion.com/wp-content/uploads/2017/05/Docker-Service-Is-Not-Runnig-Window-768x282.png
Docker Service Is Not Runnig Window
Now again, if you are getting an error as “Error MSB4018 The “PrepareForLaunch” task failed unexpectedly.
Microsoft.DotNet.Docker.CommandLineClientException: Creating network “dockercompose3875147227_default” with the default driver
Building linq_basic_to_advanced Service ‘linq_basic_to_advanced’ failed to build: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).”, you need to change your shared drive settings in Docker.
Right-click and click the Settings.
http://sibeeshpassion.com/wp-content/uploads/2017/05/Docker-Settings.png
Docker Settings
Click the Shared Drives and select the drive that hosts your project and the drive where %USERPROFILE% resides.
http://sibeeshpassion.com/wp-content/uploads/2017/05/Shared-Drive-in-Docker-768x500.png
Shared Drive in Docker
Click Apply and type your filesystem passwor in the following pop up. Now if you are running the Edge version of Docker Community Edition for Windows, after the install you may be able to login with your Docker ID and password.
http://sibeeshpassion.com/wp-content/uploads/2017/05/Docker-SignIn-page.png
Docker SignIn page
We have enough settings for now, shall we just check whether the installation is done perfectly or not? To check, go to the command window and type the command as docker run hello-world.
http://sibeeshpassion.com/wp-content/uploads/2017/05/Docker-Check-From-Command-Window.png
Docker Check From Command Window
You can also check the Docker version with the command docker –version
Conclusion
Miss anything that you may think which is needed?Find this post as useful? Hope you liked this article. Please share your valuable suggestions and feedback.