|
| 1 | +# Container Runtime Support (Docker & Podman) |
| 2 | + |
| 3 | +The Unstract docker-compose configuration supports both **Docker** and **Podman** automatically. |
| 4 | + |
| 5 | +## Automatic Detection |
| 6 | + |
| 7 | +By default, the configuration will automatically detect and use the appropriate socket: |
| 8 | +- **Podman rootless**: `/run/user/$UID/podman/podman.sock` |
| 9 | +- **Docker**: `/var/run/docker.sock` |
| 10 | + |
| 11 | +## Using Docker |
| 12 | + |
| 13 | +Just run docker-compose commands normally: |
| 14 | + |
| 15 | +```bash |
| 16 | +VERSION=main docker-compose -f docker-compose.yaml up -d |
| 17 | +``` |
| 18 | + |
| 19 | +No environment variables needed - Docker socket at `/var/run/docker.sock` will be used automatically. |
| 20 | + |
| 21 | +## Using Podman |
| 22 | + |
| 23 | +### Prerequisites |
| 24 | + |
| 25 | +1. **Enable Podman socket** (required for Traefik to discover containers): |
| 26 | + ```bash |
| 27 | + systemctl --user enable podman.socket |
| 28 | + systemctl --user start podman.socket |
| 29 | + ``` |
| 30 | + |
| 31 | +2. **Verify socket is running**: |
| 32 | + ```bash |
| 33 | + systemctl --user status podman.socket |
| 34 | + # Should show: active (listening) |
| 35 | + ``` |
| 36 | + |
| 37 | +### Run with Podman |
| 38 | + |
| 39 | +```bash |
| 40 | +VERSION=main podman-compose -f docker-compose.yaml up -d |
| 41 | +``` |
| 42 | + |
| 43 | +The Podman socket will be automatically detected via `$XDG_RUNTIME_DIR/podman/podman.sock`. |
| 44 | + |
| 45 | +## Manual Override |
| 46 | + |
| 47 | +If you need to specify a custom socket path, set the `DOCKER_SOCKET` environment variable: |
| 48 | + |
| 49 | +```bash |
| 50 | +# Example: Custom Docker socket location |
| 51 | +export DOCKER_SOCKET=/custom/path/docker.sock |
| 52 | +VERSION=main docker-compose -f docker-compose.yaml up -d |
| 53 | + |
| 54 | +# Example: Custom Podman socket location |
| 55 | +export DOCKER_SOCKET=/run/user/$(id -u)/podman/podman.sock |
| 56 | +VERSION=main podman-compose -f docker-compose.yaml up -d |
| 57 | +``` |
| 58 | + |
| 59 | +## Troubleshooting |
| 60 | + |
| 61 | +### Traefik shows "Cannot connect to Docker daemon" |
| 62 | + |
| 63 | +**For Podman users**: |
| 64 | +1. Check if Podman socket is running: |
| 65 | + ```bash |
| 66 | + systemctl --user status podman.socket |
| 67 | + ``` |
| 68 | + |
| 69 | +2. If inactive, start it: |
| 70 | + ```bash |
| 71 | + systemctl --user start podman.socket |
| 72 | + ``` |
| 73 | + |
| 74 | +3. Verify socket file exists: |
| 75 | + ```bash |
| 76 | + ls -la $XDG_RUNTIME_DIR/podman/podman.sock |
| 77 | + # Should show: srw-rw---- (socket file, not directory) |
| 78 | + ``` |
| 79 | + |
| 80 | +4. If it's a directory (wrong), remove and restart: |
| 81 | + ```bash |
| 82 | + rmdir $XDG_RUNTIME_DIR/podman/podman.sock |
| 83 | + systemctl --user restart podman.socket |
| 84 | + ``` |
| 85 | + |
| 86 | +**For Docker users**: |
| 87 | +1. Check if Docker daemon is running: |
| 88 | + ```bash |
| 89 | + systemctl status docker |
| 90 | + ``` |
| 91 | + |
| 92 | +2. Verify socket permissions: |
| 93 | + ```bash |
| 94 | + ls -la /var/run/docker.sock |
| 95 | + ``` |
| 96 | + |
| 97 | +### Port 8081 not accessible |
| 98 | + |
| 99 | +This is the Traefik HTTP port for Podman rootless compatibility. |
| 100 | + |
| 101 | +1. Check if Traefik container is running: |
| 102 | + ```bash |
| 103 | + podman ps | grep unstract-proxy |
| 104 | + # or |
| 105 | + docker ps | grep unstract-proxy |
| 106 | + ``` |
| 107 | + |
| 108 | +2. Check Traefik logs: |
| 109 | + ```bash |
| 110 | + podman logs unstract-proxy |
| 111 | + # or |
| 112 | + docker logs unstract-proxy |
| 113 | + ``` |
| 114 | + |
| 115 | +## Socket Path Priority |
| 116 | + |
| 117 | +The configuration uses this priority order: |
| 118 | + |
| 119 | +1. `$DOCKER_SOCKET` - if explicitly set |
| 120 | +2. `$XDG_RUNTIME_DIR/podman/podman.sock` - for Podman rootless |
| 121 | +3. `/run/user/1000/podman/podman.sock` - fallback for Podman |
| 122 | +4. Falls back to default compose behavior (typically `/var/run/docker.sock`) |
| 123 | + |
| 124 | +## Technical Details |
| 125 | + |
| 126 | +The docker-compose files use this volume mount configuration: |
| 127 | + |
| 128 | +```yaml |
| 129 | +volumes: |
| 130 | + - ${DOCKER_SOCKET:-${XDG_RUNTIME_DIR:-/run/user/1000}/podman/podman.sock}:/var/run/docker.sock |
| 131 | +``` |
| 132 | +
|
| 133 | +This means: |
| 134 | +- If `DOCKER_SOCKET` is set → use that |
| 135 | +- Else if `XDG_RUNTIME_DIR` is set → use `$XDG_RUNTIME_DIR/podman/podman.sock` |
| 136 | +- Else → use `/run/user/1000/podman/podman.sock` |
| 137 | + |
| 138 | +For Docker, you can set: |
| 139 | +```bash |
| 140 | +export DOCKER_SOCKET=/var/run/docker.sock |
| 141 | +``` |
| 142 | + |
| 143 | +But it's usually not necessary since Docker Compose will use `/var/run/docker.sock` by default when the variable is unset. |
0 commit comments