Add a few new docker aliases

pull/338/head
Travis Swicegood 2014-09-04 13:10:35 -07:00
parent e10539bb6b
commit e43f516439
1 changed files with 12 additions and 0 deletions

View File

@ -11,3 +11,15 @@ if [[ `uname -s` == "Darwin" ]]; then
boot2docker ssh -t sudo "/var/lib/boot2docker/docker-enter \"$1\"" boot2docker ssh -t sudo "/var/lib/boot2docker/docker-enter \"$1\""
} }
fi fi
function docker-remove-most-recent-container() {
about 'attempt to remove the most recent container from docker ps -a'
group 'docker'
docker ps -a | head -2 | tail -1 | awk '{print $NF}' | xargs docker rm
}
function docker-remove-most-recent-image() {
about 'attempt to remove the most recent image from docker images'
group 'docker'
docker images | head -2 | tail -1 | awk '{print $3}' | xargs docker rmi
}