Courseiva
Container Image BuildingmediumMultiple ChoiceObjective-mapped

EX188 Container Image Building Practice Question

When writing a Containerfile, what is the difference between shell form and exec form for the CMD instruction?

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

Exec form runs the executable directly without invoking a shell, making it receive Unix signals (like SIGTERM) properly as PID 1.

Exec form runs the command directly without a shell, whereas shell form runs the command inside a subshell (/bin/sh -c).

Answer analysis

Option-by-option breakdown

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

  • There is no functional difference; they are syntactic aliases.

    Why it's wrong here

    They handle signal propagation and argument parsing completely differently.

  • Exec form runs the executable directly without invoking a shell, making it receive Unix signals (like SIGTERM) properly as PID 1.

    Why this is correct

    Exec form executes the binary directly as process 1, allowing proper signal handling.

  • Shell form is required for multi-stage builds, while exec form is for single-stage builds.

    Why it's wrong here

    Form choice has no relation to single or multi-stage builds.

  • Shell form runs the command as PID 1, while exec form spawns a bash shell wrapper.

    Why it's wrong here

    It is the opposite; exec form runs directly as PID 1.

About these practice questions

This EX188 question is part of Courseiva's 301-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 →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed August 2026 · checked against the official Red Hat exam blueprint

This EX188 practice question is part of Courseiva's free Red Hat 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 EX188 exam.