Change to Quadlets for starting Podman Containers (with .kube files in ~containers/.config/containers/systemd)

This commit is contained in:
Joerg Lehmann 2023-10-20 11:11:43 +02:00
parent a440320eee
commit c871d1f6ed
1 changed files with 25 additions and 0 deletions

View File

@ -26,6 +26,12 @@ Set Root-Password (by hand)
# groupadd containers # groupadd containers
# useradd -m -g containers containers # useradd -m -g containers containers
# passwd containers # passwd containers
For containers User, add the following to ~/.bash_profile:
# User specific environment and startup programs
export XDG_RUNTIME_DIR=/run/user/$(id -u)
# hostnamectl set-hostname onyx.nbit.ch # hostnamectl set-hostname onyx.nbit.ch
# timedatectl set-timezone Europe/Zurich # timedatectl set-timezone Europe/Zurich
# dnf install glibc-langpack-de # dnf install glibc-langpack-de
@ -247,6 +253,25 @@ export XDG_RUNTIME_DIR=/run/user/$(id -u)
containers$ touch /data/traefik/acme.json containers$ touch /data/traefik/acme.json
containers$ chmod 0600 /data/traefik/acme.json containers$ chmod 0600 /data/traefik/acme.json
!!!!!!!!!!!!!!
IMPORTANT: we changed the startup Method to Quadlets, put into
~containers/.config/containers/systemd/
Example of such a quadlet config:
[containers@onyx-dev ~]$ more ~containers/.config/containers/systemd/onyx-dev-mqtt.kube
[Unit]
Description=MQTT
Before=local-fs.target
[Kube]
Yaml=/home/containers/onyx-dev_pods/mqtt/mqtt.yaml
[Install]
# Start by default on boot
WantedBy=multi-user.target default.target
!!!!!!!!!!!!!!
containers$ mkdir -p ~/.config/systemd/user/ containers$ mkdir -p ~/.config/systemd/user/
containers$ cd ~/.config/systemd/user/ containers$ cd ~/.config/systemd/user/