- Red Hat Enterprise Linux 7
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
- Rootless user is trying to access /var/run/docker.sock(/run/docker.sock which is a symlink to /run/podman/podman.sock) which is not accessible by a rootless user and only the root user can access it.
- The socket a rootless user uses is
- /run/docker.sock can not be used as a rootless user, the users socket needs to be enabled with
systemctl --user enable --now podman.socket, run it as the rootless user and then symlink /run/docker.sock to that socket.
The disadvantage is this can be done only for one user at a time. So if there are multiple users trying to use docker.sock when it's linked to another user's socket it will still fail.
Another option is to export DOCKER_HOST with
P.S: Please note that docker-compose is not supported by Red Hat. So any configuration/error on that part would be unsupported by Red Hat. This document is just guidance as a part of our best efforts.
- Here we show the link from
$ ls -al /run/docker.sock lrwxrwxrwx. 1 root root 23 Mar 16 11:35 /run/docker.sock -> /run/podman/podman.sock
podman.sockis not accessible by rootless user.
$ ls -al /run/podman/podman.sock ls: cannot access '/run/podman/podman.sock': Permission denied
- However if
$XDG_RUNTIME_DIR/podman/podman.sockis used, it works fine.
$ ls -al /run/user/1000/podman/podman.sock srw-rw----. 1 podman podman 0 Mar 16 11:37 /run/user/1000/podman/podman.sock
- Red Hat Enterprise Linux
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.