Skip to main content

Primary links

  • Home
  • AI
  • Kubernetes
  • Incus
  • Ansible
  • Terraform
  • OpenStack
  • Virtualization
  • Linux
  • SmartHome
  • HowTo

Misc

  • Linux
  • Hardware
  • Programming
  • Databases
  • Multimedia
  • Windows

Cloud

  • OpenStack
  • cloud-config
  • nextcloud

Virtualization

  • Virtualization
  • Incus
  • Docker
  • KVM
  • Kubernetes
  • LXC
  • LXD
  • QEMU
  • VMware
  • VirtualBox
  • multipass
  • podman
  • vagrant
  • XEN

Network

  • DNS
  • Firewall
  • Linux
  • OpenvSwitch
  • SSL
  • VLAN
  • VPN
  • iPXE
  • namespaces
  • nmcli
  • tcpdump

Storage

  • CEPH
  • DRBD
  • LVM
  • S3
  • ZFS
  • btrfs

Automation / CI/CD

  • Install
  • Ansible
  • GitLab
  • LLM
  • Preseed
  • Puppet
  • Terraform
  • Ubuntu autoinstall

Monitoring / Visualisation

  • Grafana
  • Icinga
  • Prometheus
  • Monitoring
  • ELK
  • mermaid

Docker Pi-hole

Install as Docker container
https://github.com/pi-hole/docker-pi-hole/blob/master/examples/docker_run.sh

mkdir  /mnt/data/pihole
chmod 777 /mnt/data/pihole

PIHOLE_BASE=/mnt/data/pihole

docker run -d \
    --name pihole \
    -p 53:53/tcp \
    -p 53:53/udp \
    -p 8081:80 \
    -e TZ="Europe/​Berlin" \
    -v "${PIHOLE_BASE}/etc-pihole:/etc/pihole" \
    -v "${PIHOLE_BASE}/etc-dnsmasq.d:/etc/dnsmasq.d" \
    --dns=127.0.0.1 \
    --dns=1.1.1.1 \
    --restart=unless-stopped \
    --hostname pi.hole \
    -e VIRTUAL_HOST="pi.hole" \
    -e PROXY_LOCATION="pi.hole" \
    -e FTLCONF_LOCAL_IPV4="127.0.0.1" \
    pihole/pihole:latest


printf 'Starting up pihole container '
for i in $(seq 1 20); do
    if [ "$(docker inspect -f "{{.State.Health.Status}}" pihole)" == "healthy" ] ; then
        printf ' OK'
        echo -e "\n$(docker logs pihole 2> /dev/null | grep 'password:') for your pi-hole: http://${IP}/admin/"
        exit 0
    else
        sleep 3
        printf '.'
    fi

    if [ $i -eq 20 ] ; then
        echo -e "\nTimed out waiting for Pi-hole start, consult your container logs for more info (\`docker logs pihole\`)"
        exit 1
    fi
done;

Login
http://ha:8081/admin/login.php

Links
https://github.com/pi-hole/docker-pi-hole/?tab=readme-ov-file#running-pi-hole-docker

Install minikube

Install docker
http://www.panticz.de/docker

Install minikube
https://minikube.sigs.k8s.io/docs/start/

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_$(dpkg --print-architecture).deb
sudo dpkg -i minikube_latest_*.deb
rm minikube_latest_*.deb

sudo usermod -aG docker $USER && newgrp docker

minikube start

minikube addons enable ingress

Install kubectl
https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/#install-using-native-package-management

curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.29/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.29/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update
sudo apt-get install -y kubectl

kubectl completion bash | sudo tee /etc/bash_completion.d/kubectl
source /etc/bash_completion.d/kubectl

echo "alias k=kubectl" >> ~/.bashrc
echo "complete -o default -F __start_kubectl k" >> ~/.bashrc

Test configuration

kubectl get all --all-namespaces -o wide

Install k9s
https://github.com/derailed/k9s/releases

K9S_VERSION=0.32.4
wget -q https://github.com/derailed/k9s/releases/download/v${K9S_VERSION}/k9s_linux_$(dpkg --print-architecture).deb -P /tmp/
sudo dpkg -i /tmp/k9s_linux_$(dpkg --print-architecture).deb
rm /tmp/k9s_linux_*.deb

Configure port forwad to minikube

Docker networking

docker network ls
docker network inspect bridge
docker network inspect host
docker network inspect none

ip addr show docker0
ip link show docker0
ip -c link show type bridge

ip netns
docker inspect ${DOCKER_ID}

ip link # attached to bridge
# vethxxx@ifx
ip -n ${INTERFACE_ID} # assignet do container
# eth0@ifx

ip -n ${NAMESPACE_ID} addr

docker run -p 8080:80 nginx # forward internal port 80 to host port 8080
#iptables -t nat -A PREROUTING -j DNAT --dport 8080 -to-destination 80
#iptables -t nat -A Docker -j DNAT --dport 8080 --to-destination 172.17.0.3:80
iptables -nvL -t nat

Rundeck Docker install

Docker
DockerHub images: https://hub.docker.com/r/rundeck/rundeck/
Docker Environment Variables: https://docs.rundeck.com/docs/administration/configuration/docker.html#environment-variables

apt install -y docker docker-compose git vim
git clone https://github.com/rundeck/docker-zoo.git

# https://github.com/rundeck/docker-zoo/tree/master/cloud
cd ./docker-zoo/cloud
mkdir libext
wget https://github.com/rundeck-plugins/rundeck-s3-log-plugin/releases/download/v1.0.8/rundeck-s3-log-plugin-1.0.8.jar -P ./libext/

# configure paramter
# https://docs.rundeck.com/docs/administration/configuration/docker.html#user-authentication

# todo: configure S3
# configure rundeck external address
HOST_IP=$(hostname -I | cut -d" " -f3)
HOST_IP=rundeck.dev.i.example.com
echo "
AWS_CREDENTIALS=x
RUNDECK_PLUGIN_EXECUTIONFILESTORAGE_S3_BUCKET=y
RUNDECK_PLUGIN_EXECUTIONFILESTORAGE_S3_REGION=z
RUNDECK_STORAGE_PASSWORD=p

#RUNDECK_GRAILS_URL=\"http://${HOST_IP}\"
#RUNDECK_SERVER_ADDRESS=${HOST_IP}
" > .env.dist

# diff docker-compose.yml.org docker-compose.yml
# diff docker-compose.yml.org docker-compose.yml
13c13
<             RUNDECK_GRAILS_URL: http://localhost
---
>             RUNDECK_GRAILS_URL: http://rundeck.dev.example.com
26c26
<           - ${AWS_CREDENTIALS}:/home/rundeck/.aws/credentials
---
>             #  - ${AWS_CREDENTIALS}:/home/rundeck/.aws/credentials

# configure SMTP
sed "/RUNDECK_DATABASE_URL:.*:/a \\\t    RUNDECK_MAIL_SMTP_HOST: smtp" docker-compose.yml

docker compose build
docker compose up

docker update --restart unless-stopped cloud_nginx_1
docker update --restart unless-stopped cloud_rundeck_1
docker update --restart unless-stopped cloud_mysql_1

Fix SCM

Move Elasticsearch data to dedicated LV

# create lvm
pvcreate /dev/disk/by-id/ata-INTEL_SSDSC2KB076T8_*
vgcreate data /dev/disk/by-id/ata-INTEL_SSDSC2KB076T8_*
lvcreate --name elasticsearch --size 2T data
mkfs.ext4 /dev/data/elasticsearch

# pre-sync data
mount /dev/data/elasticsearch /mnt/
rsync -aHAXx --numeric-ids /var/lib/docker/volumes/elasticsearch/ /mnt/

# sync data
docker stop elasticsearch
rsync --delete -aHAXxv --numeric-ids /var/lib/docker/volumes/elasticsearch/ /mnt/
rsync --delete -aHAXxv --numeric-ids /var/lib/docker/volumes/elasticsearch/ /mnt/
umount /mnt

# mount new LV
mv /var/lib/docker/volumes/elasticsearch{,.org}
mkdir /var/lib/docker/volumes/elasticsearch
echo "/dev/mapper/data-elasticsearch   /var/lib/docker/volumes/elasticsearch    ext4    defaults    0    2" >> /etc/fstab 
mount -a

# restart elasticsearch container
docker start elasticsearch
# docker logs elasticsearch

# visudo -f /etc/sudoers.d/nagios
echo "nagios ALL=(root) NOPASSWD: /usr/lib/nagios/plugins/check_disk *" >> /etc/sudoers.d/nagios

# allow NRPE access to volume
vi /etc/nagios/nrpe.cfg
command[check_disk]=/usr/bin/sudo /usr/lib/nagios/plugins/check_disk -w "10%" -c "5%" -l -X devtmpfs -X sysfs -X tmpfs -X cgroup -X proc -X udev -X debugfs -X overlay -X cgmfs -X tracefs -A -I lxc -I nsfs
service nagios-nrpe-server restart

# Debug
journalctl _COMM=sudo -f

GitLab: Docker CI pipeline

Optinal: Create nested LXD container
http://www.panticz.de/lxd/nesting

CONTAINER_NAME=gitlab-runner1-dev
lxc launch ubuntu:18.04 ${CONTAINER_NAME} -p disk-zfs -p nic-dev-mgmt -c boot.autostart=true -c security.nesting=true -c security.privileged=true
#-c volatile.dev-mgmt.hwaddr=00:11:22:33:44:55

lxc exec ${CONTAINER_NAME} -- apt update
lxc exec ${CONTAINER_NAME} -- apt dist-upgrade
lxc exec ${CONTAINER_NAME} -- apt purge -y lxd lxd-client snapd unattended-upgrades
lxc exec ${CONTAINER_NAME} -- apt autoremove

lxc file push /root/.ssh/authorized_keys ${CONTAINER_NAME}/root/.ssh/authorized_keys
lxc exec ${CONTAINER_NAME} -- bash -c "sed -i 's/eth0:/dev-mgmt:/g' /etc/netplan/50-cloud-init.yaml"
lxc exec ${CONTAINER_NAME} -- netplan apply

printf 'lxc.apparmor.profile = unconfined\nlxc.cgroup.devices.allow = a\nlxc.mount.auto=proc:rw sys:rw\nlxc.cap.drop=' | lxc config set ${CONTAINER_NAME} raw.lxc -
lxc restart ${CONTAINER_NAME}

Install Docker inside LXD container
# http://www.panticz.de/install-docker

apt update
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get install -y docker-ce

Install GitLab-runner (as Docker container)
https://docs.gitlab.com/runner/install/docker.html

docker run -d \
  --name gitlab-runner \
  --restart always \
  -v /srv/gitlab-runner/config:/etc/gitlab-runner \
  -v /var/run/docker.sock:/var/run/docker.sock \
  gitlab/gitlab-runner:latest

Configue GitLab-runner

podman

Install

sudo apt-get install -y software-properties-common uidmap
sudo add-apt-repository -y ppa:projectatomic/ppa
sudo apt-get -y install podman

Container

podman run --name nginx -v /tmp/html:/usr/share/nginx/html:ro -d -p 8080:80 docker://nginx

podman run \
    -dt \
    -p 8080:8080/tcp \
    -e HTTPD_VAR_RUN=/var/run/httpd \
    -e HTTPD_MAIN_CONF_D_PATH=/etc/httpd/conf.d \
    -e HTTPD_MAIN_CONF_PATH=/etc/httpd/conf \
    -e HTTPD_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/httpd/ \
    registry.fedoraproject.org/f27/

Links
https://podman.io/

Docker: Anisble snippets

Ansible docker modules
https://docs.ansible.com/ansible/latest/modules/docker_container_module.html

- name: Enable autostart for running containers
  shell: docker update --restart=always $(docker ps -q)

- name: Get container info
  docker_container_info:
    name: www1
  register: result

- name: Does container exist?
  debug:
    msg: "The container {{ 'exists' if result.exists else 'does not exist' }}"

- name: Stop container
  docker_container:
    name: "{{ result.container.Name }}"
    state: stopped
  when:
    - result.exists
    - result.container.State.Running

Docker: Container

Ubuntu

docker run -it ubuntu:18.04

Import MySql / Mariadb dump into container

cat gogs.sql | docker exec -i gitea_db_1 mysql --host=localhost --user=gitea --password=gitea gitea

Apache

docker run -d --name apache -p 8080:80 httpd:latest

Nginx
https://hub.docker.com/_/nginx

docker run --name nginx -v /tmp:/usr/share/nginx/html:ro -d -p 8080:80 nginx

GitLab runner

docker run -d --name gitlab-runner --restart always \
  -v /srv/gitlab-runner/config:/etc/gitlab-runner \
  -v /var/run/docker.sock:/var/run/docker.sock \
  gitlab/gitlab-runner:latest

docker run --rm -t -i -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register \
    ...

Gitea

Install as Docker container
http://www.panticz.de/docker/container/gitea

APT packages
https://gitlab.com/packaging/gitea

Download archive
https://dl.gitea.io/gitea/

Migrate from gogs
https://docs.gitea.io/en-us/upgrade-from-gogs/

Backup
https://docs.gitea.io/en-us/backup-and-restore/

Install gitea on Kubernetes
https://docs.gitea.com/installation/install-on-kubernetes

helm repo add gitea-charts https://dl.gitea.com/charts/
helm install gitea gitea-charts/gitea

Links
https://gitea.io/

Pagination

  • 1
  • Next page
docker
Profiles GitHub StackOverflow LinkedIn Xing
Contact Imprint
© panticz 2026

Cookie-Einstellungen

Diese Website nutzt eingebettete Inhalte von Drittanbietern (z.B. YouTube, SoundCloud). Beim Laden dieser Inhalte werden Daten an die jeweiligen Anbieter übermittelt. Datenverarbeitungserklärung