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

aliases: dpsa uses org.opencontainers.image labels

org.label-schema was deprecated in favour of the opencontainers labels,
which apparently a bunch of images actually use (unlike the label-schema
labels).

Signed-off-by: Joe Groocock <me@frebib.net>
This commit is contained in:
Joe Groocock 2022-12-21 16:35:07 +00:00
parent 73131b086f
commit 4143aa4e48
Signed by: frebib
GPG Key ID: E0B16BEACFBB6A86

View File

@ -197,7 +197,7 @@ alias gstv="gsta show -p stash@{0}"
# Docker aliases
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 dpsa="docker ps -a --format='table {{.ID}}\t{{.Image}}\t{{.Label \"org.opencontainers.image.version\"}}\t{{.Networks}}\t{{.RunningFor}}\t{{.Status}}\t{{.Names}}' | sed '1s/version/VERSION/'"
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'