nerdexam
CompTIA

XK0-005 · Question #412

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…

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…

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>

How the community answered

(26 responses)
  • A
    4% (1)
  • B
    4% (1)
  • C
    85% (22)
  • D
    8% (2)

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#CLI

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice