Compose-unpacker uses hardcoded `/run/podman/podman.sock` host bind, breaking relative path git stacks on rootless Podman
Before you start please confirm the following.
- Yes, I've searched similar issues on GitHub.
- Yes, I've checked whether this issue is covered in the Portainer documentation.
Problem Description
Stacks that use the relative-path-volumes feature fail to deploy on environments whose agent is talking to a rootless Podman socket. The deployment fails with:
make cli opts(): making volume mountpoint for volume /run/podman/podman.sock: mkdir /run/podman/podman.sock: permission deniedThe agent itself is set up the way the docs suggest for rootless Podman, with the user socket mounted as the Docker socket:
-v /run/user/$(id -u)/podman/podman.sock:/var/run/docker.sockPlain stacks with no relative-path volumes deploy fine on the exact same environment. Only stacks that enable the relative-path-volumes feature run into this, because only those go through the compose-unpacker container.
Note that the relative-path volumes feature is specially appealing for rootless deployments, as otherwise the directory to unpack volumes is /data which would typically be inaccessible by rootless deployments and for this reason I believe this issue is relevant, even though I am aware that rootless is not officially supported.
Expected Behavior
A stack that uses relative-path volumes deploys successfully on a Podman environment regardless of whether the Podman daemon is rootful or rootless, as long as the agent itself was started with a working socket bind.
We understand that rootless Podman is not fully supported, but it would be very convenient if the compose unpacker container used the same socket bind that was bound to the Portainer agent.
Actual Behavior
The deployment fails. The compose-unpacker container cannot start because the daemon refuses to create the host bind source /run/podman/podman.sock:
make cli opts(): making volume mountpoint for volume /run/podman/podman.sock: mkdir /run/podman/podman.sock: permission deniedThe stack is left undeployed. Stacks that do not use the relative-path-volumes feature deploy normally on the same environment.
Steps to Reproduce
- On a Linux host, run rootless Podman and enable its user socket (
systemctl --user enable --now podman.socket). The socket is at/run/user/<uid>/podman/podman.sock./run/podman/podman.sockmust not be accessible by this user. - Start the Portainer agent on that host with the rootless socket mounted as the Docker socket, for example:
podman run -d \
-v /run/user/$(id -u)/podman/podman.sock:/var/run/docker.sock \
-v /var/lib/containers/storage/volumes:/var/lib/docker/volumes \
-v /:/host \
-v portainer_agent_data:/data \
--restart always \
--privileged \
-e EDGE=1 \
-e EDGE_ID=[...] \
-e EDGE_KEY=[...] \
--name portainer_edge_agent \
portainer/agent:2.33.5- Add the environment in Portainer and confirm it connects. Verify that a normal stack (no relative-path volumes) deploys successfully either through the online editor or via git.
- Create a new stack from git on this environment with the relative-path-volumes feature enabled (per https://docs.portainer.io/user/docker/stacks/add#relative-path-volumes), using any compose file that has a relative bind volume. The following repository mirrors exactly the setup described in the relative-paths article and is suitable for this test: https://github.com/b-Tomas/portainer-gitops-test
- Deploy the stack.
- The deployment fails with the error quoted above.
Portainer logs or screenshots
Unable to create unpacker container: Error response from daemon: make cli opts(): making volume mountpoint for volume /run/podman/podman.sock: mkdir /run/podman/podman.sock: permission deniedPortainer version
2.33.5
Portainer Edition
Business Edition (BE/EE) with 5NF / 3NF license
Platform and Version
Podman 5.6.0
OS and Architecture
Red Hat Enterprise Linux 9.7, x86_64
Browser
No response
What command did you use to deploy Portainer?
podman run -d \
-v /run/user/$(id -u)/podman/podman.sock:/var/run/docker.sock:Z \
-v $HOME/.local/share/containers/storage/volumes:/var/lib/docker/volumes:Z \
-v /:/host \
-v portainer_agent_data:/data \
--restart always \
--privileged \
-e EDGE=1 \
-e EDGE_ID=[...] \
-e EDGE_KEY=[...] \
--name portainer_edge_agent \
portainer/agent:2.33.5Additional Information
From a quick scan the issue appears to be the following harcoded socket path, but I am not certain:
Source: portainer/portainer