Create Laravel 8.x Docker Project

I have been learning how to create new projects with laravel 8. Laravel changes very frequently therefore by the time you are reading this maybe the newest version will not be 8.

For references, you can use the instructions provided at:

https://laravel.com/docs/8.x/installation

Start a new project - cd to the directory where you want to create the project then send these commands:

  1. curl -s https://laravel.build/example-app | bash
  2. cd example-app
  3. ./vendor/bin/sail up
  4. xdg-open http://localhost

NOTE: xdg-open will open the URL in your browser in Ubuntu

GET THE DOCKER ID
docker ps -a

delete / remove   
$docker rm <CONTAINER ID>


How to create a new laravel project

cd /home/developer/Desktop/local-laravel/projects


curl -s https://laravel.build/api | bash

OPEN PROJECT IN VS CODE


5. CREATE ALIAS for vendor sail
$ alias sail='bash vendor/bin/sail'
$ sail up -d

TO STOP:
$ sail down

ERROR: docker-compose: command not found
FIX: $ sudo apt  install docker-compose
https://www.webune.com/forums/arpxmz.html




remove project
cd /home/developer/Desktop/local-laravel/projects/;rm -rf <FOLDER-NAME>

https://laravel.com/docs/8.x/sail#starting-and-stopping-sail

Remove all stopped containers
$ docker rm $(docker ps -a -q)