How to install Docker Engine on Windows 10 WSL 2 + Install Pi-Hole DNS Ad Blocker container

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to a new video from elastic course in this video i will show you how to install docker engine on the windows platform and then install the pi hole add blocker container on the windows docker environment let's get started now with windows 10 newer update 2004 or above your system will support windows subsystem for linux version 2 which allows docker to run more efficiently and more natively on the windows platform because it allows the windows to have a full linux kernel inside of it so it makes the container operation more smooth and more comparable to the linux environment the only problem with this is that the docker engine relies on high bar v in the back end to be able to run containers therefore if you install hybrv services on your windows 10 platform you will no longer be able to use vmware workstation in the same time because they don't work well together therefore hyper v services blocks vmware workstation environment so you have to keep that in mind if you want to install docker for windows you have to sacrifice vmware products now to verify your system support the latest version all you need to do is to go from your settings menu and under system there will be about section and in the about section you will see your version in here you have to be version 2004 or above if you are not you can simply go and download the update using the windows update once this is done we just need to follow the script similar like we did with the linux in the previous video and we're going to be looking into the windows platform instruction to enable windows subsystem for linux or wsl 2 using powershell we're going to copy the first command which basically enables the windows subsystem for linux now from the bar shell we're going to enable the first feature and with that completed we can now enable the second feature which allows us to run virtual machines in the windows platform because with windows subsystem for linux you won't just be able to run docker services but you can also download any linux operating system from the microsoft store which allow you to run a virtual machine on the windows platform and share the linux from the windows subsystem for linux which makes it run more natively and more smooth as well and that makes windows subsystem for linux version 2 is a good benefit for both sides now our second feature is enabled as well and now we just need to restart the computer for these changes to take effect now once the computer comes back up we just need to go into the powershell and just make the windows subsystem for linux default version to 2 so that we can use the newer version instead of the first version for the first time you run this you might get a message that says you need to update the kernel you just need to open this link and download the linux kernel update package it will just be a small install file and once the setup for this tool has been completed we're just gonna click finish now when we do that command one more time it did accept because it showed us information about the difference between the two versions now we can just go to the docker website and click get started and this time we're gonna download the windows installer now once you open the docker installer it will show you the windows subsystem for linux version 2 enabling we already did that but we can click ok now the docker desktop installer has finished now we just need to log out one time now this is the docker notification that it's running now once i open the application now we see docker is running and this is the symbol gui for the docker application on windows and it allows you to have symbol management over your containers unlike the linux edition which doesn't have a gui but this is very useful for new users as well because it makes it easier to look into the containers that are built and manage them from the screen now similar to what we did with the linux we have a docker run command that allows us to start up a container using the pi hole as the name and uses the pi hole latest image from the docker hub all these parameters are similar to the script we ran in the linux environment with just the server ip the web password since we are not generating the password in here we also have the dns settings configured for the localhost and upstream going to the public internet using the cloudflare public dns with the default settings the getting board 80 inside the container and inside your host machine and also the secondary script using the custom board uses port 8080 going into board 80 inside the container and this also allows the board 53 for dns queries now let's start first with the default setup and we're just going to copy the script for the default boards and using the windows powershell i'm going to run this script but before i click enter i need to make sure i change my server id to my current ib address on this machine using the ib config slash all command i'm able to find ib address of my machine here this is 10.10.125. this will be my server ipa i need to make sure i change that in the parameters for starting the container so that it would come up with the correct ib address now everything else is all set i just need to hit enter and it's going to download the image for the first time from the github as we see it's pretty fast now this as you notice is going to ask you to open the windows firewall because we're going to be listening on the dns board and also the web board and therefore the docker application will ask for your permission to open these ports on your behalf in the windows firewall which is convenient if you try to open the gui magically now start seeing your running containers in a nice format in here and it also shows you which board is listening or at least one of them inside of here you can see the terminal output from the machine and you can also see nice statistics like the cpu usage or the memory usage as you see this is nothing comparable to a normal version machine and this is why docker containers are very lightweight and very fast to create now also from here you can get into the cli of the docker container directly or you can stop or restart this container or you can delete it with just one button click now if i try to delete this and since i already have the buy hole image downloaded locally to my machine right now and if we try to run the command docker run one more time to start up this container it will only take one second from now on to run this container because as you see it's very very fast once you have the image downloaded locally now we have a web service a dns service and the full system running in just a few seconds this is very powerful now we have our system ready and we should be able to access the server using the 127.0.0.1 address or directly using our server ipe which is the private ib address 10.10.125. i'm going to try this and this will show me the buy hold visitor screen with the 84 000 domains on the block list and all the queries that is still to zero because we haven't configured any client to use this system yet now let's log into the system from the login screen and the password will be the same password we entered when running the docker run command which is right here now inside our buy hole let's go into the settings and let's modify our op stream dns right now i see cloudflare is it just the primary let's also add the secondary and let's save our settings now let's also go into group management and add list and let's also add more or less to our block list to make sure we are catching as much commercials and tracking software as possible we're going to use the website firebog.net which has a few block list in-text files in here we can add a few suspicious list and advertising lists so that the system will block it if they try to send a dns query for example let's check this list so as you see any domain in this big list of bad domains it's sent to buy hole as a dns query the buy hole will respond with four zeros and this means the domain will never work because it's assigned a wrong ib address and this applies to all the domains in this list we're going to copy the list to add it to our pi hole and we're just going to paste the address in here and add our list now also add a few more advertising lists now i added five more lists just from this one website now for all these new lists to take effect and be added to the 84 000 plus domains that are being blocked right now using our dns system we're gonna have to either update the list online like we did in the previous video or you can also run the command by whole g from the cli so now this can be a good opportunity to see how to access the container cli using the docker engine application for windows so now from here using our buy hole container as you see there is a button for cli this allows me to run a shell inside my container directly so now i just need to write by hole dash g and once you run this you'll see that this is running the script to update the list including the five newer ones we just added now if i go back to my dashboard in here you see the domains have increased dramatically to 118 000 plus in this way we are making sure we are blocking as much as we can now to start pointing our clients to the system as a dns server like we did with the previous video we just need to go into our network connection in this case i'm using wi-fi so i'm just going to modify whatever interface i'm using and inside the ipv4 i can set the dns server manually to my buy hold container now or i can make the dhcp server that i'm using in my network whether it's my router or my firewall and distribute the dns server ip10.10.125 as a dns server to my network so i don't have to manually set it up in this case let's try the aesthetic assignment and we're just going to say then button that 1.25 and we're going to hit okay and after the setting has been set now the queries will start going up because now our windows 10 client is the first client that send queries to the buy hole as a dns server to now form our command prompt we can also test this out using the nslockup command which allows us to run dns queries right from the command line you can see in here it's recognizing the buy hole 10.10.125 is also showing this weird hostname which is the same as the service so now if we try to send any query right now it should go to the system and also the number should start getting up now for example let's do google.com now as you see some of the queries are working and some of the queries are being blocked as well same with another domain and as long as we are getting a proper response and the numbers are going up that means the system is operating properly and as you see the load and the memory usage is very low when these operations are taking place and also when you try to send the query and the dns server pi hole is sitting between you and the public dinos and checking this query against 118 000 plus domains on the block list without taking any time and the queries are coming up as soon as you put them so this is perfect because it's very lightweight and it's very effective now i would the other option to make sure your clients are getting this ib address automatically without having to assign them as a dns server in every client in your network in my case my fortigate firewall is distributing ip addresses to my clients using dhcp we can see in here dhp clients is showing to two different interfaces my wired and my wireless interface and you can see both interfaces have clients right now with dhp leases so i can simply go to my first interface for example and under dhp server this is the least details that i'm given to my computers and my network and i'm letting them know to use a specific dns server in this case i can let the system know to send the buy hole container ib address or the windows 10 that's running the docker engine more specifically the ib address 10.10.125 as a dns server therefore every time someone joins my network and gets an ib address using the firewall dhcp server you will get this ib address as the dns server you can do the same also for your other interfaces and the same instruction can be followed in a different platform than fortigate or even in a normal router that is equipped with dhcp service you can also go inside and modify the ib address to match the dns server ipe for the pi hole now also to show you the other side of the story if we try to search for a block domain in the dns query for example let's see something all the way in the bottom like this one for example and if we try to run the query for this using the pi hole as dns server now you will see that we are getting four zeros so this ip will never work we try it in a browser because everything is going back with the invalid ip address now i'm going to open my docker going and i'm going to delete this container for a second and now let's run a scenario where you may be using port 80 the default http port for a different web server already in your environment and you want to use a custom board so that you can use your pi hole management over the web in the same time you are using your web server already so we're gonna copy this command this is just the docker getting started and as you see it's using board 80 as well to run a web server with some getting started docs we're gonna copy this command just to emulate the scenario and we're just gonna run the docker run command to get the docker getting started container once we hit this it's gonna also download the image for the first time and now we have a web server already occupying board 80. now if we try to open our server ip again now this is running for me the help pages for the docker application so now we can go back to our script and now we can use the custom board script which goes around the board conflict by using a custom board 8080 we're just going to copy this docker run command and we're going to go back to our powershell and we're going to paste it and if you're already using board 8080 for something else you can change it to whatever you want let's change it to 888 now let's hit enter and now the server came out in one second again so now in the browser it all depends on which port we use if we use the default board this will show me the docker container for the help pages but if we do a custom board using the 8888 board this will show me the pi hole container as the dns server web management page finally if you also want to use the cli but you don't want to use the gui you can simply put the command docker execute and then we're going to need to use a flag dash i t for interactive terminal and then you can simply list your container name in this case our container name is pihole we're going to say pihole and then we have to list the environment we are trying to terminal into so in this case this is a bash environment and once we bought this now you are inside the docker container you can see here the host name and i'm root user right now at the buy hole container if we were to try to update our list for example we would say piehole.g and this way we are interacting over a terminal channel directly to our pihole container without using the cli button just using the docker execute-it container name and then environment name that's how you create containers on windows environment using docker engine and how to create containers using custom board or how to access the cli on a docker container thank you for watching
Info
Channel: ElastiCourse
Views: 18,444
Rating: undefined out of 5
Keywords: docker, container, pihole, pi-hole, ad blocker, tracking, block, blocker, dns block, dns, network, security, server, dhcp, adlist, adblock, docker engine, docker hub, windows, windows 10, wsl, windows subsystem for linux, cli to container, terminal to container, shell to container, container custom port
Id: fqRr2_nMQ-s
Channel Id: undefined
Length: 17min 47sec (1067 seconds)
Published: Tue Jul 14 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.