Created
September 12, 2019 11:37
-
-
Save fabianofa/100221680bcd77d2fb085c148e629764 to your computer and use it in GitHub Desktop.
Script bash para executar comando em um container de php71
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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