XK0-005 · Question #1449
XK0-005 Question #1449: Real Exam Question with Answer & Explanation
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 between
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
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
Community Discussion
No community discussion yet for this question.