Skip to content

Instantly share code, notes, and snippets.

@azylinski
Created December 20, 2017 16:53
Show Gist options
  • Save azylinski/393d5fd335ca570ac88d1957f2622ad0 to your computer and use it in GitHub Desktop.
Save azylinski/393d5fd335ca570ac88d1957f2622ad0 to your computer and use it in GitHub Desktop.
Overwrite default "docker ps" format
# docker ps --format
# Example: docker ps --format 'table {{.Names}}\t{{.Image}}\t{{.Command}}\t{{.Status}}'
#
# Overwrite default "docker ps" format (do not show Container ID and Created At columns)
# Read more: https://container42.com/2016/03/27/docker-quicktip-7-psformat/
jq '. + {"psFormat": "table {{.Names}}\t{{.Image}}\t{{.Command}}\t{{.Status}}"}' ~/.docker/config.json > /tmp/docker_config.json && mv /tmp/docker_config.json ~/.docker/config.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment