From 17a72ef941e3b96255fba9d19e36e5438d5fea62 Mon Sep 17 00:00:00 2001 From: Adar Nimrod Date: Wed, 6 Apr 2016 22:18:27 +0300 Subject: [PATCH] - Replaced docker-clean alias with function named docker that runs the clean command if specified, otherwise runs the docker executable as normal (kind of like aliases in git). --- .bashrc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index 61f9d63..fc5d733 100644 --- a/.bashrc +++ b/.bashrc @@ -57,7 +57,6 @@ alias concat="perl -pe 's/\n/\\\n/g'" alias deconcat="perl -pe 's/\\\n/\n/g'" alias ggo='sudo GOPATH=/usr/share/go go' alias tag-version='git tag -f v"$(cat VERSION)"' -alias docker-clean='docker rm $(docker ps --quiet --filter=status=exited); docker rmi $(docker images --quiet --filter=dangling=true)' alias ecr-login='eval $(aws ecr get-login)' ssh-keyscan-add () { (ssh-keyscan $@; cat $HOME/.ssh/known_hosts) | sort -u >> $HOME/.ssh/known_hosts @@ -67,4 +66,17 @@ gen-csr () { openssl req -new -newkey rsa:4096 -nodes -out $1.csr -keyout $1.key } +docker () { + local docker_exec="$(which docker)" + case "$1" in + clean) + $docker_exec rm $(docker ps --quiet --filter=status=exited) + $docker_exec rmi $(docker images --quiet --filter=dangling=true) + ;; + *) + $docker_exec $@ + ;; + esac +} + . $HOME/Documents/Shore/bundle_certs/bundle_certs -- GitLab