stable-diffusion-webui-docker/docs/Podman-Support.md
fapoverflow ab47d2c699 Update
2025-07-07 07:58:25 +02:00

1.7 KiB

Thanks to RedTopper for this guide! #352

On an selinux machine like Fedora, append :z to the volume mounts. This tells selinux that the files are shared between containers (required for download and your UI of choice to access the same files). Properly merging :z with an override will work in podman compose 1.0.7, specifically commit 0b853f29f4

x-base_service: &base_service
    volumes:
      - &v1 ./data:/data:z
      - &v2 ./output:/output:z

You'll also need to add the runtime and security opts to allow access to your GPU. This can be specified in an override, no new versions required! More information can be found at this RedHat post: How to enable NVIDIA GPUs in containers.

x-base_service: &base_service
    ...
    runtime: nvidia
    security_opt:
      - label=type:nvidia_container_t

I also had to add ,Z to the pip/apt caches for them to work. On the first build everything will be fine without the fix, but on the second+ build, you may get a "file not found" when pip goes to install a package from the cache. Here's a script to do this easily, along with more info: https://github.com/RedTopper/Stable-Diffusion-Webui-Podman/blob/podman/selinux-cache.sh.

Lastly, delete all the services you don't want to use. Using --profile will work in podman compose 1.0.7, specifically commit 8d8df0bc28