Installation and Configuration (15%) Flashcards
Installation and Configuration (15%)
What is the recommended way of installing Docker
set up docker repositories
install from them for the ease of installation and upgrade tasks.
How to upgrade docker-engine?
sudo apt-get update
install docker from the instructions from here
How to uninstall docker?
sudo apt-get purge docker-ce
sudo rm -rf /var/lib/docker
- Are Images, containers, volumes, or customized configuration files on your host are not automatically removed when you uninstall docker?
No. You need to explicitly delete those
How to add the user to the Docker group and use docker as a non-root user?
sudo usermod -aG docker your-user
- What are the ways to install docker?
- using repositories
- using DEB package
- using convience scripts
- What are the recommended storage drivers on different distributions?
Centos: overlay2
Ubuntu supports overlay2, aufs and btrfs storage drivers. Overlay2 is the default one
- What are all the release channels that Docker CE supports?
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
- Where are the Docker-CE binaries available?
Docker Engine - Community binaries for a release are available on download.docker.com as packages for the supported operating systems.
- Where are the Docker-EE binaries available?
Docker Hub
- What are logging drivers?
Docker has multiple mechanisms to get the logging information from running docker containers and services. These mechanisms are called logging drivers
- How to configure a logging driver for the Docker daemon so that all the containers use it?
configure log-driver in /etc/docker/daemon.json{ “log-driver”: “syslog”}
- Whats is the default logging driver?
json-file
- If you have configurable options for your logging driver how do you specify?
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 to find the logging driver for the Docker daemon?
docker info –format ‘{{.LoggingDriver}}’
- How to configure a logging driver for a container?
docker run -it –log-driver json-file –log-opt max-size=10m alpine ash
- What are the available logging drivers for the Docker CE edition?
json-file
local
journald
- If the swarm loses the quorum of managers it loses the ability to perform management tasks. Is this statement correct?
Yes
- If the swarm loses quorum all the existing tasks and services are all deleted. Is this statement correct?
No. All the existing tasks will continue to run. But, new nodes cannot be added and new tasks can’t be created.
- 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?
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.
- You should maintain an odd number of managers in the swarm to support manager node failures. Is this statement correct?
Yes
- 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
Manager Nodes Availability Zones 3 1-1-1 5 2-2-1 7 3-2-2 9 3-3-3
- How to drain the node
docker node update –availability drain
- How to cleanly rejoin a manager node in the cluster?
- To demote the node to a worker, run docker node demote
- To remove the node from the swarm, run docker node rm
- Re-join the node to the swarm with a fresh state using docker swarm jo