Installation and Configuration (15%) Flashcards

Installation and Configuration (15%)

1
Q

What is the recommended way of installing Docker

A

set up docker repositories

install from them for the ease of installation and upgrade tasks.

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

How to upgrade docker-engine?

A

sudo apt-get update

install docker from the instructions from here

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

How to uninstall docker?

A

sudo apt-get purge docker-ce

sudo rm -rf /var/lib/docker

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
  1. Are Images, containers, volumes, or customized configuration files on your host are not automatically removed when you uninstall docker?
A

No. You need to explicitly delete those

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

How to add the user to the Docker group and use docker as a non-root user?

A

sudo usermod -aG docker your-user

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
  1. What are the ways to install docker?
A
  1. using repositories
  2. using DEB package
  3. using convience scripts
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
  1. What are the recommended storage drivers on different distributions?
A

Centos: overlay2

Ubuntu supports overlay2, aufs and btrfs storage drivers. Overlay2 is the default one

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
  1. What are all the release channels that Docker CE supports?
A

Stable gives you latest releases for general availability.Test gives pre-releases that are ready for testing before general availability.Nightly gives you latest builds of work in progress for the next major release

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
  1. Where are the Docker-CE binaries available?
A

Docker Engine - Community binaries for a release are available on download.docker.com as packages for the supported operating systems.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
  1. Where are the Docker-EE binaries available?
A

Docker Hub

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
  1. What are logging drivers?
A

Docker has multiple mechanisms to get the logging information from running docker containers and services. These mechanisms are called logging drivers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
  1. How to configure a logging driver for the Docker daemon so that all the containers use it?
A

configure log-driver in /etc/docker/daemon.json{ “log-driver”: “syslog”}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
  1. Whats is the default logging driver?
A

json-file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
  1. If you have configurable options for your logging driver how do you specify?
A

use log-opts in the daemon.json file{ “log-driver”: “json-file”, “log-opts”: { “max-size”: “10m”, “max-file”: “3”, “labels”: “production_status”, “env”: “os,customer” }}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
  1. How to find the logging driver for the Docker daemon?
A

docker info –format ‘{{.LoggingDriver}}’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
  1. How to configure a logging driver for a container?
A

docker run -it –log-driver json-file –log-opt max-size=10m alpine ash

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q
  1. What are the available logging drivers for the Docker CE edition?
A

json-file
local
journald

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q
  1. If the swarm loses the quorum of managers it loses the ability to perform management tasks. Is this statement correct?
A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q
  1. If the swarm loses quorum all the existing tasks and services are all deleted. Is this statement correct?
A

No. All the existing tasks will continue to run. But, new nodes cannot be added and new tasks can’t be created.

20
Q
  1. We should use a fixed IP address for the advertise address to prevent the swarm from becoming unstable on machine reboot. Is this statement correct?
A

Yes. If the whole swarm restarts and every manager node subsequently gets a new IP address, there is no way for any node to contact an existing manager. Therefore the swarm is hung while nodes try to contact one another at their old IP addresses.

21
Q
  1. You should maintain an odd number of managers in the swarm to support manager node failures. Is this statement correct?
A

Yes

22
Q
  1. I have manager nodes 3, 5, 7, 9. How do you distribute these manager nodes on availability zones so that If you suffer a failure in any of those zones, the swarm should maintain the quorum of manager nodes
A

Manager Nodes Availability Zones 3 1-1-1 5 2-2-1 7 3-2-2 9 3-3-3

23
Q
  1. How to drain the node
A

docker node update –availability drain

24
Q
  1. How to cleanly rejoin a manager node in the cluster?
A
  1. To demote the node to a worker, run docker node demote
  2. To remove the node from the swarm, run docker node rm
  3. Re-join the node to the swarm with a fresh state using docker swarm jo
25
Q
  1. How to forcibly remove a node?
A

docker node rm –force

26
Q
  1. If you want to remove a manager node you need to demote it to a worker role first. Is this statement correct?
A

Yes. You must ensure that there is a quorum

27
Q
  1. What is the location where swarm managers save the swarm state?
A

/var/lib/docker/swarm

28
Q
  1. How to backup the swarm?
A
  1. If autolock is enabled. You must unlock the swarm2. stop the docker on the manager node so that you don’t have unpredictable results3. save the entire contents of /var/lib/docker/swarm4. start the manager
29
Q
  1. How to restore swarm from the backup?
A
  1. shut down the docker on the targeted machine
  2. Remove the contents of /var/lib/docker/swarm
  3. Restore the /var/lib/docker/swarm directory from the backup
  4. Start the docker on the node so that it doesn’t connect to old ones
    docker swarm init –force-new-cluster
  5. Verify the state of the swarm
    docker service ls
  6. rotate the autolock key
  7. Add manager and worker nodes for the required capacity
  8. backup this swarm
30
Q
  1. What is a team in the DTR?
A

A team defines the permissions a set of users have for a set of repositories.

31
Q
  1. What are all the permission levels that teams could have?
A

Read Only: View repository and pull images.

Read Write: View repository, pull and push images.

Admin: Manage repository and change its settings, pull and push images.

32
Q
  1. Where is the Docker daemon directory?
A

/var/lib/docker on Linux

C:\ProgramData\docker on Windows

33
Q
  1. How to enable the debugging on Docker daemon
A
  1. add this flag in /etc/docker/daemon.json{ “debug”: true}2. Send a HUP signal to the daemon to cause it to reload its configuration.sudo kill -SIGHUP $(pidof dockerd)
34
Q
  1. How to check whether Docker is running?
A
// all these can be used depending on the operating system
docker info
sudo systemctl is-active docker
sudo status docker
sudo service docker status
35
Q
  1. What are the hardware and software requirements for UCP?
A

Minimum

  1. 8GB of RAM for manager nodes or nodes running DTR
  2. 4GB of RAM for worker nodes
  3. 3GB of free disk space

Recommended

  1. 16GB of RAM for manager nodes or nodes running DTR
  2. 4 vCPUs for manager nodes or nodes running DTR
  3. 25-100GB of free disk space
36
Q
  1. What products that Docker EE contains?
A

UCP
DTR
Docker Engine with enterprise-grade support,

37
Q
  1. Where is the location of the custom certificates?
A

/etc/docker/certs.d

38
Q
  1. What are the ports that DTR uses?
A

80/tcp - Web app and API client access to DTR.443/tcp - Web app and API client access to DTR

39
Q
  1. DTR needs to be installed on a worker node that is being managed by UCP. You can’t install DTR on a standalone Docker engine. Is this statement correct?
A

Yes

40
Q
  1. How to backup the UCP
A

To create a UCP backup, run the docker/ucp:2.2.22 backup command on a single UCP managerdocker container run \ –log-driver none –rm \ –interactive \ –name ucp \ -v /var/run/docker.sock:/var/run/docker.sock \ docker/ucp:2.2.22 backup \ –id \ –passphrase “secret” > /tmp/backup.tar

41
Q

How to restore the UCP

A

docker/ucp:2.2.22 restore –passphrase “secret”

docker container run –rm -i –name ucp \
-v /var/run/docker.sock:/var/run/docker.sock \
docker/ucp:2.2.22 restore –passphrase “secret” < /tmp/backup.tar

42
Q

You need to backup the UCP on the single manager node since Docker maintains the same UCP state in all the manager nodes. Is this statement correct?

A

Yes

43
Q

How to backup the DTR?

A

To perform a backup of a DTR node, run the docker/dtr backup command.

44
Q

DTR requires that a majority (n/2 + 1) of its replicas are healthy at all times for it to work. So if a majority of replicas are unhealthy or lost, the only way to restore DTR to a working state is by recovering from a backup. Is this statement correct?

A

Yes

45
Q

How to configure Docker to start on boot?

A

sudo systemctl enable docker