Q: 8
An organization has multiple containers and wants to view STDIN, STDOUT, and STDERR I/O streams
of a specific container.
What command should be used?
Options
Discussion
C . Only
docker logs gives you STDOUT and STDERR from the container, the others are for stats, process info or config details. Not 100 percent on the STDIN part but C matches most exam reports.C . Only docker logs CONTAINER-NAME will show you STDOUT and STDERR for a specific container, that's what they're after here.
C tbh, "inspect" (D) looks good at first but that's more config info. Only C actually displays the output streams requested. They probably put STDIN in as a trick.
Yeah C, docker logs CONTAINER-NAME is how you view STDOUT/STDERR for a container. Pretty sure that's what they're after here.
Option D I was thinking
docker inspect shows everything about the container, so you might find the logs there. Not 100% sure, maybe missing something obvious with inspect output. If anyone has tried this recently let me know.C all day, docker logs is how you pull STDOUT/STDERR from a running container. The others don't actually show the output, just stats or info. Not 100% on STDIN but I think this is what they're after. Agree?
Not sure I agree with everyone jumping straight to C. D is tempting since inspect gives a ton of details, but only C (docker logs) shows STDOUT and STDERR by default. Maybe "STDIN" in the question is a trap. Going with C.
Its C, docker logs lets you check STDOUT/STDERR for the container. Other commands won't show those output streams directly.
Not B, C. Only docker logs can show STDOUT and STDERR output for a specific container.
C, Not totally sure because if they wanted to see all streams live including STDIN, maybe something else is needed, but for STDOUT/STDERR logs
docker logs does the job. Anyone disagree?Be respectful. No spam.