Skip to content

Instantly share code, notes, and snippets.

@maxwellb
Last active September 1, 2018 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxwellb/d18f3c841a9a1123e973efce69d77be5 to your computer and use it in GitHub Desktop.
Save maxwellb/d18f3c841a9a1123e973efce69d77be5 to your computer and use it in GitHub Desktop.
Docker .bash_aliases
# CLI helpers
alias ls-docker-image='docker image list | sed -E '\''s/\s+/\t/g'\'' | cut -f 1,2 | sed -E '\''s/(.*)\s+(.*)/\1:\2/'\'' | tail -n+2 | sort | uniq'
alias update-docker-images='ls-docker-image | while read r ; do docker pull $r ; done'
# Docker commands
## az: microsoft/azure-cli
alias az='docker inspect az 2>/dev/null >/dev/null || docker run -dit --name az microsoft/azure-cli >/dev/null && docker inspect az | grep Status | grep -v running >/dev/null && docker start az >/dev/null && false || docker exec -it az az'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment