200-901 Application Deployment and Security Practice Question
You are writing a Dockerfile for a Python application. Which instruction should you use to install the dependencies from a requirements.txt file?
⚠ Common exam trap
Cisco often tests the distinction between build-time instructions (RUN) and runtime instructions (CMD, ENTRYPOINT), and the trap here is that candidates confuse CMD or ENTRYPOINT with RUN, thinking they can install dependencies at container startup instead of during the image build.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
RUN pip install -r requirements.txt
The RUN instruction executes commands in a new layer on top of the current image and commits the results. Using RUN pip install -r requirements.txt ensures that the Python dependencies are installed during the image build process, making them part of the final image. This is the correct approach because dependencies should be installed at build time, not at container runtime.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
ENTRYPOINT pip install -r requirements.txt
Why it's wrong here
ENTRYPOINT defines the container's entrypoint at runtime, not for build-time installation.
- ✗
CMD pip install -r requirements.txt
Why it's wrong here
CMD is used at runtime, not during build; it would not install dependencies at build time.
- ✓
RUN pip install -r requirements.txt
Why this is correct
This command installs all dependencies listed in requirements.txt.
Go deeper
Related to this question
About these practice questions
This 200-901 question is part of Courseiva's 989-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 200-901 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 200-901 exam.