From: Tony Duckles Date: Thu, 20 Feb 2025 11:23:55 +0000 (-0600) Subject: .bashrc: Add more docker-related helper aliases X-Git-Url: http://git.nynim.org/dotfiles.git/commitdiff_plain .bashrc: Add more docker-related helper aliases --- diff --git a/.bashrc b/.bashrc index c549c45..1ed56f8 100644 --- a/.bashrc +++ b/.bashrc @@ -268,10 +268,11 @@ alias svn=svn-wrapper # docker helpers if [ -n "$(type -P docker)" ]; then - alias docker-ps="docker ps -a --format \"table {{.ID}}\t{{.Names}}\t{{.State}}\t{{.Status}}\t{{.Networks}}\"" + alias ctop="docker-top" + alias docker-ps="docker ps -a --format 'table {{.ID}}\t{{.Names}}\t{{.State}}\t{{.Status}}\t{{.Networks}}'" alias docker-tail="docker logs -tf --tail 50" alias docker-top="docker run --name ctop -it --rm -v /var/run/docker.sock:/var/run/docker.sock quay.io/vektorlab/ctop" - alias ctop="docker-top" + alias docker-vols="(echo 'CONTAINER|TYPE|SOURCE|DESTINATION'; docker ps -a --format '{{ .ID }}' | xargs docker inspect -f '{{ range .Mounts }}{{ $.Name }}{{ printf \"|\" }}{{ .Type }}{{ printf \"|\" }}{{ if eq .Type \"bind\" }}{{ .Source }}{{ else }}{{ .Name }}{{ end }}{{ printf \"|\" }}{{ .Destination }}{{ printf \"\n\"}}{{ end }}' | sed 's/^\///') | column -t -s '|'" fi if [ "$UNAME" = SunOS ]; then