chapter 2 Flashcards

1
Q

describe how hosting a small application in a VM can lead to inefficiencies and how a switch to containers could solve that

A

It can lead to inefficiencies because it would waste a lot of resources, VMs have a full operating system installation taking up a lot of storage and CPU resources, running multiple VMs each with its own operating system would use more resources than the microservices need. This would be inefficient and costly.

A switch to a container would solve this because these small environments have only the essentials: the application code and dependencies. The developer can deploy each application in its own small, isolated environment using resources optimally without extra bloat. Updates can be done smoothly and compatibility issues are gone

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

describe the role of the kernel in general and related to
containers

A

Kernel is a core component of an operating system that manages the communication between the hardware and the software of a computer. It is responsible for tasks such as memory management, process scheduling, disk management and system calls

Container does not have its own kernel or drivers, it shares the kernel of the host OS. A container only has the user mode portion of an OS, mainly the filesystem which is based on a base image. This means that the containers are limited by the host operating system and cannot run different or incompatible operating systems

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

explain a container image

A

with a container image, think of it as a snapshot or a template of a VM. It includes all the necessary files, dependencies, libraries and settings required to run a particular application or service. Its like a blueprint that defines everything needed for a container to function properly including the operating system, runtime, application code and configurations. A container image is static meaning it remains unchanged unless explicitly modified

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

explain a container

A

container is a runtime instance of a container image, its essentially a running process that is isolated from the host system and other containers. When you create a container based on a container image youre essentially instantiating that image into a live running environment, this instance is what we refer to as a container. Containers are ephemeral meaning they are designed to be easily created, started, stopped and destroyed as needed. Any changes made to a running container are typically isolated within that container and do not affect the original image or other containers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

explain the role of docker hub

A

docker hub is a cloud based repository where you can store and share your containers images with others. It also provides a large number of public images created by the docker community. It allows you to push your images to your personal or organizational account or pull images from other sources. You can also tag your images with different versions, search for images by keywords or categories and rate or comment on images you like.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

give the differences between a more regular linux like debian and alpine linux

A

Image size: alpine linux container images are significantly smaller than Debian images due to their minimalistic nature and the use of lightweight components. This results in faster container startup timers and reduced storage overhead

Package availability: Debian provides a vast repository of software packages offering a wide range of options, however this package availability comes at the cost of larger image sizes. Alpine linux on the other hand has a more limited set of packages available in its repositories but prioritizes simplicity and security

Runtime performance: alpine linuxs lightweight design often leads to better runtime performance in terms of resource utilization and container responsiveness compared to Debian. The reduced overhead of unnecessary components contributes to improved efficiency, especially in resource contrained environments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

explain what happens when you run docker run for the first time

A

When you run docker run hello-world the docker engine running in your terminal tried to find an image named “hello-world” since this is the first time running a docker run command there are no images stored locally, so docker engine goes to its default docker registry, which is docker hub, to look for an image named “hello-world”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

explain docker run

A

creates and starts a new container

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

explain docker start

A

starts one or more stopped containers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

explain docker stop

A

stops one or more containers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

explain docker rm

A

removes one or more stopped containers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

explain docker ps

A

lists containers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

explain docker exec

A

runs a command in a running container

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

explain docker attach

A

attaches to a running containers console

How well did you know this?
1
Not at all
2
3
4
5
Perfectly