Setting up docker with Hyper-V

Docker is just amazing with flexibility we get to not worry about setting up the environments for our application.


--Photo by Ilse Orsel on Unsplash

Download docker for windows.

So with Windows we can use hyper-V and get containers spawned in minutes.

Here is how we do it.

Make sure you have Hyper-V enabled on windows if not go to turn on windows feature and turn this feature On. Once this is done with restart.

Use Hyper-V Manager for Windows to create a Virtual Switch



Now use the following commands to create the docker containers

docker-machine create -d hyperv --hyperv-virtual-switch "Primary Virtual Switch" default

this will create a VM, you can see this with Hyper-V manager or

docker-machine ls

once the machine is created you need to set some of the machine details in Environments Variables

to list the variables use

docker-machine env default

Now set the env vairables as below using bash

eval $("C:\Users\arjun_shetty\bin\docker-machine.exe" env default --shell bash)

No go ahead an use an existing docker images to test

docker run -it hello-world
docker run -it supertest2014/nyan


** CTRL + C is come out of it


Comments

Popular posts from this blog

Launch .Net Core with VSCode for starters

How to Run two .net core apps with debugging On using Visual Studio Code ?

Protecting sensitive data using Secret Manager in .Net Core