This repository contains Docker image for the Laravel Installer, providing a convenient way to create Laravel projects for those who use docker as their development environment.
To pull the Docker image from Docker Hub, run:
docker pull zylwin/laravel-installer:latest
Create a docker volume for composer cache
docker volume create composer_cache
To create a new Laravel project, run:
docker run -it --rm -v $(pwd):/app -v composer_cache:/composer/cache zylwin/laravel-installer new
You may wish to configure a shell alias to execute commands more easily:
alias laravel='docker run --rm -v $(pwd):/app -v composer_cache:/composer/cache zylwin/laravel-installer'
To make sure this is always available, add this to your shell configuration file in your home directory, such as ~/.zshrc
or ~/.bashrc
, and then restart your shell.
echo 'alias laravel="docker run --rm -it -v $(pwd):/app -v composer_cache:/composer/cache zylwin/laravel-installer"' >> ~/.zshrc
source ~/.zshrc
laravel new
Alternatively, If they want to update anything in the Dockerfile, you can clone this repository and build the image locally using:
git clone https://github.com/zawyelwin/laravel-installer-docker.git
cd laravel-installer-docker
docker build --build-arg INSTALLER_VERSION=$INSTALLER_VERSION -t <your-dockerhub-username>/laravel-installer .
This project is licensed under the MIT license.
Contributions are welcome! If you have any improvements or bug fixes, please feel free to open an issue or submit a pull request.
- Laravel Installer
- Some documentation referenced from the Laravel Documentation.