Containers Flashcards

1
Q

What are key technologies needed in containers?

A

1) namespaces
2) cgroups
3) SELinux
4) Sec Comp

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

What is the purpose of cgroups?

A

set limitations on system resources such as memory and cpu.

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

What is the purpose of sec comp?

A

define allow and deny list of system calls from namespaces.

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

Known container runtimes

A

1) Cri-O
2) Docker
3) Runc

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

Purpose of container management tools

A

Allows you to communicate with the container engine / runtime

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

Examples of container management tools

A

1) Docker
2) Podman
3) K8S

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

Install podman

A

dnf install container-tools

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

List containers currently running

A

podman ps

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

List images downloaded for your user account

A

podman images

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

Download image quay.io/centos7/nginx-114-centos7

A

podman pull quay.io/centos7/nginx-114-centos7

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

How to find images

A

podman search

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

Delete image from your local account

A

podman image rm quay.io/centos7/nginx-114-centos7

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

Run container quay.io/centos7/nginx-114-centos7

A
podman run -d quay.io/centos7/nginx-114-centos7
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is your container storage location?

A

~/.local/share/containers/storage

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

Start an interactive terminal to the container called relaxed_dirac

A
podman exec -it relaxed_dirac bash
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

List all podman commands

A

1) podman tab tab
2) man podman

17
Q

Use an image file stored on your local storage

A

podman load

18
Q

Start a container with name silabus

A
podman run -d --name sylabus quay.io/centos7/nginx-114-centos7
19
Q

Login into a registry

A

podman login -u user -p password quay.io

20
Q

List images available in a registry

A

podman search registry.lab.example.com/

(with ending slash)

21
Q

Without downloading an image review its metadata

A
skopeo inspect docker://quay.io/ubi8/python-38
22
Q

Build an image using a container file

A

podman build -t python39:1.0 path/to/container/file/.

23
Q

Show the property of an image that is in local storage

A
podman inspect localhost/python39:1.0
24
Q

podman create

A

create a container without starting it

25
Copy a file from local to inside a container
podman cp /path/to/file python38:/target/path
26
Run container and forward its internal port 80 to host port 8080
```podman run -d -p 8080:80 quay.io/cloud-bulldozer/nginx```
27
Run container and mount folder /tmp/html into /var/httpd/html
podman run -d -v /tmp/html:/var/httpd/html:Z quay.io/cloud-bulldozer/nginx:latest
28
Read a container logs
podman logs compassionate_engelbart
29
Launch documentation on podman run
man podman-run
30
Create a network
```podman network create --subnet 10.89.1.0/24 --gateway 10.89.1.1 frontend```
31
Run a container attaching it to a network previously created
```podman run -d --network frontend quay.io/cloud-bulldozer/nginx:latest```
32
podman unshare chown 27:27 databases
Change the ownership of databases directory on the container host so that inside the container user id 27 has access to the databases folder
33
Connect a running container to an existing network
```podman network connect backend engel```
34
Where is systemd storing configuration for user services?
~/.config/systemd/user
35
Configure container engel to start as a systemd service
```mkdir -pv ~/.config/systemd/user && cd $_``` ```podman generate systemd --name engel --files --new``` ```podman stop engel && podman rm engel``` ```systemctl --user daemon-reload``` ```systemctl --user enable --now container-engel``` ```loginctl enable-linger```