dokuwiki:docker:setup_using_podman
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| dokuwiki:docker:setup_using_podman [2023/10/03 21:57] – created admin | dokuwiki:docker:setup_using_podman [2024/10/06 16:06] (current) – admin | ||
|---|---|---|---|
| Line 26: | Line 26: | ||
| We use an " | We use an " | ||
| We run it using podmans pseudo root (mapped to the current user) technology. That's why we only use the root user. This is mapped to the current user automatically. | We run it using podmans pseudo root (mapped to the current user) technology. That's why we only use the root user. This is mapped to the current user automatically. | ||
| - | php-fpm tries hard to prevent users from running it as root. We need to change the startup options using this script `$HOME/ | + | php-fpm tries hard to prevent users from running it as root. We need to change the startup options using this script `$HOME/ |
| ```bash | ```bash | ||
| # | # | ||
| Line 34: | Line 34: | ||
| ``` | ``` | ||
| - | `$(pwd)` is meant to run from < | + | [quadlet](https:// |
| + | |||
| + | ```ini | ||
| + | [Unit] | ||
| + | Description=Wiki for documenting various service setups | ||
| + | |||
| + | [Container] | ||
| + | Image=lscr.io/ | ||
| + | Environment=PUID=0 | ||
| + | Environment=PGID=0 | ||
| + | Environment=TZ=Europe/ | ||
| + | PublishPort=50080: | ||
| + | PublishPort=50443: | ||
| + | Volume=/home/ | ||
| + | Volume=/ | ||
| + | Volume=/ | ||
| + | AutoUpdate=registry | ||
| + | |||
| + | [Install] | ||
| + | WantedBy=multi-user.target | ||
| - | ```bash | ||
| - | podman run -d \ | ||
| - | --name=dokuwiki \ | ||
| - | -e PUID=0 \ | ||
| - | -e PGID=0 \ | ||
| - | -e TZ=Europe/ | ||
| - | -p 50080:80 \ | ||
| - | -p 50443:443 \ | ||
| - | -v $(pwd)/ | ||
| - | -v $(pwd)/ | ||
| - | lscr.io/ | ||
| ``` | ``` | ||
| + | Replace `$USER` so it points to the correct user directory. Create this as `dokuwiki.container` in `/ | ||
| + | |||
| + | This creates a dokuwiki service with the correct podman call and also enables auto updates using `podman auto-update` | ||
| - | For podman we can create such a container but need to mange start/stop with systemd. | ||
| - | podman has a build in generator for this. This recreates the container, it does not just start it so we can delete the container we created manually. | ||
| ```bash | ```bash | ||
| - | podman generate systemd --new --files --name dokuwiki | ||
| - | mkdir -p ~/ | ||
| - | cp -Z container-dokuwiki.service ~/ | ||
| systemctl --user daemon-reload | systemctl --user daemon-reload | ||
| - | podman stop dokuwiki | + | systemctl --user start dokuwiki |
| - | podman rm dokuwiki | + | systemctl --user status dokuwiki |
| - | podman volume prune | + | systemctl --user enable |
| - | systemctl --user start container-dokuwiki | + | # by default user processes will be terminated after logout |
| - | systemctl --user status | + | sudo loginctl enable-linger $USER |
| - | systemctl --user enable | + | |
| ``` | ``` | ||
| Line 111: | Line 116: | ||
| systemctl start httpd | systemctl start httpd | ||
| setenforce 1 | setenforce 1 | ||
| + | ``` | ||
| + | |||
| + | ## Auto update | ||
| + | |||
| + | ```bash | ||
| + | podman auto-update --dry-run --format " | ||
| + | # lscr.io/ | ||
| + | podman auto-update | ||
| ``` | ``` | ||
dokuwiki/docker/setup_using_podman.1696363032.txt.gz · Last modified: by admin