Skip to content

Instantly share code, notes, and snippets.

@sylwit
Created January 23, 2018 21:01
Show Gist options
  • Save sylwit/8ad1f9ea9f85b3c804d1bba042a668f7 to your computer and use it in GitHub Desktop.
Save sylwit/8ad1f9ea9f85b3c804d1bba042a668f7 to your computer and use it in GitHub Desktop.
Alias for docker
function docker.clean_containers() {
docker rm $(docker ps -a | grep -v Up | grep -v CONTAINER | cut -f 1 -d ' ')
}
function docker.clean_images() {
docker rmi $(docker images | grep none | tr -s ' ' | cut -f 3 -d ' ')
}
function docker.clean_volumes() {
docker volume rm $(docker volume ls -qf dangling=true)
}
function docker.bash() {
docker exec -ti $1 bash
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment