Skip to content

Instantly share code, notes, and snippets.

@willwm
Last active July 19, 2020 04:40
Show Gist options
  • Save willwm/f7501a19e4c66eba94ac1ed5d7d5e48e to your computer and use it in GitHub Desktop.
Save willwm/f7501a19e4c66eba94ac1ed5d7d5e48e to your computer and use it in GitHub Desktop.
# Show (and follow) logs for container with "sqlserver" in container name
docker logs -f $(docker ps --filter="name=sqlserver" -q)
# Stop all containers, then system prune
docker stop $(docker ps -a -q); docker system prune -f;
# List names, status, and ports of running containers
docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'
# List only names of running containers (https://stackoverflow.com/a/50667460/122283)
docker ps --format '{{.Names}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment