Docker and CI/CD · Junior · Question 12 of 75
How do you read the output of a running container?
- 1
cat /var/log/docker/<container> - 2
docker inspect --output <container> - ✓Correct answer:
docker logs <container>
Explanation
Docker captures the container's stdout and stderr. Add -f to follow and --tail 100 for recent lines. That's why apps in containers should log to stdout.