Which of the following commands can accomplish this task?
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?
A . docker cp container_id/deployment.yaml deployment.yaml
B . docker cp container_id:/deployment.yaml deployment.yaml
C . docker cp deployment.yaml local://deployment.yaml
D . docker cp container_id/deployment.yaml local://deployment.yaml
Answer: B
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. This is the correct command to use to accomplish the task. The other options are incorrect because they either use the wrong syntax (docker cp container_id/deployment.yaml deployment.yaml or docker cp container_id/deployment.yaml local://deployment.yaml) or do not exist (docker cp deployment.yaml local://deployment.yaml).
Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 19: Managing Cloud and Virtualization Technologies, page 567.
Latest XK0-005 Dumps Valid Version with 136 Q&As
Latest And Valid Q&A | Instant Download | Once Fail, Full Refund