0
0
Dockerdevops~10 mins

Docker events for real-time monitoring - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to start real-time monitoring of Docker events.

Docker
docker [1]
Drag options to blanks, or click blank then click option'
Aevents
Brun
Cps
Dlogs
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'docker run' instead of 'docker events'.
Confusing 'docker logs' with event monitoring.
2fill in blank
medium

Complete the command to filter Docker events by container ID.

Docker
docker events --filter 'container=[1]'
Drag options to blanks, or click blank then click option'
Avolume_name
Bimage_name
Cnetwork_name
Dcontainer_id
Attempts:
3 left
💡 Hint
Common Mistakes
Using image name instead of container ID for filtering.
Trying to filter by network or volume names.
3fill in blank
hard

Fix the error in the command to show Docker events for the last 10 seconds.

Docker
docker events --since [1]
Drag options to blanks, or click blank then click option'
Alast10
B10seconds
C10s
Dnow-10
Attempts:
3 left
💡 Hint
Common Mistakes
Using unsupported time formats like '10seconds' or 'last10'.
Using relative time expressions not recognized by Docker.
4fill in blank
hard

Fill both blanks to filter Docker events by event type and since a specific time.

Docker
docker events --filter 'event=[1]' --since [2]
Drag options to blanks, or click blank then click option'
Astart
Bstop
C5m
D1h
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing event types and time formats incorrectly.
Using unsupported time strings.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps container IDs to event types for events since 1 hour.

Docker
events_dict = [1]: [2] for [3] in events if event['time'] > '1h ago'
Drag options to blanks, or click blank then click option'
Aevent['container_id']
Bevent['type']
Cevent
Dcontainer
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong keys or values in the dictionary.
Incorrect variable names in the loop.