Skip to content

Instantly share code, notes, and snippets.

@deeshank
Created August 24, 2017 20:34
Show Gist options
  • Save deeshank/6bd975aabd7965fc5579a4e6205e05f1 to your computer and use it in GitHub Desktop.
Save deeshank/6bd975aabd7965fc5579a4e6205e05f1 to your computer and use it in GitHub Desktop.
Docker Scripts
# Stop all docker containers
alias docker_stop='docker stop $(docker ps -a -q)'
# Start all docker containers
alias docker_start='docker start $(docker ps -a -q)'
# Delete all docker containers
alias docker_rm='docker rm -f $(docker ps -a -q)'
# Destroy all local docker images (this is equivalent to vagrant destroy)
# If you do this, run make docker-launch-base-image to get back a fresh copy
alias docker_rmi='docker rmi $(docker images -a -q)'
#docker show live containers
alias dps='docker ps'
#flush memcache
alias flushc='echo 'flush_all' | nc localhost 11211'
#clear memcache in remote hosts
#pass hostnames separated by spaces
clr() {
for machine in "$@"
do
ssh $machine 'echo flush_all | nc localhost 11211'
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment