YouTip LogoYouTip

Docker Events Command

# Docker events Command \n\n[![Image 3: Docker Command Manual](#)Docker Command Manual](#)\n\n* * *\n\nThe `docker events` command is used to get real-time events generated by the Docker daemon.\n\nThe `docker events` command allows users to monitor various operational events of Docker containers, images, networks, and volumes, such as create, start, stop, delete, etc.\n\n### Syntax\n\ndocker events \nOPTIONSDescription:\n\n* **`-f, --filter`**: Filter output based on provided conditions.\n* **`--format`**: Format output using Go templates.\n* **`--since`**: Show events since the specified time.\n* **`--until`**: Show events until the specified time.\n\n### Examples\n\nGet all events:\n\ndocker events\nOutput:\n\n2023-07-22T15:04:05.123456789Z container create 123abc456def (image=ubuntu, name=my_container)2023-07-22T15:04:06.123456789Z container start 123abc456def (image=ubuntu, name=my_container)2023-07-22T15:04:10.123456789Z container stop 123abc456def (image=ubuntu, name=my_container)2023-07-22T15:04:11.123456789Z container destroy 123abc456def (image=ubuntu, name=my_container)\nFilter events:\n\ndocker events --filter event=stop\nThe above command only shows container stop events.\n\nOutput:\n\n2023-07-22T15:04:10.123456789Z container stop 123abc456def (image=ubuntu, name=my_container)\nFormat output:\n\ndocker events --format '{{.Time}} - {{.Type}} - {{.Action}}'\nThe above command displays events in the specified format.\n\nOutput:\n\n2023-07-22T15:04:05.123456789Z - container - create 2023-07-22T15:04:06.123456789Z - container - start 2023-07-22T15:04:10.123456789Z - container - stop 2023-07-22T15:04:11.123456789Z - container - destroy\nShow events since the specified time:\n\ndocker events --since "2023-07-22T15:04:05"\nThe above command shows events since 2023-07-22T15:04:05.\n\nShow events until the specified time:\n\ndocker events --until "2023-07-22T16:04:05"\nThe above command shows events until 2023-07-22T16:04:05.\n\n* * Docker Command Manual](#)
← Docker Port CommandDocker Ps Command β†’