add podman services and documentation

This commit is contained in:
2024-01-18 10:09:06 -05:00
parent 48afc0bfa2
commit 7c82919ae3
5 changed files with 126 additions and 0 deletions

View File

@@ -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

View File

@@ -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:

64
podman.md Normal file
View File

@@ -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
```

11
quadlets/iperf3.container Normal file
View File

@@ -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

18
quadlets/pihole.container Normal file
View File

@@ -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