Skip to content

Instantly share code, notes, and snippets.

@felipebn
Created November 17, 2017 11:19
Show Gist options
  • Save felipebn/3aa7a0031d58e636b58d7eeec894c66a to your computer and use it in GitHub Desktop.
Save felipebn/3aa7a0031d58e636b58d7eeec894c66a to your computer and use it in GitHub Desktop.
Powershel - How to get docker ps output first column OR How to get docker contianer ID from docker ps
# Example for a container with '/keycloak' in the name
docker logs -f $(docker ps | Select-String /keycloak | % { $_.ToString().Split(" ") | select -first 1})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment