ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 98 - XK0-005 discussion

Report
Export

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
Answers
A.
docker cp container_id/deployment.yaml deployment.yaml
B.
docker cp container_id:/deployment.yaml deployment.yaml
Answers
B.
docker cp container_id:/deployment.yaml deployment.yaml
C.
docker cp deployment.yaml local://deployment.yaml
Answers
C.
docker cp deployment.yaml local://deployment.yaml
D.
docker cp container_id/deployment.yaml local://deployment.yaml
Answers
D.
docker cp container_id/deployment.yaml local://deployment.yaml
Suggested 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.

asked 02/10/2024
MYKEL PERRY
38 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first