-
-
Save Flower7C3/be4f62067d17b6c57cdbda2a38e6b368 to your computer and use it in GitHub Desktop.
On demand tools on Docker
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
#!/usr/bin/env bash | |
## save as /usr/local/bin/blt and run `chmod +x /usr/local/bin/blt` | |
docker run --platform=linux/amd64 --rm --interactive --tty \ | |
-v "$PWD":/app -w /app \ | |
cbcms/blt $@ |
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
#!/usr/bin/env bash | |
## save as /usr/local/bin/composer and run `chmod +x /usr/local/bin/composer` | |
docker run --platform=linux/amd64 --rm --interactive --tty \ | |
--volume $PWD:/app \ | |
--volume ${COMPOSER_HOME:-$HOME/.composer}:/tmp \ | |
composer $@ |
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
#!/usr/bin/env bash | |
## save as /usr/local/bin/drush and run `chmod +x /usr/local/bin/drush` | |
docker run --platform=linux/amd64 --rm --interactive --tty \ | |
-v "$PWD":/app -w /app \ | |
drush/drush $@ |
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
#!/usr/bin/env bash | |
## save as /usr/local/bin/php and run `chmod +x /usr/local/bin/php` | |
POSITIONAL_ARGS=() | |
version="8.2" | |
while [ $# -gt 0 ]; do | |
case "$1" in | |
-V=*) | |
version="${1#*=}" | |
;; | |
*) | |
POSITIONAL_ARGS+=("$1") # save positional arg | |
;; | |
esac | |
shift | |
done | |
set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters | |
docker run --platform=linux/amd64 --rm --interactive --tty \ | |
-v "$PWD":/usr/src/myapp -w /usr/src/myapp \ | |
php:$version php $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment