-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(podman): added podman-compose systemd files
- Loading branch information
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
DevOps/Infrastructure-Solutions/Container/Podman/podman-compose-systemd-files.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Use systemd files with rootless podman-compose | ||
|
||
As of 06/15/2023 podman-compose must be manually installed to use version 1.0.7 (check with podman-compose -v), [because of not using pods as default](https://github.com/containers/podman-compose/issues/307#issuecomment-1517822926). | ||
|
||
```bash | ||
pip3 install git+https://github.com/containers/podman-compose.git | ||
``` | ||
|
||
## Setup | ||
|
||
Add the rootless podman user to the systemd-journal group to watch logs. | ||
|
||
```bash | ||
usermod -aG systemd-journal podman | ||
``` | ||
|
||
Create the systemd podman-compose unit with root permissions | ||
|
||
```bash | ||
sudo podman-compose systemd --action create-unit | ||
sudo systemctl daemon-reload | ||
``` | ||
|
||
Change to the directory where your podman-compose file resides. | ||
|
||
Register the project | ||
|
||
```bash | ||
podman-compose systemd --action register | ||
|
||
# or with a different file name than podman-compose.yaml | ||
podman-compose -f docker-compose.yaml systemd --action register | ||
``` | ||
|
||
Enable and start the systemd service | ||
|
||
```bash | ||
systemctl --user enable --now 'podman-compose@project-name' | ||
``` | ||
|
||
## Troubleshooting | ||
|
||
When the systemd unit is create you can use | ||
|
||
```bash | ||
podman pod ls | ||
|
||
podman pod inspect pod_project-name | ||
|
||
systemctl --user status -l podman-compose@project-name | ||
|
||
journalctl --user -xu podman-compose@project-name | ||
``` |