This repository has been archived on 2022-02-20. You can view files and clone it, but cannot push or open issues/pull-requests.
2020-11-20 15:48:57 -08:00
|
|
|
#!/bin/bash
|
2021-01-17 09:50:47 -08:00
|
|
|
|
|
|
|
# if docker loaded only
|
2020-11-20 15:48:57 -08:00
|
|
|
command -v docker >/dev/null 2>&1 || return
|
|
|
|
|
|
|
|
#docker - add users to docker group to avoid needing sudo
|
|
|
|
# run a command on a container
|
|
|
|
|
|
|
|
alias dkcr="docker run"
|
|
|
|
# start a container
|
|
|
|
alias dkcs="docker start"
|
|
|
|
# restart all running containers
|
|
|
|
alias dkcrr="docker restart $(docker ps -q)"
|
|
|
|
# start all exited containers
|
|
|
|
alias dkcsu="docker start $(docker ps --filter "status=exited")"
|
|
|
|
# ls stopped, la all, l running
|
|
|
|
alias dkcls="docker ps --filter "status=exited""
|
|
|
|
alias dkcla="docker ps -a "
|
|
|
|
alias dkcl="docker ps "
|
|
|
|
alias dkil="docker images --digests=true"
|
|
|
|
alias dkir="docker rmi $(docker images -q)"
|
|
|
|
alias dks="sudo service docker"
|
|
|
|
alias dkcstpa="docker stop $(docker ps -a -q)"
|
|
|
|
# remove unrunning containers
|
|
|
|
alias dkcrm="docker rm $(docker ps -a -q)"
|
|
|
|
# stop and remove
|
|
|
|
alias dkcsrm="docker rm -f $(docker ps -a -q)"
|
|
|
|
# cleans out unused/dangling aufs volumes - run this occasionally
|
|
|
|
alias dkclean="docker volume ls -qf dangling=true | xargs -r docker volume rm"
|
|
|
|
alias dkde="gksudo gedit /etc/default/docker"
|
|
|
|
|
|
|
|
alias dkterm="docker_terminal"
|