EX200 Manage containers Practice Question
An administrator needs to ensure that a container always runs with a specific SELinux context for security reasons. The container uses a volume mount from the host. Which command should be used to start the container?
⚠ Common exam trap
Watch out — candidates often confuse `--label` (for metadata) with SELinux labeling, or assume `--privileged` is a quick fix for SELinux issues, but the exam specifically tests the correct `--security-opt label=type:` syntax for setting SELinux contexts in Podman.
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
✓
podman run --security-opt label=type:container_t -v /host/data:/data myimage
`--security-opt label=type:container_t` explicitly sets the SELinux type for the container process to `container_t`, ensuring the container runs with the required SELinux context. This is the proper way to assign a specific SELinux type when using `podman run`, especially when volume mounts are involved, as it avoids permission conflicts with the host's SELinux policy.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
podman run --label selinux_context=container_t -v /host/data:/data myimage
Why it's wrong here
The `--label` flag is intended for attaching key-value metadata to the container, such as version or description, which is stored in the container's configuration and exposed via `podman inspect`. It does not interact with SELinux labeling at all; `selinux_context` is not a recognized label key for security purposes. SELinux contexts are controlled through the `--security-opt label=` options, not via metadata labels.
- ✗
podman run --privileged -v /host/data:/data myimage
Why it's wrong here
The `--privileged` flag disables SELinux separation entirely for the container, turning off the `container_t` type enforcement and other isolation mechanisms, which is a significant security risk. It also grants all capabilities and access to host devices, effectively bypassing the very SELinux controls you might want to enforce. For a task where the goal is to ensure the container runs with a specific SELinux context, this option is the opposite of a targeted security setting.
- ✗
podman run --selinux-context container_t -v /host/data:/data myimage
Why it's wrong here
`--selinux-context` is not a valid `podman run` command-line option, so the command would immediately fail with an unknown flag error. Even if the flag were accepted, specifying a bare type like `container_t` without the `label=` prefix structure would not be how SELinux policy is applied. The correct syntax requires the `--security-opt` option with `label=type:` as a prefix to the SELinux type.
- ✓
podman run --security-opt label=type:container_t -v /host/data:/data myimage
Why this is correct
`--security-opt label=type:container_t` directly instructs the container runtime to apply the SELinux type `container_t` to the container's processes and files, which is the proper way to set a SELinux context in Podman. This option is processed by the OCI runtime and translates into the appropriate SELinux labeling call, ensuring the container is confined by the targeted policy. It is the correct method because it leverages the intended `security-opt` mechanism for SELinux type selection.
Go deeper
Related to this question
About these practice questions
One of 427 original EX200 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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This EX200 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 EX200 exam.