Skip to content

Instantly share code, notes, and snippets.

@grampelberg
Created February 23, 2017 15:41
Show Gist options
  • Save grampelberg/24db8f76a55531701ffa091609292407 to your computer and use it in GitHub Desktop.
Save grampelberg/24db8f76a55531701ffa091609292407 to your computer and use it in GitHub Desktop.
dps() {
docker ps --format 'table {{.Names}}\t{{.Image}}\t{{.Ports}}' | awk -v OFS='\t' '{if($3 ~ /->/) {split($3,a,":"); split(a[2],b,"->"); print $1, $2, b[1] } else { print $1, $2, $3}} ' | column -t
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment