Last active
July 19, 2019 16:26
-
-
Save LucasCalazans/dd85d49d5bbb4538f134e8e730af8245 to your computer and use it in GitHub Desktop.
Execute a PHP command with a docker container
This file contains hidden or 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
#!/bin/bash | |
PID=$(id -u $USER); | |
GID=$(id -g $USER); | |
mkdir -p ~/.composer/cache; | |
docker run --rm \ | |
-v $(pwd):/app \ | |
-v ~/.composer/cache:/var/www/.composer/cache \ | |
-v ~/.ssh:/.ssh:ro \ | |
-u $PID:$GID \ | |
-w /app \ | |
lucascalazans/php \ | |
bash -c "$*" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
curl -s https://gist.githubusercontent.com/LucasCalazans/dd85d49d5bbb4538f134e8e730af8245/raw/66af88d3a95980fce8c7a0716413a5b568661968/exec.sh | bash -s composer install