Skip to content
An`s Weblog
Go back

Docker Events

Docker Events là gì?

Lệnh cơ bản:

docker system events

Một số flags hữu ích:

Các filter phổ biến:

Ví dụ:

docker system events --since 1h --filter 'type=container' --filter 'event=start'

Một số sự kiện điển hình:

EventÝ nghĩa
createTạo container
startContainer bắt đầu chạy
exec_createTạo tiến trình exec
exec_startBắt đầu tiến trình exec
exec_dieTiến trình exec kết thúc
attachCó người attach vào container
dieContainer chết
stopContainer bị stop

Demo phổ biến:

1. Giám sát các container bị attach

docker system events --filter 'type=container' --filter 'event=attach'

2. Giám sát container chết hoặc stop

docker system events --filter 'type=container' --filter 'event=die' --filter 'event=stop'

Lời khuyên Production:


Share this post:

Previous Post
Managing Stopped Container
Next Post
Having Containers Start Automatically