CKA Container Fundamentals 1 — Questions and Answers
Question 1: What is the primary benefit of containerization over virtual machines?
- Containers share the host OS kernel and are lighter weight (Correct answer)
- Containers provide stronger isolation
- Containers require more resources
- Containers can only run Linux
Correct answer: Containers share the host OS kernel and are lighter weight
Containers share the host operating system kernel, making them more lightweight, faster to start, and more efficient with resources compared to VMs that require a full OS.
Question 2: What is Docker Hub?
- A cloud-based registry for storing and sharing container images (Correct answer)
- A physical data center
- A container runtime
- A Kubernetes component
Correct answer: A cloud-based registry for storing and sharing container images
Docker Hub is the default public registry for Docker images, where developers can store, share, and discover container images.
Question 3: What is a container image?
- A read-only template containing the application and its dependencies (Correct answer)
- A running instance of an application
- A virtual machine snapshot
- A configuration file
Correct answer: A read-only template containing the application and its dependencies
A container image is a lightweight, read-only template that includes everything needed to run an application: code, runtime, libraries, and settings.
Question 4: What is the purpose of a Dockerfile?
- To define instructions for building a container image (Correct answer)
- To configure Kubernetes clusters
- To manage network settings
- To store application logs
Correct answer: To define instructions for building a container image
A Dockerfile contains sequential instructions that define how to build a container image, including base image, dependencies, files to copy, and commands to run.
Question 5: What command starts a container from an image?
- docker run (Correct answer)
- docker build
- docker pull
- docker push
Correct answer: docker run
The 'docker run' command creates and starts a new container from a specified image, optionally with configuration flags for ports, volumes, and environment variables.
Question 6: What is container orchestration?
- Automated management of container deployment, scaling, and networking (Correct answer)
- Manual container management
- Building container images
- Writing application code
Correct answer: Automated management of container deployment, scaling, and networking
Container orchestration automates deploying, managing, scaling, and networking containers across clusters of hosts, with Kubernetes being the most popular orchestration platform.
What is the primary benefit of containerization over virtual machines?