Docker - atabegruslan/Notes GitHub Wiki

Architecture

https://www.opc-router.com/what-is-docker

Docker Engine is the underlying client-server technology that builds and runs containers using Docker's components and services.

When people refer to Docker, they mean either

  • Docker Engine
    • which comprises the Docker daemon, a REST API
    • and the CLI that talks to the Docker daemon through the API
  • or the company Docker Inc., which offers various editions of containerization technology around Docker Engine.

Docker Engine vs. Docker Machine

  • Docker Engine was initially developed for Linux systems, but with version updates extended to operate natively on both Windows and Apple OSes.
  • Docker Machine is a tool to install and manage Docker Engine on several virtual hosts or older versions of Apple and Windows OSes. Commands input through Docker Machine, installed on the local system, will not only create virtual hosts, but also install Docker and configure its clients.

While Docker Engine now runs natively on Windows and Apple, Docker Machine can still be used to manage virtual hosts on both OSes and Linux, or on company networks, in data centers or on cloud providers such as Amazon Web Services, Microsoft Azure and Digital Ocean.

https://www.techtarget.com/searchitoperations/definition/Docker-Engine

containerd is the core container runtime of the Docker Engine. It leverages runc (runtime code).

WSL

https://github.com/atabegruslan/Notes/wiki/WSL

Install

Check Ubuntu version first: lsb_release -a

OR:

sudo yum -y update sudo
yum install -y docker

OR:

sudo apt-get update sudo
apt-get install docker.io

OR for MAC:

Now docker commands are available to you.

sudo service docker start
docker info

sudo groupadd docker sudo gpasswd -a $USER docker sudo usermod -a -G docker

${user} sudo service docker restart 
# OR reboot physically

Dockerize various things

Dockerize Nginx

Test projects:


Tutorials

Official Sites

Cheatsheets

Repository

DockerHub

Push to DockerHub

Fiddles

Remove Images and Containers

# List all containers (only IDs)
docker ps -aq
# Stop all running containers
docker stop $(docker ps -aq)
# Remove all containers
docker rm $(docker ps -aq)
# Remove all images
docker rmi $(docker images -q)

Common issues

Root priviledge issue


Swarms

  1. https://www.youtube.com/watch?v=bU2NNFJ-UXA
  2. https://www.youtube.com/watch?v=3-7gZS4ePak

Docker swarm is a Clustering and orchestration tool. It is used for scheduling containers across multiple nodes. You can combine multiple nodes as a cluster and then send "docker run" command to this cluster. Docker stack is a collection of services that make up an application in a specific environment. The extension of stack file is yaml (yml also).

To get started setting up VMs and a Swarm

Load Balancing