Skip to content

Commit

Permalink
Add functions for docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinav-nath committed Aug 30, 2022
1 parent 44559ab commit 3ff18a2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
6 changes: 2 additions & 4 deletions setup/.zsh_aliases
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,5 @@ alias topcpu="/bin/ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10"
# git aliases
alias gst="git status"

# docker-compose
alias dC="docker-compose"
alias dCu="docker-compose up -d"
alias dCd="docker-compose down"
# docker ps -a
alias dps="docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}\t{{.Ports}}' -a"
18 changes: 18 additions & 0 deletions setup/.zsh_functions
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,21 @@ function up() {

# cheat.sh shortcut
function cheatsheet() { curl http://cht.sh/$1 }

# docker-compose up
function dCu() {
if [ $# -gt 0 ]; then
docker-compose -f $1 up -d
else
docker-compose up -d
fi
}

# docker-compose down
function dCd() {
if [ $# -gt 0 ]; then
docker-compose -f $1 down
else
docker-compose down
fi
}

0 comments on commit 3ff18a2

Please sign in to comment.