103k views
0 votes
How do you copy an image called 'httpd' from the default image repository?

A) docker pull httpd

B) docker copy httpd

C) docker cp httpd

D) docker get httpd

User Lenik
by
8.0k points

1 Answer

1 vote

Final answer:

To copy an image called 'httpd' from the default Docker repository, the correct command is docker pull httpd. Options B, C, and D are invalid Docker commands for this purpose.

Step-by-step explanation:

The correct way to copy an image called 'httpd' from the default image repository in Docker is to use the command docker pull httpd.

This command tells Docker to reach out to the default Docker Hub repository and pull the image labeled 'httpd' onto your local machine.

The 'pull' command in Docker is analogous to 'clone' in git or 'download' in many other contexts.

It does not simply copy an image between locations on your local machine but instead fetches an image from a remote repository to your local environment.

The options B) docker copy httpd and D) docker get httpd are incorrect because they are not valid Docker commands.

C) docker cp httpd does exist as a command but it is for copying files and directories between a container and the local filesystem, not for pulling images from a repository.

User Thomas Shields
by
8.2k points