Which command in a Dockerfile selects the base image?

Prepare for the Cisco Certified DevNet Associate Exam. Use flashcards and multiple choice questions to boost your knowledge, with hints and explanations to guide you. Ace your exam effectively!

The command in a Dockerfile that selects the base image is "FROM." This command specifies the initial environment which your container will use. The base image can be an official image from Docker Hub, such as a specific version of Ubuntu, Node.js, or Python, or it can refer to a custom image that you or someone else has created.

When the Docker engine processes the Dockerfile, the FROM command is the first directive that runs, establishing the foundational layer upon which all other instructions will build. This foundational layer includes the operating system and any software that is included in that image, determining the starting point of the containerized application.

In contrast, the MAINTAINER command is used for declaring the author of the Dockerfile, RUN is used to execute commands during the image build (such as installing software), and ENTRYPOINT is used to specify the command that will be run when a container is started from the image. Each of these plays a different role in the Dockerfile's structure, while FROM is critically important as it sets the stage for what the container will ultimately include and function as.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy