1. Introduction
A. Docker editions:
Features | Docker Community Edition (CE) | Docker Enterprise Edition (EE) |
Container engine with orchestration, networking and Security | yes | yes |
Certified Infrastructure, plugins | - | yes |
Image management - Docker Trusted Registry (DTR) | - | yes |
Container application management - Docker Universal Control Plane (UCP) | - | yes |
Secure image scanning | - | yes |
Minimum Requirement | 64 bit processor | 8GB RAM for manager nodes |
Recommended production requirements
16GB of RAM for manager nodes or nodes running DTR
4 vCPUs for manager nodes or nodes running DTR
25-100GB of free disk space
Docker Enterprise Edition (EE) is an integrated, supported platform for:
CentOS
Microsoft Windows Server 2016
Oracle Linux
B. Docker Architecture
Docker Engine is an open-source containerization technology for building and containerizing your applications. It is the heart of docker.Docker Engine acts as a client-server application with 3 things:
dockerd: Docker daemon, it's the server.
Docker client: CLI client, where you can interact with docker. Docker commands are used to talk with the docker server like to pull images, build images, and execute containers. CLI uses APIs to interact with docker daemon.
APIs: APIs that specify interfaces that programs can use to talk to and instruct the Docker daemon.
Docker registries: A Docker registry stores Docker images.
Docker Namespace: isolate the running container's resources (process ID, user IDs, network settings, storage, etc) from other containers running on the host os. Isolation is achieved using a namespace.
Types of namespaces in use by docker:
Process
Mount
Inner process communication (IPC)
Network
User
Cgroups in docker: Control groups (cgroups) are used to control container resources mainly CPU and Memory. It prevents a service attack or prevents noisy neighbor syndrome in a multi-tenant environment.
noisy neighbor syndrome
2. Installing Docker
Remove docker
sudo apt-get autoremove -y --purge docker-engine docker docker.io docker-ce
Update packages
sudo apt-get update
Allow Apt to use the repository over HTTPS (Installing Prerequisite Packages)
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
The above command will do:
Add the Docker official GPG Key to Apt
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Add the Docker Repository to Apt
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
Specify installation Source
apt-cache policy docker-ce
Install Docker
sudo apt install docker-ce -y
Check Docker status
sudo systemctl status docker docker --version docker run hello-world
Add the user to the docker group
sudo groupadd docker sudo usermod -aG docker $USER
Log out and log in again.
3. Configuring Docker
Docker configuration files are stored over /var/lib/docker
/var/lib/docker/swarm --> swarm configuration
How to upgrade docker:
go to the swarm configuration path. ie cd /var/lib/docker/swarm
update the apt packages. ie sudo apt-get update
uninstall docker
install docker again (latest version of docker will get installed)
4. Troubleshooting Docker
Issue 1: Connection Refused by Port 22 Debian/Ubuntu
Reson could be like SSH service is inactive, the port is blocked by UFW firewall, the server is using a different port, or because of some IP conflict