Last active
August 2, 2016 07:04
-
-
Save rodrigobaron/64ea67f374b36db70542e6e3636c98b1 to your computer and use it in GitHub Desktop.
Windows alternative to 'Interactive mode is not yet supported on Windows.' on docker-compose run issue
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
#!/bin/bash | |
function docker-compose-run() { | |
if [ "$1" = "-f" ] || [ "$1" = "--file" ] ; then | |
docker exec -i $(docker-compose -f $2 ps $3 |grep -m 1 $3 | cut -d ' ' -f1) "${@:4}" | |
else | |
docker exec -i $(docker-compose ps $1 | grep -m 1 $1 | cut -d ' ' -f1) "${@:2}" | |
fi | |
} | |
docker-compose-run "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you can put the function in ~/.zshrc or ~/.bashrc file using babun or cygwin... (i'm tested on babun)
usage:
or: