nerdexam
CompTIACompTIA

XK0-005 · Question #1407

XK0-005 Question #1407: Real Exam Question with Answer & Explanation

The correct answer is C: docker exec <container_name> ls. The docker exec <container_name> ls command can be used to verify whether the built container has the app.go file in its root directory. This command will run the ls command inside the specified container and list the files and directories in its root directory. If the app.go fil

Scripting, Containers, and Automation

Question

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?

Options

  • Adocker image inspect
  • Bdocker container inspect
  • Cdocker exec <container_name> ls
  • Ddocker ps <container_name>

Explanation

The docker exec <container_name> ls command can be used to verify whether the built container has the app.go file in its root directory. This command will run the ls command inside the specified container and list the files and directories in its root directory. If the app.go file is present, it will be displayed in the output. The docker image inspect command will display information about an image, not a container, and it will not list the files inside the image. The docker container inspect command will display information about a container, not its files. The docker ps <container_name> command is invalid, as ps does not accept a container name as an

Topics

#Docker#Container management#docker exec#Filesystem inspection

Community Discussion

No community discussion yet for this question.

Full XK0-005 PracticeBrowse All XK0-005 Questions