I'm trying to access a Docker Unix socket on a remote server from within a Podman container (offen/docker-volume-backup
).
I've (root-)mounted the entire root filesystem of the remote server using sshfs
and can access it as root.
However, I can't connect to the Unix socket. (All servers are on AlmaLinux with SELinux, and Podman is used with sudo.)
I've tried the following settings in my Podman container:
volumes: - /mnt/fuse_to_somewhere/var/run/docker.sock:/var/run/docker.sock:ro,z security_opt: - label=disable privileged: - true
But I still get this error:
Commands: error querying for containers: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Questions:
- What steps are needed to connect to the Docker Unix socket from a Podman container?
- Are there specific permissions required for accessing the Docker socket over sshfs?
offen/docker-volume-backup
is a docker image and which I wish to let (read) access the/var/run/docker.sock
on the main host. (Offsite Backup)wollomatic/socket-proxy
on the main host within the Docker environment (which I wanted to try anyway) and then exposing it as a TCP socket over SSH. Ideally, I would like a solution that allows me to connect a Podman network and a Docker network over SSH. This way, I can easily add the TCP socket and the Podman containers that need access to the Docker socket to the network. Do you have any suggestions on how to achieve this and whether it's a good idea?