nerdexam
CiscoCisco

200-901 · Question #83

200-901 Question #83: Real Exam Question with Answer & Explanation

This question tests the understanding of fundamental Dockerfile instructions by requiring the test-taker to match common Dockerfile commands to their correct descriptions.

Application Deployment and Security

Question

Drag and Drop Question Drag and drop the Docker file instructions from the left onto the correct descriptions on the right. Not all options are used. Answer:

Explanation

This question tests the understanding of fundamental Dockerfile instructions by requiring the test-taker to match common Dockerfile commands to their correct descriptions.

Approach. The correct interaction involves dragging each Dockerfile instruction from the left side (blue boxes in the first image) to its accurate description on the right side (yellow boxes in the first image). The correct pairings are:

  1. FROM ubuntu:12.04 should be dragged to 'must be the first instruction in the Docker file'. The FROM instruction specifies the base image from which subsequent instructions build upon and is always the first instruction in a Dockerfile, excluding comments.

  2. VOLUME ["/var/www", "/var/log/apache2", "/etc/apache2"] should be dragged to 'creates a mount point with the specified name'. The VOLUME instruction creates a mount point with the specified name and marks it as holding externally mounted volumes from the native host or other containers. It's used for persisting or sharing data.

  3. RUN apt-get update && apt-get install -y --force-yes apache2 remains unmatched. This instruction executes commands during the image build process to install packages or configure the image, but there is no corresponding description provided among the options.

  4. ENTRYPOINT ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] should be dragged to 'configures a container that runs as an executable'. The ENTRYPOINT instruction configures a container that will run as an executable. It defines the primary command that will always be executed when the container starts.

  5. EXPOSE 1521 should be dragged to 'informs Docker that the container listens on the specified network port(s) at runtime'. The EXPOSE instruction informs Docker that the container listens on the specified network port(s) at runtime. It's a documentation mechanism within the image.

Common mistakes.

  • common_mistake. A common mistake would be to misinterpret the purpose of each instruction. For example, confusing ENTRYPOINT with RUN or CMD (if CMD were an option) could lead to an incorrect match. Attempting to match the 'RUN' instruction to one of the descriptions would also be incorrect, as 'Not all options are used' is specified, and there isn't a description that accurately fits 'RUN' among the choices provided. Another error would be placing EXPOSE with VOLUME, or ENTRYPOINT with FROM, demonstrating a lack of understanding of the specific function of each Dockerfile instruction. Incorrectly associating the 'VOLUME' instruction with network ports instead of data persistence, or 'EXPOSE' with creating mount points, are also typical errors.

Concept tested. The core concept being tested is the understanding of fundamental Dockerfile instructions and their specific roles in defining and building a Docker image. This includes knowledge of base images (FROM), command execution during build (RUN), exposing ports (EXPOSE), data persistence (VOLUME), and defining the container's main executable (ENTRYPOINT).

Reference. null

Topics

#Docker#Dockerfile#Containerization#Application Deployment

Community Discussion

No community discussion yet for this question.

Full 200-901 PracticeBrowse All 200-901 Questions