Skip to content

Commit

Permalink
fix(podman): added podman-compose systemd files
Browse files Browse the repository at this point in the history
  • Loading branch information
rwxd committed Jun 15, 2023
1 parent cb3f1b2 commit f5a3e25
Showing 1 changed file with 53 additions and 0 deletions.
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
```

0 comments on commit f5a3e25

Please sign in to comment.