]> Tony Duckles's Git Repositories (git.nynim.org) - dotfiles.git/commitdiff
.bashrc: Add more docker-related helper aliases master
authorTony Duckles <tony@nynim.org>
Thu, 20 Feb 2025 11:23:55 +0000 (05:23 -0600)
committerTony Duckles <tony@nynim.org>
Thu, 20 Feb 2025 11:23:55 +0000 (05:23 -0600)
.bashrc

diff --git a/.bashrc b/.bashrc
index c549c458fed60f214eb0388590dcfdec8ce2b253..1ed56f821ec2a2b9e358de01ab738b6a21a51b34 100644 (file)
--- 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