200-901 · Question #413
Drag and Drop Question Refer to the exhibit. Drag and drop the Dockerfile contents from the left onto the functions on the right that create a container image to run traceroute to track network path…
The correct answer is FROM ubuntu; MAINTAINER User One ([email protected]); RUN apt-get update && apt-get install traceroute. The question requires matching Dockerfile instructions like FROM, MAINTAINER, and RUN to their correct functions in the container image build process.
Question
Drag and Drop Question Refer to the exhibit. Drag and drop the Dockerfile contents from the left onto the functions on the right that create a container image to run traceroute to track network path to specific targets. Not all options are used. Answer:
Exhibit
Answer Area
Drag items
Correct arrangement
- FROM ubuntu
- MAINTAINER User One ([email protected])
- RUN apt-get update && apt-get install traceroute
Explanation
The question requires matching Dockerfile instructions like FROM, MAINTAINER, and RUN to their correct functions in the container image build process.
Approach. To correctly answer this question, the test-taker must understand the purpose of common Dockerfile instructions:
- FROM ubuntu: The 'FROM' instruction specifies the base image to use for subsequent instructions. It is always the first instruction (excluding ARG) and effectively 'Initializes a new build stage' by defining the starting environment.
- MAINTAINER User One ([email protected]): The 'MAINTAINER' instruction sets the Author field of the generated image. Therefore, it corresponds to 'document author'. (Note: While 'MAINTAINER' is a legacy instruction and 'LABEL' is preferred for metadata, it still performs this function).
- RUN apt-get update && apt-get install traceroute: The 'RUN' instruction executes any commands in a new layer on top of the current image and commits the results. In this case, it's used to run system commands to update package lists and install software. Thus, it is the 'command to execute'.
The correct drag-and-drop pairings are:
- 'FROM ubuntu' -> 'Initializes a new build stage'
- 'MAINTAINER User One ([email protected])' -> 'document author'
- 'RUN apt-get update && apt-get install traceroute' -> 'command to execute'
Common mistakes.
- common_mistake. Common mistakes include confusing the purpose of 'RUN' with 'CMD' or 'ENTRYPOINT' (which define the command to execute when the container starts, not during build), or misunderstanding 'FROM' as merely selecting an OS rather than establishing the initial build context. Incorrectly associating 'FROM' with 'command to execute' or 'MAINTAINER' with 'Initializes a new build stage' would demonstrate a lack of fundamental understanding of Dockerfile structure and instruction roles. The options 'copies new files or directories' (which relates to COPY/ADD) and 'sets the user id' (which relates to USER) are distractors and are not used by the provided Dockerfile instructions.
Concept tested. This question tests the understanding of fundamental Dockerfile instructions (FROM, MAINTAINER, RUN) and their specific roles in creating a Docker image. It assesses knowledge of the Docker image build process and the syntax and semantics of key Dockerfile commands.
Topics
Community Discussion
No community discussion yet for this question.
