Week 3 - Docker I Flashcards

(17 cards)

1
Q

Q1: What are the features of Docker?
A. Easy Modelling.
B. Version Control.
C. Application Isolation.
D. All of the above.

A

D. All of the above.

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

What are the benefits for a developer using Docker?

A. Standardization and Productivity.

B. CI Efficiency & Rapid Deployment.

C. Compatibility and Maintainability.

D. All of the above.

A

D. All of the above.

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

A Docker container is an instance of an image with a specific configuration.

A. True.

B. False.

A

A. True.

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

What is a Dockerfile?

A. A developer who loves Docker and containerization, frequently espousing its virtues.

B. Any report or document that Docker components produce.

C. Any folder or document to run Docker components.

D. A template used to describe the build of an image.

A

D. A template used to describe the build of an image.

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

Can we remove a paused container from Docker?

A. Yes.
B. No.

A

A. Yes.

(Normally, we should stop the running container before deleting (removing) it. So we
need to unpause the container first and stop this container before removing it. However,
we can still forcefully remove a container regardless of its status with “–force/-f” flag.)

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

Is Docker image OS-dependent?
A. Yes.
B. No.

A

A. Yes.

(Docker image is OS-dependent and Docker runtime (engine) supports this feature. For
example, an alpine-java image created specifically for an x86-64 environment will only
run on a Linux docker container engine (or a compatible engine). When you create a
School of Electrical Engineering & Computer Science
INFS3208 Cloud Computing
Docker image, it is typically built for a specific combination of operating system (such as
Linux) and CPU architecture (such as x86_64).)

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

A docker registry is a place to store and distribute docker _______.
A. Files.
B. Codes.
C. Images.
D. All of the above.

A

C. Images.

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

What is Docker?

A

Docker is a set of PaaS products that use OS level virtualization to deliver software packages called containers. Containers are isolated and bundle up their own software, libraries and configs, all containers ran by kernel more efficient than separate virtual machines.

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

What are the motivations to use this tech?

A

Docker enables you to separate your applications from your infrastructure so you can deliver
software quickly. With Docker, you can manage your infrastructure in the same ways you manage
your applications. By taking advantage of Docker’s methodologies for shipping, testing, and
deploying code quickly, you can significantly reduce the delay between writing code and running it
in production

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

What are Linux name spaces?

A

Namespaces are a feature of the Linux kernel that provides process isolation. They achieve
this by giving a group of processes its own virtualized view of system resources, such as the
network, filesystem, and process IDs, effectively creating a private operating environment.

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

What are C Groups?

A

A Linux kernel feature that manages and limits the resource
usage of processes. They are used to enforce constraints on how much CPU, memory, and disk
I/O a specific group of processes can consume from the host system.

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

How to Namespaces and C groups work together to enable containerization?

A

Namespaces build the container’s walls, isolating it from the host and other containers so it
cannot see or interact with outside processes.

Cgroups then determine the resources available within those walls, limiting how much CPU
and memory the containerized process can use to ensure it doesn’t disrupt the host. In essence,
namespaces provide isolation, while cgroups provide resource limitation

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

What is a docker image?

A

A read-only template with instructions for how to build / create a docker container. Often based on another images with additional customization.

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

What is a docker container

A

container is a runnable instance of an image. You can create, start, stop,
move, or delete a container using the Docker API or CLI. You can connect a container to one
or more networks, attach storage to it, or even create a new image based on its current state. By
default, a container is relatively well isolated from other containers and its host machine. You
can control how isolated a container’s network, storage, or other underlying subsystems are
from other containers or from the host machine. A container is defined by its image as well as
any configuration options you provide to it when you create or start it. When a container is
removed, any changes to its state that are not stored in persistent storage disappear

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

What is a docker file

A

Dockerfile is a text file that contains a collection of instructions and commands for building a docker
image and running as a container.

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

What is a docker registery

A

A Docker registry stores Docker images. Docker Hub is a public registry
that anyone can use, and Docker is configured to look for images on Docker Hub by default.
You can even run your own private registry. When you use the docker pull or docker run
commands, the required images are pulled from your configured registry. When you use the
docker push command, your image is pushed to your configured registry

17
Q

What are some good practices for writing docker files?

A

Use dockerignore to omit files not necessary in the build.

Use multi-stage builds to allow for drastic size reduction of final image

Dont install unecessary packages only what you need

Decouple applicatoins: each container should only have one conern

Minimize number of layers (RUN, ADD, COPY) cmds

Remove cache after installs of upgrades