Table of Contents

Docker setup

Setup procedure from source: https://docs.docker.com/engine/install/debian/

Instalation

This installation process DO NO use the standard Debian repositories.
From Debian 11 it seems the standard repositories include Docker (docker.io) and docker-compose. However, the official versions are several versions behind Docker official releases. Since Docker is still a fast evolving tool, it is meaningful to get more up to date versions…

Docker Engine

$ sudo apt-get remove docker docker-engine docker.io containerd runc

$ sudo apt-get update

$ sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common

$ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -

$ sudo apt-key fingerprint 0EBFCD88

$ sudo add-apt-repository \ “deb [arch=amd64] https://download.docker.com/linux/debian \ $(lsb_release -cs) \ stable”

THIS IS DANGEROUS
update the docker line in /etc/apt/sources.list

$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io

$ sudo docker run hello-world

$ sudo systemctl enable docker

$ docker –version

Docker Compose

Latest version here: https://github.com/docker/compose/releases/latest

Replace the version number by the current latest official release found above, and run the commands:
$ sudo curl -L “https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)” -o /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose

Check installed version:
$ docker-compose –version

Configuration

Limit docker resources usage

It is possible to set resources limits using docker-compose, without starting a swarm service.
This feature was previously available in version 2 of compose-file. Since version 3, a new “deploy” section has been set up, normally only for 'docker stack deploy' feature, but then a –compatibility mode was added to docker-compose, so that it does not ignore information in the “deploy” section.

To run a docker-compose.yml file above version 3 with resource limits, just run it like:
$ sudo docker-compose –compatibility -f docker-compose.yml up -d