Docker Complete Setup on Windows (With WSL Ubuntu)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up everybody my name is zura and i'm the codeholic in this video we're going to install docker on windows set up wsl and install ubuntu and set up complete working environment on windows 10 using docker in wsl ubuntu before we start make sure you smash that like button subscribe if you are not yet for more videos like this alright let's start [Music] if you want to see a written documentation how to install docker on your windows machine you can check the following link which will be in the description first of all let's have a look at the system requirements the very first and the most important requirement is to enable virtualization in your machine you can have a look at the detailed things right here but the first thing i had to do was to enable virtualization from bios to check if virtualization is enabled on your machine you can open task manager go in the performance section and right here you see virtualization is enabled you can install docker without wsl 2 and the linux operating system but in this video we're going to set up and make it working with wsl 2 as well in both cases whether you are going to run it with ww2 or without you need to have at least windows 10 64-bit version 2004 or higher or windows 11 but let's now click this docker desktop for windows button and install that as soon as docker desktop is downloaded i'm going to click on that and follow the steps we need to click ok right here and wait okay docker desktop was successfully installed i'm going to click close right here now let's open it when you open very first time it will give you the following model you need to accept the terms so i'm going to click accept right here and here's my docker engine starting if you have any issues or problems so far let me know in the comment section down below now let's keep this tutorial and let's run the following comments to see how the docker is actually running let's open powershell and paste this hit enter let's wait a couple of seconds until this is done now let's analyze what happened right here so we run docker run with d and p what does that mean we're going to run docker getty getting started image on the following ports that's going to be the inner port that's going to be the outer port using detached mode it couldn't find this local this image locally so it started pulling from the docker hub and then finally it's gonna run so if you now open in browser localhost we're gonna see this docker tutorial getting started section that is running using our command if you type right here docker ps it's going to give you all running containers if you want to stop a container you need to run docker stop in the container id i'm going to show you how you can actually stop the container or delete from docker desktop in my opinion docker desktop is a very very handy tool on windows machine so right here you see all your containers running right here you see all your images in this case we only have one image let's go in the container section you can go inside just clicking on that and see all the output you get right there let's go back and from here you can just stop or start the cli or restart or delete or open your browser so in this case i'm going to just stop this okay so far so good why do we need to install wso2 because in some cases you are going to build your docker image with certain commands which is only available on linux for example if you go on the laravel installation link and grab the following thing and that's not specified specific to laravel only let's that's going to happen to any programming language or framework which you want to install using docker so right here we need to have serial command we can download that and run it crl is not supported by default on terminals of windows like powershell or cmd even if you make it available then it's gonna apply bash right here and that bash uses right there sudo and you are not going to make it without wsl 2 and linux operating system believe me i tried it okay now we need to enable wsl 2 on our windows and install it and install also linux operating system for properly installing wsl on your operating system you can find the official documentation from microsoft we see right here the same windows version 2004 or higher or windows 11 as we head on the docker i'm going to put this link in the video description if you need just anything you can check it out right here now we need to go in windows features and check right here let's go down below and right here we see windows subsystem for linux sometimes this might be disabled for you and you need to enable the following features so just tick that checkbox click ok if the windows asks you to restart reboot your system go ahead and restart and reboot now let's open powershell we need to open it as an administrator let's clear up everything and let's list existing distributions so wsl dash l v and we see right here docker desktop is running with docker desktop data as well now i'm going to install ubuntu i'm going to clear up everything and run wsl install hd to specify the distribution name and right here i'm going to type ubuntu which is one of the available distribution name as soon as we run this it's going to start downloading ubuntu as soon as this is done it's going to pop up ubuntu screen and asks you to enter new unix username i'm going to call this zora i think the name should be all the lowercase so i'm going to call it lowercase or let's specify password okay now i'm already in my linux system i can type any linux command like pwd ls dash la and we see all the files and folders i have right there i can run cut to just open any like posh rc file and i basically have every linux every ubuntu comment if you want to see what other distributions are supported in wsl you can run wsl-l-o and it's going to give you right here ubuntu debian color linux and others okay now since we have our ubuntu installed what are we going to do well this is my working environment so i'm going to create right here www folder navigate inside and that's going to be my working directory for any kind of project and now we need to integrate our wsl to ubuntu operating system into docker desktop and let's type docker right here the docker command is not available let's actually open now docker desktop so right here we have it i'm going to close this let's go in the settings from this gear icon and go in the resources and down below we see this wsl integration okay right here we see ubuntu is basically disabled let's click apply and restart now let's close this and now let's type docker once again in our ubuntu and now we see all docker commands available now i'm going to make any project right here but how can i open this using vs code basically i can type code let me actually create folder mkdir node for example and then i'm going to open node folder using vs code and if we bring up the terminal right here we see that this comes from a wsl uh folder okay ubuntu home zura so right here we have possibility to choose the different terminals and i'm gonna switch to ubuntu wsl and that's gonna give me ubuntu's actual integrated terminal the same one which i have right here and i can run any linux command i want now if you open laravel installation using cell services which uses docker behind and grabs the using this url and runs bash using sudo commands as well that should work everything should work basically because we have fully fully working linux operating system i'm going to open ubuntu navigate into www folder and paste this and i'm going to hit enter okay it couldn't find the following image locally so it's going to start downloading that it also uses php 8.1 version and basically if you are running this the very first time and creating very first laravel application using docker it's going to take a lot of time right here i need to provide my ubuntu password and hit enter now my laravel project was created let's navigate inside the folder and start the project by running vendor bin sale app the very first time you're gonna run this it's gonna take some time because it has to download docker images first and then create containers out of these images okay our laravel application has been started so let's open localhost in the browser and we see laravel application right there okay let's open docker desktop and see what containers have been started okay right here is our example up we see example of laravel redis and mysql so we have a full application with databases ready with redis and mysql also ready if you want to stop your containers you can click the stop button right here or open ubuntu and just hit ctrl and c right here it can take a couple of seconds until the processes actually are killed and the containers are stopped and the next day whenever you want to start the project you're going to open ubuntu navigate into www example folder and from here you can run vendor bean sale up okay now i want to show you a few more things what if i want to access my linux file system using windows explorer that is also possible which i use very often so i'm going to write here explorer dot xa and dot which indicates the current folder so i want to open the current folder using explorer and here it is opened look at the path it comes from the wsl ubuntu home so that's the linux file system and if i want to open the following project example up the following laravel application using ph restore i'm going to right click on that and click on this open folder as php store or i can even grab the following path open php form click new project from existing files choose the source files are in a local directory no web server is configured yet and paste your path right here open example up and click on finish here is our example app opened using php storm and if you open terminal right here we are actually using ubuntu's native terminal so pwd which indicates home zero so basically phpstorm is also integrated with wsl2 and it identifies that the path comes from wsl and it successfully opens that well basically if you grab the following path you can open the following project in any editor or id you want using pycharm or intellij or whatever and there's a quick hint which i generally do so you can right click on ubuntu and pin to quick access which gives you possibility to easily access your ubuntu file system whenever you need that okay or you can add even www into ping to quick access and whenever you want that you can easily open that that's it for this video guys thanks for watching hit the thumbs up if you enjoy the video in my upcoming videos we're gonna create applications using docker and wsl ubuntu if you're interested hit the subscribe for more videos thanks again and see you in the next time
Info
Channel: The Codeholic
Views: 214,861
Rating: undefined out of 5
Keywords: TheCodeholic, docker, docker on windows, docker tutorial, docker for beginners, setup docker on windows, docker and wsl, docker and wsl2, docker desktop, docker with wsl, docker with wsl2, docker with windows10, docker wsl ubuntu, install docker in windows 10, install docker in wsl ubuntu, install docker in wsl2, install laravel using docker, laravel docker, install laravel using sail, docker complete setup on windows, docker setup on windows, docker on windows with wsl
Id: 2ezNqqaSjq8
Channel Id: undefined
Length: 11min 57sec (717 seconds)
Published: Tue Jan 25 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.