Courseiva
Application Deployment and SecuritymediumMultiple ChoiceObjective-mapped

200-901 Application Deployment and Security Practice Question

A developer is writing a Dockerfile for a Node.js application. The application uses environment variables for configuration. Which Dockerfile instruction should be used to set a default value for the NODE_ENV variable?

⚠ Common exam trap

Cisco often tests the distinction between build-time (ARG) and runtime (ENV) instructions, and the trap here is that candidates confuse ARG with ENV because both can set default values, but only ENV persists into the running container.

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

ENV NODE_ENV=production

The ENV instruction sets environment variables that persist in the container at runtime, making it the appropriate way to define a default value for NODE_ENV that can be overridden later with `docker run -e`. Unlike shell-level exports or build-time-only ARGs, ENV ensures the variable is available to the Node.js process when the container starts.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • RUN export NODE_ENV=production

    Why it's wrong here

    Incorrect. RUN export does not persist across layers.

  • ARG NODE_ENV=production

    Why it's wrong here

    Incorrect. ARG is for build-time variables, not persisted in the final image.

  • ENV NODE_ENV=production

    Why this is correct

    Correct. ENV sets environment variables that persist in the container.

  • CMD NODE_ENV=production

    Why it's wrong here

    Incorrect. CMD sets the command, not environment variables.

About these practice questions

One of 989 original 200-901 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.