From 7c82919ae3980828a5617b64084c0b2e5a77e2ef Mon Sep 17 00:00:00 2001 From: ducoterra Date: Thu, 18 Jan 2024 10:09:06 -0500 Subject: [PATCH] add podman services and documentation --- compose/iperf3-compose.yaml | 10 ++++++ compose/pihole-compose.yaml | 23 +++++++++++++ podman.md | 64 +++++++++++++++++++++++++++++++++++++ quadlets/iperf3.container | 11 +++++++ quadlets/pihole.container | 18 +++++++++++ 5 files changed, 126 insertions(+) create mode 100644 compose/iperf3-compose.yaml create mode 100644 compose/pihole-compose.yaml create mode 100644 podman.md create mode 100644 quadlets/iperf3.container create mode 100644 quadlets/pihole.container diff --git a/compose/iperf3-compose.yaml b/compose/iperf3-compose.yaml new file mode 100644 index 0000000..ff82f36 --- /dev/null +++ b/compose/iperf3-compose.yaml @@ -0,0 +1,10 @@ +version: "3" + +services: + iperf3: + container_name: iperf3 + image: docker.io/networkstatic/iperf3:latest + ports: + - "5201:5201/tcp" + command: -s + restart: unless-stopped diff --git a/compose/pihole-compose.yaml b/compose/pihole-compose.yaml new file mode 100644 index 0000000..9d927ad --- /dev/null +++ b/compose/pihole-compose.yaml @@ -0,0 +1,23 @@ +version: "3" + +# More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/ +services: + pihole: + container_name: pihole + image: pihole/pihole:latest + ports: + - "10.1.203.197:53:53/tcp" + - "10.1.203.197:53:53/udp" + - "10.1.203.197:8080:80/tcp" + environment: + TZ: "America/Chicago" + WEBPASSWORD: "SET A PASSWORD HERE" + # Volumes store your data between container upgrades + volumes: + - pihole:/etc/pihole + - dnsmasq:/etc/dnsmasq.d + restart: unless-stopped + +volumes: + pihole: + dnsmasq: diff --git a/podman.md b/podman.md new file mode 100644 index 0000000..f469dc8 --- /dev/null +++ b/podman.md @@ -0,0 +1,64 @@ +# Podman + +## Podman systemd files + +Rather than copying compose files or running podman run as systemd services you can +generate quadlet files to define containers that run at boot. + +Podlet generates quadlets - systemd files specifically for containers. + +You generate quadlets from compose files like so: + +```bash +docker run \ + -v ./compose:/compose \ + -v ./quadlets:/quadlets \ + quay.io/k9withabone/podlet \ + -f /quadlets \ + -i \ + --overwrite \ + compose /compose/grafana-compose.yaml +``` + +Copy these files to `/usr/share/containers/systemd/` + +### iperf3 + +```bash +podman run \ + -v ./compose:/compose \ + -v ./quadlets:/quadlets \ + quay.io/k9withabone/podlet \ + -f /quadlets \ + -i \ + --overwrite \ + compose /compose/iperf3-compose.yaml +``` + +### pihole + +```bash +podman run \ + -v ./compose:/compose \ + -v ./quadlets:/quadlets \ + quay.io/k9withabone/podlet \ + -f /quadlets \ + -i \ + --overwrite \ + --wants network-online.target \ + --after network-online.target \ + compose /compose/pihole-compose.yaml +``` + +### Grafana + +```bash +podman run \ + -v ./compose:/compose \ + -v ./quadlets:/quadlets \ + quay.io/k9withabone/podlet \ + -f /quadlets \ + -i \ + --overwrite \ + compose /compose/grafana-compose.yaml +``` diff --git a/quadlets/iperf3.container b/quadlets/iperf3.container new file mode 100644 index 0000000..42b0966 --- /dev/null +++ b/quadlets/iperf3.container @@ -0,0 +1,11 @@ +[Container] +ContainerName=iperf3 +Exec=-s +Image=docker.io/networkstatic/iperf3:latest +PublishPort=5201:5201/tcp + +[Service] +Restart=always + +[Install] +WantedBy=default.target diff --git a/quadlets/pihole.container b/quadlets/pihole.container new file mode 100644 index 0000000..2e42a5e --- /dev/null +++ b/quadlets/pihole.container @@ -0,0 +1,18 @@ +[Unit] +Wants=network-online.target + +[Container] +ContainerName=pihole +Environment=TZ=America/Chicago "WEBPASSWORD=SET A PASSWORD HERE" +Image=pihole/pihole:latest +PublishPort=53:53/tcp +PublishPort=53:53/udp +PublishPort=8080:80/tcp +Volume=pihole:/etc/pihole +Volume=dnsmasq:/etc/dnsmasq.d + +[Service] +Restart=always + +[Install] +WantedBy=default.target