mirror of
https://github.com/balkian/dotfiles.git
synced 2024-11-23 20:52:28 +00:00
Added compose-run
This commit is contained in:
parent
d829dd0959
commit
3f5da0dfe0
21
scripts/.bin/compose-run
Executable file
21
scripts/.bin/compose-run
Executable file
@ -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 $*
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user