CompTIA Linux+ (XK0-005) — Question 146

A systems administrator needs to verify whether the built container has the app.go file in its root directory. Which of the following can the administrator use to verify the root directory has this file?

Answer options

Correct answer: C

Explanation

The correct answer is C, as the 'docker exec <container_name> ls' command allows the administrator to execute a command inside the running container to list files in its root directory. Option A, 'docker image inspect', inspects the image but does not allow checking the file structure in a running container. Option B, 'docker container inspect', provides details about the container but does not show file contents. Option D, 'docker ps <container_name>', is used to list running containers and does not provide file information.