0
0
Dockerdevops~10 mins

Viewing container logs in Docker - Interactive Code Practice

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

Complete the command to view logs of a container named 'webapp'.

Docker
docker logs [1]
Drag options to blanks, or click blank then click option'
Awebapp
Brun
Cstart
Dbuild
Attempts:
3 left
💡 Hint
Common Mistakes
Using commands like 'run' or 'start' instead of the container name.
Forgetting to specify the container name.
2fill in blank
medium

Complete the command to follow the logs of a container named 'dbserver' in real-time.

Docker
docker logs [1] dbserver
Drag options to blanks, or click blank then click option'
A-f
Brun
C--tail
D--help
Attempts:
3 left
💡 Hint
Common Mistakes
Using '--tail' instead of '-f' to follow logs.
Using 'run' which starts a container instead of viewing logs.
3fill in blank
hard

Fix the error in the command to show the last 50 lines of logs for container 'api'.

Docker
docker logs --tail=[1] api
Drag options to blanks, or click blank then click option'
A100
Bnone
Call
D50
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'all' or 'none' which are invalid values for --tail.
Using a number other than 50 when the question asks for 50 lines.
4fill in blank
hard

Fill both blanks to limit logs to last 20 lines and follow new logs for container 'cache'.

Docker
docker logs [1] 20 [2] cache
Drag options to blanks, or click blank then click option'
A--tail
B-f
C--follow
D--since
Attempts:
3 left
💡 Hint
Common Mistakes
Using --since instead of -f to follow logs.
Mixing up the order of options.
5fill in blank
hard

Fill all three blanks to show logs since 10 minutes ago, limit to 100 lines, and follow logs for container 'frontend'.

Docker
docker logs [1] 10m [2] 100 [3] frontend
Drag options to blanks, or click blank then click option'
A--since
B--tail
C-f
D--timestamps
Attempts:
3 left
💡 Hint
Common Mistakes
Using --timestamps instead of -f to follow logs.
Mixing up the order of options or missing one.