docker
Table of Content
docker¶
docker engine installation for debian¶
# uninstall old packages
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt remove $pkg; done
# Add Docker's official GPG key:
sudo apt update
sudo apt install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] 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
# List the available versions:
apt-cache madison docker-ce | awk '{ print $3 }'
# installing specific version
VERSION_STRING=5:26.1.0-1~debian.12~bookworm
sudo apt install docker-ce=$VERSION_STRING docker-ce-cli=$VERSION_STRING containerd.io docker-buildx-plugin docker-compose-plugin
sudo apt-mark hold docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# OR, installing latest available
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
https://docs.docker.com/engine/install/linux-postinstall/
To use docker without root privilege, add the user to "docker" group.
And some testing.
docker engine uninstallation for debian¶
# remove packages
sudo apt purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras
# delete files
sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd
loki logging plugin¶
https://grafana.com/docs/loki/latest/send-data/docker-driver/
# install the plugin
docker plugin install grafana/loki-docker-driver:2.9.2 --alias loki --grant-all-permissions
usage example¶
services:
unbound:
image: registry.blink-1x52.net/cache-dockerhub/mvance/unbound:1.19.0
restart: unless-stopped
container_name: landns
hostname: "landns"
ports:
- "53:53/udp"
- "53:53"
volumes:
- "./config/a-records.conf:/opt/unbound/etc/unbound/a-records.conf:ro"
- "./config/ddns.conf:/opt/unbound/etc/unbound/ddns.conf:ro"
- "./config/unbound.conf:/opt/unbound/etc/unbound/unbound.conf:ro"
logging:
driver: loki
options:
loki-url: "http://loki-write.blink-1x52.net:3100/loki/api/v1/push"