Skip to content

Instantly share code, notes, and snippets.

@jhonoryza
Last active April 7, 2021 04:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhonoryza/4ef7201d37d32f44a922cb9b6254d17b to your computer and use it in GitHub Desktop.
Save jhonoryza/4ef7201d37d32f44a922cb9b6254d17b to your computer and use it in GitHub Desktop.
Docker Snippets

this will create a new laravel project in /var/www/html

docker run --rm -i -v "$(pwd):/var/www/" -u "$(id -u):$(id -g)" composer composer create-project --prefer-dist laravel/laravel /var/www/src

make php file as executable for vscode from docker php

path=$(printf '%s\n' "${PWD##*/}")
command="docker exec ${path}_php_1 php "$@""
echo "Running php on docker ${path}_php_1"
$command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment