Last active
July 2, 2020 12:00
-
-
Save thikade/23de0fa3e89bef0b67be1213bb2d107f to your computer and use it in GitHub Desktop.
Docker hints & shortcuts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export HISTSIZE=50000; export HISTFILESIZE=50000 | |
alias ll="ls -al" | |
alias git="git -c http.sslVerify=false " | |
alias gitc='git -c http.sslVerify=false' | |
alias ga='git add' | |
alias gb='git branch' | |
alias gc='git commit' | |
alias gco='git checkout' | |
alias gd='git diff' | |
# alias gitprompt='source ~/bash-git-prompt/gitprompt.sh' | |
alias gr='git remote' | |
alias gs='git status' | |
alias gpu='git push' | |
alias gpl='git pull --ff-only ' | |
alias gl="git log --oneline --graph --decorate" | |
alias gld="git log -p --graph --decorate" | |
alias glv="git log --name-only --graph --decorate" | |
alias dm=docker-machine | |
alias dc=docker-compose | |
alias d=docker | |
alias dl="docker logs" | |
alias dv="docker volume" | |
# list images | |
alias di="docker images --format 'table {{.Repository }}:{{.Tag}}\t{{ .ID}}\t{{.CreatedSince}}\t{{.Containers}}'" | |
# list running containers in short format | |
alias dps="docker ps --format 'table {{.Names}}\t{{.Image}}\t{{.RunningFor}}\t{{.Status}}\t{{.ID}}\t{{.Command}}'" | |
# list all containers in short format | |
alias dpsa="docker ps -a --format 'table {{.Names}}\t{{.Image}}\t{{.RunningFor}}\t{{.Status}}\t{{.ID}}\t{{.Command}}'" | |
# Get IP of all running containers | |
alias dip="docker inspect -f '{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' \$(docker ps -aq)" | |
# Force remove a container: requires container name or id | |
alias drmf='docker rm -f ' | |
# Force remove ALL containers | |
alias drmfa='docker rm -f `docker ps -qa`' | |
# Force remove all EXITED containers only | |
alias drmex='docker rm `docker ps -aq -f status=exited`' | |
# Remove dangling images -- these are not used anymore | |
alias drmi='docker rmi $(docker images --filter "dangling=true" -q ) ' | |
# Remove images that have no tag | |
alias drmin='docker rmi $(d images| grep '^.none' | tr -s " " | cut -d\ -f3)' | |
# Execute cmd in container: Requires container and cmd as parameters! | |
alias dex="docker exec -ti " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment