diff --git a/scripts/.bin/compose-run b/scripts/.bin/compose-run new file mode 100755 index 0000000..0b070cc --- /dev/null +++ b/scripts/.bin/compose-run @@ -0,0 +1,21 @@ +#!/bin/sh + +CWD=$PWD +if [ -z "$CONTAINER" ]; +then + CONTAINER=main +fi + +while [ -e "$PWD" -a "$PWD" != "/" ] +do + if [ -e "$PWD/docker-compose.yml" ]; then + docker-compose run --rm main $* + exit $? + else + cd `dirname $PWD` + fi +done + +cd $CWD + +eval $* diff --git a/zsh/.zprofile b/zsh/.zprofile index 2792e25..bf10d45 100644 --- a/zsh/.zprofile +++ b/zsh/.zprofile @@ -79,6 +79,8 @@ alias drun="docker run" alias drmi="docker rmi" alias dps="docker ps" alias dpi="docker images" +alias dc="docker-compose" +alias dcr="compose-run" function da () { docker start $1 && docker attach $1 } @@ -94,4 +96,5 @@ function newdev () { docker run -v $PWD:/usr/src/app -t -i --name $1 -h $1 balkian/devmachine } + TMPPREFIX="${TMPDIR%/}/zsh"