Quadlet example: single container with volume: Difference between revisions

From wikinotes
Line 7: Line 7:
<syntaxhighlight lang="systemd">
<syntaxhighlight lang="systemd">
# ~/.config/containers/systemd/ntfy.container
# ~/.config/containers/systemd/ntfy.container
# /etc/containers/systemd/ntfy.container
# vim: ft=systemd
# vim: ft=systemd
[Install]
[Install]

Revision as of 20:55, 18 May 2024

1. Configurations

First, add the configs:

ntfy.container

# ~/.config/containers/systemd/ntfy.container
# /etc/containers/systemd/ntfy.container
# vim: ft=systemd
[Install]
WantedBy=default.target

[Container]
# https://hub.docker.com/r/binwiederhier/ntfy/tags
Image=docker.io/binwiederhier/ntfy:2.11.0
Volume=ntfy.volume:/etc/ntfy
Environment=TZ=UTC
PublishPort=127.0.0.1:9800:80
EntryPoint=["ntfy", "serve"]

ntfy.volume

# ~/.config/containers/systemd/ntfy.volume
# vim: ft=systemd
[Volume]

2. Regen systemd and boot container

# check for errors in systemd-generation
/usr/lib/podman/quadlet -dryrun -user

# regenerate service
systemctl --user daemon-reload
systemctl --user start ntfy.service

# debugging
systemctl --user status ntfy.service  # check, try running the 'ExecStart' command