Created
November 24, 2023 01:14
-
-
Save xlc/c772d189e81c6366a599ef65c4900ff0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
tmux new-session -d -s logs || true | |
for name in `docker ps --format json | jq -s 'sort_by(.Names)|.[].Names)'` | |
do | |
tmux split-window -h -f | |
tmux send-keys "docker logs -f -n 20 $name" C-m | |
tmux select-pane -T $name | |
done | |
tmux kill-pane -t 0 | |
tmux select-layout even-vertical | |
tmux attach-session -t logs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Display the logs for each running docker container in own tmux pane