Skip to content

Instantly share code, notes, and snippets.

@tonykwon
Last active July 17, 2017 02:38
Show Gist options
  • Save tonykwon/884c25927a75649cad07 to your computer and use it in GitHub Desktop.
Save tonykwon/884c25927a75649cad07 to your computer and use it in GitHub Desktop.
Docker Tips
$ docker stop $(docker ps -a -q)
$ docker rm $(docker ps -a -q)
# if it is sluggish and has issues fetching stuff via network
#
$ docker-machine restart default # Restart the environment
$ eval $(docker-machine env default) # Refresh your environment settings
# get the container ID of by container Name
#
docker ps -a | grep lloyddev_web | awk '{print $1}'
# grab container ID to fire up docker stats command
#
docker stats `docker ps -a | grep lloyddev_web | awk '{print $1}'`
# show all stats
#
docker stats `docker ps -a | awk '{if (NR!=1) {print $1}}' | xargs | sed -e 's/ / /g'`
# Vagrant
VBoxManage list vms | grep '_vhosts_boot2docker' | sed -e 's/^[^{]*{\([^{}]*\)}.*/\1/'
VBoxManage list vms | grep '_vhosts_boot2docker' | sed -e 's/^[^{]*{\([^{}]*\)}.*/\1/' > /Users/tonykwon/SH/_vhosts/.vagrant/machines/boot2docker/virtualbox/id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment