Skip to content

Instantly share code, notes, and snippets.

@SIMULATAN
Created February 28, 2023 09:43
Show Gist options
  • Save SIMULATAN/c92fc86c2912fb5833ffe99cfc25e7d8 to your computer and use it in GitHub Desktop.
Save SIMULATAN/c92fc86c2912fb5833ffe99cfc25e7d8 to your computer and use it in GitHub Desktop.
Show a list of docker container names and their respective restart policies
docker ps -a --format json | jq -r '.ID' | xargs -I {} 'docker' inspect {} | jq -r '.[] | "\(.Name[1:]): \(.HostConfig.RestartPolicy.Name)"'
@SIMULATAN
Copy link
Author

Note that this requires engine version 23 (later than a4a734d)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment