mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-30 04:07:53 +00:00
Merge pull request #17354 from travier/quadlet-examples
[CI:DOCS] docs/podman-systemd.unit: Update example to work out of the box + Explicitely mention '.network' units
This commit is contained in:
commit
c4ec99a757
1 changed files with 9 additions and 5 deletions
|
|
@ -6,7 +6,7 @@ podman\-systemd.unit - systemd units using Podman quadlet
|
|||
|
||||
## SYNOPSIS
|
||||
|
||||
*name*.container, *name*.volume
|
||||
*name*.container, *name*.volume, *name*.network, `*.kube`
|
||||
|
||||
### Podman unit search path
|
||||
|
||||
|
|
@ -26,8 +26,10 @@ These files are read during boot (and when `systemctl daemon-reload` is run) and
|
|||
corresponding regular systemd service unit files. Both system and user systemd units are supported.
|
||||
|
||||
The Podman generator reads the search paths above and reads files with the extensions `.container`
|
||||
and `.volume`, and for each file generates a similarly named `.service` file. These units can be started
|
||||
and managed with systemctl like any other systemd service.
|
||||
`.volume` and `*.kube`, and for each file generates a similarly named `.service` file. These units
|
||||
can be started and managed with systemctl like any other systemd service.
|
||||
|
||||
Files with the `.network` extension are only read if they are mentioned in a `.container` file. See the `Network=` key.
|
||||
|
||||
The Podman files use the same format as [regular systemd unit files](https://www.freedesktop.org/software/systemd/man/systemd.syntax.html).
|
||||
Each file type has a custom section (for example, `[Container]`) that is handled by Podman, and all
|
||||
|
|
@ -551,12 +553,14 @@ Example `test.container`:
|
|||
```
|
||||
[Unit]
|
||||
Description=A minimal container
|
||||
Before=local-fs.target
|
||||
|
||||
[Container]
|
||||
# Use the centos image
|
||||
Image=quay.io/centos/centos:latest
|
||||
|
||||
# Use volume and network defined below
|
||||
Volume=test.volume:/data
|
||||
Network=test.network
|
||||
|
||||
# In the container we just run sleep
|
||||
Exec=sleep 60
|
||||
|
|
@ -589,7 +593,7 @@ Example `test.volume`:
|
|||
```
|
||||
[Volume]
|
||||
User=root
|
||||
Group=projectname
|
||||
Group=root
|
||||
Label=org.test.Key=value
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue