1
0
mirror of https://github.com/frebib/dotfiles.git synced 2024-06-14 12:57:23 +00:00

aliases: add daddrs function

This commit is contained in:
Joe Groocock 2019-09-10 10:19:18 +01:00
parent 2050b1a5b7
commit 8287acf3a7
Signed by: frebib
GPG Key ID: E0B16BEACFBB6A86

View File

@ -178,7 +178,8 @@ alias gstv="gsta show -p stash@{0}"
alias d=docker
alias dps="docker ps --format='table {{.ID}}\t{{.Image}}\t{{.Label \"org.label-schema.version\"}}\t{{.Networks}}\t{{.RunningFor}}\t{{.Status}}\t{{.Names}}' | sed '1s/version/VERSION/'"
alias dpsa="docker ps -a --format='table {{.ID}}\t{{.Image}}\t{{.Label \"org.label-schema.version\"}}\t{{.Networks}}\t{{.RunningFor}}\t{{.Status}}\t{{.Names}}' | sed '1s/version/VERSION/'"
alias dnets="dnet ls -q | xargs docker inspect | jq '.[] | select(.Name != \"host\" and .Name != \"none\") | [.] | map(.Name + \": \" + (.IPAM.Config | map(.Subnet) | join(\", \")))[]' -r | sort -k2 -t:"
alias dnets="docker network ls -q | xargs docker inspect | jq '.[] | select(.Name != \"host\" and .Name != \"none\") | [.] | map(.Name + \"\t\" + (.IPAM.Config | map(.Subnet) | join(\"\t\")))[]' -r | sort -V -k2,3 | column -t"
daddrs() { docker inspect ${1:-bridge} | jq '.[0].Containers | map(.Name + "\t" + .IPv4Address + "\t" + .IPv6Address)[]' -r | sort -V -k2,3 | column -t; }
alias din='docker inspect'
alias drm='docker rm'
alias drmi='docker rmi'