【Tutorial】10 min with Laravel Sail + Docker on WSL2 - For Beginner

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
maybe you are using the homestead let's try out the new laravel sale sale is the toolkit based on docker let us use laravel sale to build the dev environment quickly before installing docker wsl2 has to be activated execute this command to install windows subsystem for linux [Music] also install the virtual machine platform [Music] restart computer then download and install this patch just click next will do [Music] before installing the ubuntu we set the default wsl is version 2. [Music] next open microsoft store search for the ubuntu if it is the first time you try to install you need to click get before you click the install button [Music] wait for the download and installation click launch to boot up ubuntu set your username and password [Music] baboon 2 is installed successfully let's confirm the wsl version [Music] it shows version 2 is running then we can install docker go to docker.com and then click get started choose the windows edition [Music] launch the installer you'll see the option about wsl too make sure it is checked wait for the installation to be complete [Music] click logout then log in windows again notice the taskbar you should see docker is starting [Music] once the docker is ready you can skip the tutorial in the docker dashboard click the gear icon at the top make sure it is using wsl2 engine [Music] at the resources wsl integration and turn on the ubuntu option after turning it on click apply and restart now we can start using laravel sale [Music] before that let us install windows terminal search windows terminal [Music] click get [Music] click install [Music] click launch execute wsl to get into ubuntu take a look the current path is pointing to your windows user directory the i o performance between os for wsl 2 is slow typically it is not recommended to read or write windows files inside ubuntu execute cd till to get into the linux user directory let's create our new laravel project test hyphen project [Music] press enter and wait for the download and installation [Music] key near ubuntu user's password curious about where do you access your ubuntu files in windows explorer enter double backslash wsl dollar sign open ubuntu and open the home folder open your user directory you should see the newly created test project folder back to windows terminal and cd into the test project directory enter the command and ready to sail if it is a fresh install docker requires downloading all dependency images so it will take some time to build your container for the first boot up [Music] it is about to be complete [Music] to save time we can create alias for long command edit the bashrc file [Music] add the alias at the bottom of the file [Music] then save it [Music] apply the changes [Music] now try to shut down the container right click on the dockers tray icon and select dashboard [Music] you can see the test project is in green color expand it you should see all the images now execute sail down services are closed one by one the container is disappeared once the services are all closed let's try to execute sail up the container is up and you should notice the terminal does not accept command input you can just press control c to terminate the container now we use sail up dash the detached mode after the first boot up it can boot up very fast [Music] then we execute sail artisan migrate it creates the default database tables we can now take a look using the database management tool click new to create a new profile the host name is local host user is sale and the password is password click save then click open can see the created tables under test underscore project database please always refer to the settings from.env file to access the dot env file just execute code.to load vs code vs code will remind you to install the wsl extension click install [Music] close the vs code again launch the vs code by executing code [Music] dot once the wsl extension installed you should see the wsl tag have a look at env file [Music] these should be your daily routine just open the terminal enter wsl to connect ubuntu cd tilde enter user directory then go in the project directory then sail up dash d start the container launch vs code using code dot do your programming jobs [Music] open the browser enter localhost to preview your work [Music] finish your work sail down stop your container done if there's any doubt please leave your comment below thanks for watching please press the like button and subscribe to my channel and click the bell to turn on the new video notification see you all soon thank you
Info
Channel: Dogcomp
Views: 5,981
Rating: 4.9653678 out of 5
Keywords: PHP, Docker, Ubuntu, Laravel Sail, WSL, windows 10, wsl 2, laravel docker, beginner web development, vs code, laravel tutorial for beginners step by step, laravel docker windows 10, laravel with docker, laravel 8 tutorial, web development, laradock install, laravel dev environment, laravel development, laravel development environment, laravel docker-compose, laravel + docker, laravel & docker, laravel and docker, Easy Laravel, laravel tutorial, laravel sail windows
Id: rr6AngDpgnM
Channel Id: undefined
Length: 9min 36sec (576 seconds)
Published: Thu May 27 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.