1
0
Fork 0

Add the new aliases and commands for docker along with the README

pull/863/head
Andrew Williams 10 years ago
parent 507bb58cb6
commit 625e0795e3

@ -6,8 +6,20 @@ Enables boot2docker and docker support.
boot2docker boot2docker
----------- -----------
Will automatically set the environment if boot2docker is running.
- `b2d` boot2docker
- `b2dstart` start docker vm, set environment
- `b2dssh` ssh to the boot2docker vm
- `b2dstop` stop the boot2docker vm
- `b2di` show boot2docker status
docker docker
------ ------
- `doc` docker
- `docp` docker ps
- `docpa` docker ps -a
- `docimg` show docker images
- `docbash` launch bash in an already running container

@ -0,0 +1,35 @@
#
# Defines docker and boot2docker commands & aliases
#
# Authors:
# andrew williams (https://github.com/skarfacegc)
#
# Only setup the boot2docker commands and aliases if we're on OSX
if [[ "$OSTYPE" == darwin* ]]; then
# Set environment if boot2docker is already running
if [[ $(boot2docker status) == "running" ]]; then
eval $(boot2docker shellinit 2> /dev/null)
fi
alias b2d='boot2docker'
alias b2dstart='boot2docker start &> /dev/null && eval $(boot2docker shellinit 2> /dev/null)'
alias b2dstop='boot2docker stop'
alias b2dssh='boot2docker ssh'
alias b2di='boot2docker info'
fi
# Docker alases
alias doc='docker'
alias docp='docker ps'
alias docpa='docker ps -a'
alias docimg='docker images'
docbash() {
docker exec -t -i "$1" /bin/bash
}
compdef -e 'words[1]=(docker exec); service=docker; (( CURRENT+=1 )); _docker' docbash
Loading…
Cancel
Save