Free practice · No sign-up required

Red Hat Certified Specialist in Containers free practice test

15 questions with answer explanations. Choose an answer below to begin.

Question 1 of 15

Which command starts a basic interactive shell inside a running container?

Show hint

Working with containers

0/15 answered · Bookmark questions to review later. Focus the practice area to use keys 1–9 and Enter.

Learn by doing

Put your answers into practice

Use official documentation and hands-on labs to work through topics you missed.

Explore all study resources →

All questions and explanations

Prefer to read at your own pace? Work through each question below, then open its answer to check your reasoning. You can link directly to a question or print this reference.

  1. Which command starts a basic interactive shell inside a running container?

    1. podman exec -it /bin/sh

    2. podman run -it /bin/sh

    3. podman attach

    4. podman start

    Show answer and explanation

    Correct answer

    • podman exec -it /bin/sh

    The podman exec command runs a new process in a running container, and -it provides an interactive terminal. This is the standard way to open a shell inside an existing container.

  2. What is the primary purpose of a container image registry?

    1. To store and distribute container images

    2. To compile source code into binaries

    3. To monitor container performance metrics

    4. To manage user access to the host OS

    Show answer and explanation

    Correct answer

    • To store and distribute container images

    A container image registry serves as a repository where container images are stored and made available for deployment. Common examples include registries.redhat.io and local registries.

  3. Which file is commonly used to define the build instructions for a container image?

    1. Dockerfile

    2. Makefile

    3. compose.yaml

    4. settings.json

    Show answer and explanation

    Correct answer

    • Dockerfile

    A Dockerfile contains a series of instructions that automate the creation of a container image. It specifies the base image, copies files, and defines runtime commands.

  4. Which command pulls an image from a remote registry to the local system?

    1. podman pull

    2. podman fetch

    3. podman get

    4. podman download

    Show answer and explanation

    Correct answer

    • podman pull

    The podman pull command downloads a container image and its layers from a registry to the local storage, making it available for local use.

  5. What is a common use case for container volumes?

    1. To persist data generated by and used by containerized applications

    2. To increase CPU speed for container processes

    3. To replace the container's base image

    4. To encrypt container network traffic

    Show answer and explanation

    Correct answer

    • To persist data generated by and used by containerized applications

    Volumes provide a way to persist data beyond the lifecycle of a container and to share data between containers. They map host directories into the container filesystem.

  6. Which statement best describes a container image layer?

    1. Each layer represents a set of filesystem changes and is typically immutable

    2. Layers are executable binaries that run in sequence during boot

    3. Layers are user accounts defined inside the container

    4. Layers are network segments used for container communication

    Show answer and explanation

    Correct answer

    • Each layer represents a set of filesystem changes and is typically immutable

    Container images are built in layers, where each layer adds files or modifies the filesystem. These layers are stacked and are generally immutable, supporting image reuse and efficient distribution.

  7. What is the default behavior of a container when the main process exits?

    1. The container stops

    2. The container restarts automatically

    3. The container enters a paused state

    4. The container logs the event and continues

    Show answer and explanation

    Correct answer

    • The container stops

    Containers are designed to run a single foreground process. When that process terminates, the container lifecycle ends and the container stops.

  8. Which tool is commonly used to manage container images and build workflows programmatically?

    1. Buildah

    2. grep

    3. tar

    4. ssh

    Show answer and explanation

    Correct answer

    • Buildah

    Buildah is a command-line tool that facilitates building OCI container images and managing image workflows without requiring a daemon, aligning with Red Hat tooling.

  9. What does a container port mapping do?

    1. Links a container's network port to a port on the host system

    2. Encrypts data between containers

    3. Assigns a permanent hostname to the container

    4. Increases the container's CPU quota

    Show answer and explanation

    Correct answer

    • Links a container's network port to a port on the host system

    Port mapping connects a service running inside a container to a port on the host, enabling external access to the containerized application.

  10. Question 10

    Link to question

    Which command lists all running containers on a system?

    1. podman ps

    2. podman list

    3. podman status

    4. podman show

    Show answer and explanation

    Correct answer

    • podman ps

    The podman ps command displays information about currently running containers, including their IDs, names, and status.

  11. Question 11

    Link to question

    What is a typical use of a container health check?

    1. To verify that the application inside the container is responding as expected

    2. To measure the physical temperature of the host server

    3. To update the container image automatically

    4. To change container user permissions at runtime

    Show answer and explanation

    Correct answer

    • To verify that the application inside the container is responding as expected

    Health checks allow the system to determine if a container is functioning correctly, often by probing an endpoint or command within the container.

  12. Question 12

    Link to question

    Which of the following is a benefit of using immutable infrastructure patterns with containers?

    1. Simplifies rollback by replacing containers rather than modifying them

    2. Reduces the need for container images

    3. Eliminates the use of container registries

    4. Increases the size of container images significantly

    Show answer and explanation

    Correct answer

    • Simplifies rollback by replacing containers rather than modifying them

    Immutable infrastructure treats containers as disposable; to update a service, you deploy a new container instance instead of modifying the existing one, improving reliability and traceability.

  13. Question 13

    Link to question

    What is the purpose of a container entrypoint?

    1. To define the default command executed when the container starts

    2. To store persistent configuration files

    3. To manage network bandwidth allocation

    4. To control container image compression

    Show answer and explanation

    Correct answer

    • To store persistent configuration files

    An entrypoint defines the executable that runs when a container starts, providing a default command that can be overridden at runtime.

  14. Question 14

    Link to question

    Which practice helps ensure container images are built from verified sources?

    1. Using signed images and image scanning

    2. Disabling all container networking

    3. Storing images only on local disks

    4. Avoiding the use of container volumes

    Show answer and explanation

    Correct answer

    • Using signed images and image scanning

    Signed images and vulnerability scanning help verify the integrity and security of container images before deployment, which is critical in production environments.

  15. Question 15

    Link to question

    Which command configures a container to restart automatically unless it is stopped explicitly?

    1. docker run --restart always

    2. docker update --restart=on-failure

    3. docker container start --policy always

    4. docker service update --restart-condition any

    Show answer and explanation

    Correct answer

    • docker run --restart always

    The --restart always flag ensures a container restarts automatically unless it is stopped manually.

Read all flashcards

Recall the answer before opening each card.

Which command opens an interactive shell inside a running container?

podman exec -it /bin/sh (or docker exec -it /bin/sh) starts a new process in a running container with an interactive terminal.

What is the primary purpose of a container image registry?

To store and distribute container images. Registries like registries.redhat.io host images for download and deployment.

What file defines container image build instructions?

A Dockerfile contains instructions such as FROM, COPY, and RUN to automate image creation.

Which command pulls an image from a remote registry?

podman pull (or docker pull) downloads an image and its layers from a registry to local storage.

What is a common use for container volumes?

To persist data generated by and used by containerized applications beyond the container's lifecycle.

How are container image layers described?

Each layer represents a set of filesystem changes and is typically immutable; layers stack to form the final image.

What happens when a container's main process exits?

The container stops because containers are designed to run a single foreground process; its exit ends the lifecycle.

Which tool manages container images and builds programmatically without a daemon?

Buildah facilitates building OCI images and managing image workflows without requiring a daemon.

What does container port mapping do?

It links a container's network port to a host port, enabling external access to containerized services.

Which command lists all running containers?

podman ps (or docker ps) shows running containers with IDs, names, and status.

What is a typical use of a container health check?

To verify that the application inside the container is responding as expected, often by probing an endpoint.

What benefit does immutable infrastructure provide?

It simplifies rollback by replacing containers rather than modifying them, improving reliability and traceability.

What is the purpose of a container entrypoint?

It defines the executable that runs when a container starts, providing a default command that can be overridden.

Which practice ensures container images come from verified sources?

Using signed images and image scanning helps verify integrity and security before deployment.

Which flag configures a container to restart automatically unless stopped explicitly?

--restart always (e.g., docker run --restart always) ensures the container restarts unless manually stopped.

What command stops a running container immediately?

podman stop (or docker stop) sends a SIGTERM, then SIGKILL after a grace period.

How do you remove a container after it stops?

Use podman rm (or docker rm). Add the -f flag to force remove a running container.

What is the difference between a volume and a bind mount?

Volumes are managed by Podman and stored in a host directory under /var/lib/containers; bind mounts map any host path into the container.

What does the FROM instruction do in a Dockerfile?

It sets the base image for subsequent instructions, starting the image build from an existing image.

How can you expose a container's port to the host without publishing?

Use the EXPOSE instruction in a Dockerfile to document ports, but it does not publish them; -p is needed for publishing.

Active recall deck

Practice Red Hat Certified Specialist in Containers with real flashcards

Read the prompt, commit to an answer, then flip the card. Move through the deck at your own pace and repeat any topic that does not come back quickly.

20 free cards

Card 1 of 20

1 reviewed this session

Connect the concepts

Your Red Hat Certified Specialist in Containers study mind map

Open a branch to connect a topic with its practice questions and explanations. Use the map to choose your next review topic.

Exam-focused analysis

What this Red Hat Certified Specialist in Containers practice set measures

This is an analysis of the practice bank, not a claim about the vendor's live exam blueprint. Use it to identify the knowledge, judgment, and recall patterns exercised here, then verify your coverage against the current official exam guide.

Container Fundamentals

This section covers the foundational concepts that underpin container technology. You should understand that containers are ephemeral by design—when the main process exits, the container stops. Immutable infrastructure patterns promote replacing containers rather than modifying them, simplifying rollbacks. A container image is built from layers, each representing a set of filesystem changes, typically immutable. The primary purpose of a container image registry is to store and distribute images, enabling reproducibility across environments. These principles are essential for the Red Hat Certified Specialist in Containers exam.

  • Containers stop when the main process exits (default behavior).
  • Immutable infrastructure improves reliability by deploying new containers instead of patching running ones.
  • Image layers are stacked, immutable filesystem changes that support caching and reuse.
  • A registry stores and distributes container images, e.g., registries.redhat.io.

Working with Containers

Proficiency with container commands is tested through practical scenarios. The practice bank emphasizes podman commands, which align with Red Hat’s container tooling. Use podman exec -it /bin/sh to start an interactive shell inside a running container. List all running containers with podman ps. To download an image from a remote registry, execute podman pull. For building images, Dockerfile remains the standard definition file. Buildah is a tool for programmatic image management without a daemon. These commands form the day-to-day workflow of a container specialist.

  • podman exec -it /bin/sh opens an interactive shell in a running container.
  • podman ps lists all currently running containers.
  • podman pull downloads an image from a registry to local storage.
  • Dockerfile defines image build instructions; Buildah manages image builds without a daemon.

Container Lifecycle and Health Management

Understanding container lifecycle is critical for reliable deployments. An entrypoint defines the initial executable that runs when a container starts. Health checks verify the application inside is responding as expected, enabling automated recovery. Restart policies configure automatic restarts unless explicitly stopped; e.g., docker run --restart always ensures the container restarts on failure or reboot. The practice bank tests these features, reinforcing that containers are managed as ephemeral units that require careful lifecycle policies.

  • Entrypoint sets the default executable for a container, overridable at runtime.
  • Health checks probe container status to confirm application responsiveness.
  • Restart policies like --restart always automatically restart the container unless stopped manually.
  • Containers stop when the main process exits; this is the default lifecycle termination.

Storage and Networking

Containers require persistent storage and external connectivity. Container volumes persist data beyond container lifecycles and allow sharing between containers by mapping host directories into the container filesystem. Port mapping links a container’s internal port to a host port, enabling external access to containerized services. The practice bank covers these topics to ensure you can manage data persistence and network exposure. Production environments often rely on volumes for stateful applications and port mapping for service accessibility.

  • Volumes persist data across container restarts and removals by mapping host directories.
  • Port mapping (e.g., -p 8080:80) exposes a container port on the host.
  • Volumes are useful for database storage, logs, and configuration files.
  • Health checks and restart policies complement storage and networking for robust deployments.

Study workflow

Turn one Red Hat Certified Specialist in Containers attempt into a study plan

  1. 1

    Practice Core Commands

    Run through each podman and docker command from the practice bank multiple times. Use podman exec -it <container> /bin/sh to open a shell, podman ps to list containers, and podman pull to download images. Ensure you understand the flags and output.

  2. 2

    Understand Image Layers and Registries

    Build a simple Dockerfile with multiple RUN commands. Observe how each command creates a new layer. Then push the image to a local registry using podman push. This solidifies the concept of layers and registry interaction.

  3. 3

    Set Up a Container with Persistence and Ports

    Run a container like podman run -d -v /host/data:/container/data -p 8080:80 nginx. Verify that data persists after container removal and that the web server is accessible on localhost:8080. This ties volumes and port mapping together.

  4. 4

    Test Lifecycle Features: Health Checks and Restart Policies

    Create a container with --restart always and a HEALTHCHECK instruction. Stop the container’s main process manually and observe automatic restart. Then deliberately crash the application to see the health check status change. This reinforces failover behavior.

  5. 5

    Explore Buildah for Image Building

    Use Buildah to create a container from a base image, copy files, and commit a new image. Compare the workflow with a Dockerfile build. Buildah is a key Red Hat tool for scripted image creation without a daemon.

FAQ

Questions about this exam practice page

Clear boundaries on what the bank covers, how to use it, and where official vendor information still matters.

What is the difference between podman exec and podman run?+

podman run creates and starts a new container from an image. podman exec runs a new process in an already running container, often used to open a shell or debug an existing container.

How does Red Hat's container tooling differ from Docker?+

Red Hat promotes Podman, Buildah, and Skopeo as daemonless alternatives to Docker. Podman commands are mostly compatible with Docker CLI but run without a central daemon, improving security and rootless operation.

Why would I use a container volume instead of copying data into an image?+

Volumes decouple data from the image lifecycle. They persist when the container is removed, allow sharing data between containers, and are ideal for stateful applications like databases. Copying data into an image makes it part of the immutable image, which is not suitable for dynamic data.

What is the best restart policy for a critical production service?+

For a service that must always be running, use --restart always (or its Podman equivalent). This ensures the container restarts automatically on failure, host reboot, or even after a manual stop unless explicitly removed.

Can I use a Dockerfile with Podman or Buildah?+

Yes, Podman and Buildah support Dockerfiles. You can run podman build -t myimage . to build from a Dockerfile. Buildah also allows building from Dockerfiles using buildah bud.

Keep studying

Build the next review session

Browse another free bank or use the study strategy guide to turn your misses into spaced review.