I can’t find documentation about how to do this. I am migrating my homeserver (docker-compose based) to Silberblue. I have read a lot and have adjusted my compose file for rootless podman-compose.
I have used caddy-docker-proxy for years, it automatically generates the caddyfile based on compose labels and takes care of https/http reverse proxy. But to do that it needs access to podman.sock. It supports podman, I have seen old issues in the Github repository and people confirming it works.
caddy-proxy:
container_name: net-caddy
image: lucaslorentz/caddy-docker-proxy:ci-alpine
restart: always
networks:
- net-caddy
environment:
- CADDY_INGRESS_NETWORKS=net-caddy
- CADDY_DOCKER_NO_SCOPE=true
volumes:
- /run/user/1000/podman/podman.sock:/var/run/docker.sock
- $DOCKERDIR/network/caddy-proxy/caddy_data:/data:Z
- $DOCKERDIR/network/caddy-proxy/config:/config:Z
ports:
- 443:443
- 80:80
labels:
caddy.email: $EMAIL
Unfortunately it has trouble connecting to the socket. I did check with podman info
which clearly shows
{"level":"info","ts":1738271453.6760228,"logger":"docker-proxy","msg":"Running caddy proxy controller"}
{"level":"error","ts":1738271453.676158,"logger":"docker-proxy","msg":"Docker ping failed","error":"permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Head \"http://%2Fvar%2Frun%2Fdocker.sock/_ping\": dial unix /var/run/docker.sock: connect: permission denied"}
Error: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Head "http://%2Fvar%2Frun%2Fdocker.sock/_ping": dial unix /var/run/docker.sock: connect: permission denied
remoteSocket:
exists: true
path: /run/user/1000/podman/podman.sock
Same result after systemctl enable --now podman.socket
. The socket is running:
systemctl status podman.socket
● podman.socket - Podman API Socket
Loaded: loaded (/usr/lib/systemd/system/podman.socket; enabled; preset: disabled)
Active: active (listening) since Thu 2025-01-30 22:09:43 CET; 23min ago
Invocation: 2a2ff8c48fea4973bd79421fd4136c09
Triggers: ● podman.service
Docs: man:podman-system-service(1)
Listen: /run/podman/podman.sock (Stream)
CGroup: /system.slice/podman.socket
Jan 30 22:09:43 obelix.o systemd[1]: Listening on podman.socket - Podman API Socket.
Also, the user does have access to the socket, if I use the right path:
❯ ls -al /run/podman/podman.sock
ls: cannot access '/run/podman/podman.sock': Permission denied
❯ ls -al /run/user/1000/podman/podman.sock
total 0
drwxr-xr-x. 2 asterix asterix 40 Jan 30 21:58 .
drwxr-xr-x. 3 asterix asterix 60 Jan 30 21:58 .
So I expect it to work… Caddy is my only container that needs the socket access hence I did not bump into this before. It is my most essential container as it handles https access (and even local domain http access within my home network) for all my services.
I must miss something obvious here to get it working, but I can’t find any documentation or topic about this. What am I missing?