Docker: Porovnání verzí
Z Poznámkový blok
(→Otevření socketu ven) |
|||
Řádka 12: | Řádka 12: | ||
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ | "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ | ||
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | ||
+ | sudo apt update | ||
− | === Instalace | + | === Instalace === |
sudo apt update | sudo apt update | ||
− | sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin | + | sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin |
* https://docs.docker.com/engine/install/debian/ | * https://docs.docker.com/engine/install/debian/ | ||
+ | == Vytvoření self-signed certifikátu == | ||
+ | |||
+ | *https://medium.com/trabe/using-docker-engine-api-securely-584e0882158e | ||
+ | * https://docs.docker.com/engine/security/protect-access/ | ||
== Otevření socketu ven == | == Otevření socketu ven == | ||
=== Override config === | === Override config === |
Verze z 9. 8. 2024, 16:59
Obsah
Instalace
Nastavení depositáře
sudo apt update sudo apt install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo \ "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt update
Instalace
sudo apt update sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Vytvoření self-signed certifikátu
- https://medium.com/trabe/using-docker-engine-api-securely-584e0882158e
- https://docs.docker.com/engine/security/protect-access/
Otevření socketu ven
Override config
sudo mkdir /etc/systemd/system/docker.service.d nano /etc/systemd/system/docker.service.d/override.conf
Nastavení pro nešifrovaný otevření socketu, nedoporučeno
[Service] ExecStart= ExecStart=/usr/bin/dockerd -H fd:// -H tcp://IP_ADRESA:2735 --ipv6=false --tls=false
Nastavení pro šifrovaný otevření socketu, doporučeno
[Service] ExecStart= ExecStart=/usr/bin/dockerd -H fd:// -H tcp:///IP_ADRESA:2376 --ipv6=false --tlsverify --tlscacert=/CESTA/ca.pem --tlscert=/CESTA/server-cert.pem --tlskey=/CESTA/server-key.pem
- https://docs.docker.com/config/daemon/remote-access/
- https://stackoverflow.com/questions/57996938/could-not-edit-systemd-service-file
Restartování
sudo systemctl daemon-reload sudo systemctl restart docker.service
Povolení ufw
ufw allow 2375/tcp
nebo
ufw allow 2376/tcp