A systems administrator needs to investigate an issue in a Docker container that is failing to start correctly. The administrator wishes to view the output logs to diagnose the problem. Which command should the administrator run to display the last 50 lines of logs from the container named 'web-app'?
The correct answer is docker logs --tail 50 web-app. The --tail option with the docker logs command allows the user to view the specified number of most recent lines from the container's logs, making it an appropriate choice for checking recent activity or errors that could lead to understanding the issue with the container.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the purpose of the 'docker logs' command?
Open an interactive chat with Bash
What does the '--tail' option do in the 'docker logs' command?
Open an interactive chat with Bash
How does 'docker logs' differ from 'docker inspect'?