nerdexam
Cisco

350-901 · Question #35

Refer to the exhibit. Drag and drop the correct parts of the Dockerfile from the left onto the item numbers on the right to complete the Dockerfile to successfully build and deploy a container…

This question tests knowledge of Dockerfile instruction syntax and the correct order of directives needed to containerize a Python application. Each numbered item is a value/argument that must be paired with its correct Dockerfile keyword.

Application Deployment and Security

Question

Refer to the exhibit. Drag and drop the correct parts of the Dockerfile from the left onto the item numbers on the right to complete the Dockerfile to successfully build and deploy a container running a Python application. Not all parts of the Dockerfile are used.```dockerfile <item 1> python:3.6-alpine <item 2> . <item 3> pip install -r requirements.txt <item 4> 5001 <item 5> ["python", "app.py"]

Explanation

This question tests knowledge of Dockerfile instruction syntax and the correct order of directives needed to containerize a Python application. Each numbered item is a value/argument that must be paired with its correct Dockerfile keyword.

Approach. A properly structured Python Dockerfile follows a specific layered sequence. Item 1 (python:3.6-alpine) pairs with FROM - it defines the base image. Item 2 (.) pairs with COPY to copy application source files into the container (typically 'COPY . .'). Item 3 (pip install -r requirements.txt) pairs with RUN to execute the dependency installation command during the build. Item 4 (5001) pairs with EXPOSE to declare the port the application listens on. Item 5 (['python', 'app.py']) uses exec-form JSON array syntax and pairs with CMD to define the default container startup command. The complete Dockerfile reads: FROM → COPY → RUN → EXPOSE → CMD.

Concept tested. Dockerfile instruction keywords and their arguments - specifically FROM (base image), COPY (file transfer into image), RUN (build-time command execution), EXPOSE (port declaration), and CMD (default container entrypoint) - and how they combine to build and deploy a containerized Python application.

Reference. Docker Documentation: Dockerfile reference - https://docs.docker.com/engine/reference/builder/

Topics

#Dockerfile#Containerization#Python application deployment#Docker

Community Discussion

No community discussion yet for this question.

Full 350-901 Practice