Containers Flashcards
What are the benefits of virtualisation in cloud computing?
- Server consolidation
- Isolation
- Resource management
- Security (to some extent)
What are some drawbacks of virtual machines (VMs)?
- Highly resource-intensive
- Slow to start
- Tricky to create and manage
What is a container?
A lightweight alternative to virtual machines that starts almost instantaneously, is less resource-intensive, and easier to create and manage.
How do containers encapsulate applications?
Containers encapsulate an application and its dependencies, sitting on top of the kernel of a host operating system.
What are some popular tools for containerisation?
- Docker
- PodMan
- Kubernetes
What is a Dockerfile?
A file used to create Docker images, specifying instructions for building the image.
What command is used to pull a standard Ubuntu image in Docker?
docker pull ubuntu:latest
What does the command ‘docker run -it ubuntu:latest /bin/bash’ do?
Runs a new container and starts a bash shell with an interactive terminal.
What is the purpose of the ‘FROM’ instruction in a Dockerfile?
Specifies another image upon which the new image is being built.
What is the role of control groups (cgroups) in containers?
Manage resource allocation for containers, limiting and monitoring CPU, memory, disk I/O, etc.
What is the function of namespaces in Linux?
Isolate system resources for a collection of processes, ensuring each set sees its own instance of a global resource.
Fill in the blank: Containers create the illusion of ________ on top of a host OS.
[separate operating systems]
What does Kubernetes do?
Automates the deployment, scaling, and operation of containers.
What is the significance of the name ‘Kubernetes’?
Originates from Greek, meaning helmsman or pilot, and is represented by a ship’s wheel logo.
True or False: Kubernetes was originally designed by engineers at Microsoft.
False
What are union file systems used for in containers?
Provide a layered file system allowing containers to share a read-only base while maintaining separate writable layers.
What does the ‘CMD’ instruction in a Dockerfile do?
Specifies the command to run when the container starts from the image.
What is the primary purpose of orchestration software like Kubernetes?
Manage deployment, scaling, and operation of applications in data centers.
What is the relationship between Kubernetes and Google’s proprietary systems, Borg and Omega?
Kubernetes was built from lessons learned from Borg and Omega, though it is not a direct descendant.
Fill in the blank: Kubernetes is sometimes called ________.
[k8s]
What does the ‘docker build -t hello-world .’ command do?
Builds a Docker image from the Dockerfile in the current directory.
What is the purpose of exposed ports in a Dockerfile?
Specify which ports should be exposed when running a container from the image.
What are the key elements of a Dockerfile?
- Base image
- Instructions
- Commands
- Exposed ports
- Entrypoint
What is the main advantage of using containers over traditional virtual machines?
Containers are lightweight, start quickly, and are easier to manage.