Background
Very often there are commands which are very useful for debugging and troubleshooting in docker and docker compose, this post is to document them down for future use.
- Gather health check command status information of specific container
jq bash command is needed to install beforehand. Following results will be outputteddocker inspect --format "{{json .State.Health }}" anm11_log_server_1 | jq
{ "Status": "healthy", "FailingStreak": 0, "Log": [ { "Start": "2023-05-09T15:31:55.974151402+08:00", "End": "2023-05-09T15:31:56.180881836+08:00", "ExitCode": 0, "Output": "" }, { "Start": "2023-05-09T15:32:56.185509821+08:00", "End": "2023-05-09T15:32:56.322503697+08:00", "ExitCode": 0, "Output": "" }, { "Start": "2023-05-09T15:33:56.327354557+08:00", "End": "2023-05-09T15:33:56.506142901+08:00", "ExitCode": 0, "Output": "" }, { "Start": "2023-05-09T15:37:16.863314985+08:00", "End": "2023-05-09T15:37:17.0210078+08:00", "ExitCode": 0, "Output": "" }, { "Start": "2023-05-09T15:38:17.025502598+08:00", "End": "2023-05-09T15:38:17.155554148+08:00", "ExitCode": 0, "Output": "" } ] }
沒有留言:
張貼留言