User Tools

Site Tools


dokuwiki:docker:setup_using_podman

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
dokuwiki:docker:setup_using_podman [2023/10/03 21:57] – created admindokuwiki:docker:setup_using_podman [2024/10/06 16:06] (current) admin
Line 26: Line 26:
 We use an "official" container image. This image assumes to run as a docker and therefore root image.   We use an "official" container image. This image assumes to run as a docker and therefore root image.  
 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/dokuwiki-svc-php-fpm-run:+php-fpm tries hard to prevent users from running it as root. We need to change the startup options using this script `$HOME/dokuwiki-svc-php-fpm-run`:
 ```bash ```bash
 #!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bash
Line 34: Line 34:
 ``` ```
  
-`$(pwd)is meant to run from <user> home directory:+[quadlet](https://man.archlinux.org/man/quadlet.5.en) is the podman way of running containers using systemd: 
 + 
 +```ini 
 +[Unit] 
 +Description=Wiki for documenting various service setups 
 + 
 +[Container] 
 +Image=lscr.io/linuxserver/dokuwiki:latest 
 +Environment=PUID=0 
 +Environment=PGID=0 
 +Environment=TZ=Europe/Vienna 
 +PublishPort=50080:80 
 +PublishPort=50443:443 
 +Volume=/home/$USER/dokuwiki:/config:z 
 +Volume=/home/$USER/dokuwiki-data/:/config/dokuwiki/data/:
 +Volume=/home/$USER/dokuwiki-svc-php-fpm-run:/etc/s6-overlay/s6-rc.d/svc-php-fpm/run:
 +AutoUpdate=registry 
 + 
 +[Install] 
 +WantedBy=multi-user.target
  
-```bash 
-podman run -d \ 
-  --name=dokuwiki \ 
-  -e PUID=0 \ 
-  -e PGID=0 \ 
-  -e TZ=Europe/Vienna \ 
-  -p 50080:80 \ 
-  -p 50443:443 \ 
-  -v $(pwd)/dokuwiki:/config:z -v $(pwd)/dokuwiki-data/:/config/dokuwiki/data/:z \ 
-  -v $(pwd)/dokuwiki-svc-php-fpm-run:/etc/s6-overlay/s6-rc.d/svc-php-fpm/run:z 
-  lscr.io/linuxserver/dokuwiki:latest 
 ``` ```
 +Replace `$USER` so it points to the correct user directory. Create this as `dokuwiki.container` in `/home/$USER/.config/containers/systemd`  
 +
 +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 ~/.config/systemd/user/ 
-cp -Z container-dokuwiki.service ~/.config/systemd/user/ 
 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 dokuwiki 
-systemctl --user start container-dokuwiki +# by default user processes will be terminated after logout 
-systemctl --user status container-dokuwiki +sudo loginctl enable-linger $USER
-systemctl --user enable container-dokuwiki+
 ``` ```
  
Line 111: Line 116:
 systemctl start httpd systemctl start httpd
 setenforce 1 setenforce 1
 +```
 +
 +## Auto update
 +
 +```bash
 +podman auto-update --dry-run --format "{{.Image}} {{.Updated}}"
 +# lscr.io/linuxserver/dokuwiki:latest pending
 +podman auto-update
 ``` ```
  
dokuwiki/docker/setup_using_podman.1696363032.txt.gz · Last modified: by admin