-
Notifications
You must be signed in to change notification settings - Fork 711
Does volume mounting support sockets, for example mounting docker.sock (docker runtime) for use with Portainer #422
-
Hi,
I was trying to run Portainer but the process fails to communicate with the mounted docker.sock (I'm using the Docker runtime), is this something that should be feasible, I'm assuming volume mounting does not support sockets perhaps.
limactl start ./docker.yaml # used the example yaml
export DOCKER_HOST=unix://$HOME/docker.sock
docker volume create portainer_data
docker run -d -p 8000:8000 -p 9443:9443 --name portainer -v $HOME/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
Connecting to the UI, and pointing it at the mounted /var/run/docker.sock fails as it can't communicate with the mounted socket.
Beta Was this translation helpful? Give feedback.
All reactions
-v $HOME/docker.sock:/var/run/docker.sock
You probably meant -v /run/user/XXXXX/docker.sock:/var/run/docker.sock
Replies: 1 comment 1 reply
-
-v $HOME/docker.sock:/var/run/docker.sock
You probably meant -v /run/user/XXXXX/docker.sock:/var/run/docker.sock
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Ahh, I hadn't considered running from inside the lima vm, that works, and the port forwards are accessible from the OSX host. I had previously been attempting to run from the OSX host rather than in the vm.
limactl shell docker
docker volume create portainer_data
docker run -d -p 8000:8000 -p 9443:9443 --name portainer -v /run/user/<your userid>/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
The UI is then accessible at https://localhost:9443 with, as you point out, the socket then being accessible in the portainer container at the mount point /var/run/docker.sock
as expected.
Is allowing the socket forwarded to the host (what I originally tried) to be used something that you see being supported in future, would allow use cases like portainer to work identically to how they worked with Docker Desktop, ie without having to shell into the vm?
Thanks again for your help !!
Beta Was this translation helpful? Give feedback.