Skip to content

Instantly share code, notes, and snippets.

@LucasCalazans
Last active July 19, 2019 16:26
Show Gist options
  • Save LucasCalazans/dd85d49d5bbb4538f134e8e730af8245 to your computer and use it in GitHub Desktop.
Save LucasCalazans/dd85d49d5bbb4538f134e8e730af8245 to your computer and use it in GitHub Desktop.
Execute a PHP command with a docker container
#!/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 "$*"
@LucasCalazans
Copy link
Author

LucasCalazans commented Jul 15, 2019

curl -s https://gist.githubusercontent.com/LucasCalazans/dd85d49d5bbb4538f134e8e730af8245/raw/66af88d3a95980fce8c7a0716413a5b568661968/exec.sh | bash -s composer install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment