Skip to content

Instantly share code, notes, and snippets.

@fabianofa
Created September 12, 2019 11:37
Show Gist options
  • Save fabianofa/100221680bcd77d2fb085c148e629764 to your computer and use it in GitHub Desktop.
Save fabianofa/100221680bcd77d2fb085c148e629764 to your computer and use it in GitHub Desktop.
Script bash para executar comando em um container de php71
#
# uso: php71 /var/www/html/foo composer install
#
#!/bin/bash
path=$1
args=("$@")
unset args[0]
if [ -z "$path" ]
then
path=$(pwd)
fi
container=$PHP71_CONTAINER
if [ -z "$PHP71_CONTAINER" ]
then
container="php71-apache_php71_1"
fi
docker exec -it -w $path $container ${args[@]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment