Created
June 19, 2018 11:23
-
-
Save omerucel/8e122941dd11a86dc826647062384d20 to your computer and use it in GitHub Desktop.
Docker Aliases
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
composer () { | |
tty= | |
tty -s && tty=--tty | |
docker run \ | |
$tty \ | |
--interactive \ | |
--rm \ | |
--user $(id -u):$(id -g) \ | |
--volume /etc/passwd:/etc/passwd:ro \ | |
--volume /etc/group:/etc/group:ro \ | |
--volume $(pwd):/app \ | |
composer "$@" | |
} | |
php72 () { | |
tty= | |
tty -s && tty=--tty | |
docker run \ | |
$tty \ | |
--interactive \ | |
--rm \ | |
--user $(id -u):$(id -g) \ | |
--volume /etc/passwd:/etc/passwd:ro \ | |
--volume /etc/group:/etc/group:ro \ | |
--volume $(pwd):/app \ | |
--workdir /app \ | |
php:7.2-cli-alpine php "$@" | |
} | |
npm () { | |
tty= | |
tty -s && tty=--tty | |
docker run \ | |
$tty \ | |
--interactive \ | |
--rm \ | |
--user $(id -u):$(id -g) \ | |
--volume /etc/passwd:/etc/passwd:ro \ | |
--volume /etc/group:/etc/group:ro \ | |
--volume $(pwd):/app \ | |
--workdir /app \ | |
node:9-alpine npm "$@" | |
} | |
node () { | |
tty= | |
tty -s && tty=--tty | |
docker run \ | |
$tty \ | |
--interactive \ | |
--rm \ | |
--user $(id -u):$(id -g) \ | |
--volume /etc/passwd:/etc/passwd:ro \ | |
--volume /etc/group:/etc/group:ro \ | |
--volume $(pwd):/app \ | |
--workdir /app \ | |
node:9-alpine node "$@" | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment