nerdexam
CompTIA

XK0-005 · Question #454

A cloud engineer is asked to copy the file deployment.yaml from a container to the host where the container is running. Which of the following commands can accomplish this task?

The correct answer is B. docker cp container_id:/deployment.yaml deployment.yaml. The command docker cp container_id:/deployment.yaml deployment.yaml can accomplish the task of copying the file deployment.yaml from a container to the host. The docker command is a tool for managing Docker containers and images. The cp option copies files or directories…

Scripting, Containers, and Automation

Question

A cloud engineer is asked to copy the file deployment.yaml from a container to the host where the container is running. Which of the following commands can accomplish this task?

Options

  • Adocker cp container_id/deployment.yaml deployment.yaml
  • Bdocker cp container_id:/deployment.yaml deployment.yaml
  • Cdocker cp deployment.yaml local://deployment.yaml
  • Ddocker cp container_id/deployment.yaml local://deployment.yaml

How the community answered

(42 responses)
  • A
    2% (1)
  • B
    90% (38)
  • C
    5% (2)
  • D
    2% (1)

Explanation

The command docker cp container_id:/deployment.yaml deployment.yaml can accomplish the task of copying the file deployment.yaml from a container to the host. The docker command is a tool for managing Docker containers and images. The cp option copies files or directories between a container and the local filesystem. The container_id is the identifier of the container, which can be obtained by using the docker ps command. The /deployment.yaml is the path of the file in the container, which must be preceded by a slash. The deployment.yaml is the path of the file on the host, which can be relative or absolute. The command docker cp container_id:/deployment.yaml deployment.yaml will copy the file deployment.yaml from the container to the current working directory on the host.

Topics

#Docker#Container Management#File Transfer#CLI Commands

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice