[BUG] Rootless docker requires changes to /var/run/docker.sock binding
Bug report
Describe the bug Rootless docker works aside from things that rely on the docker.sock -v "/var/run/docker.sock:/var/run/docker.sock"
it can be fixed with the replacement (assuming the user is #1000)
/run/user/1000/docker.sock
-v "/run/user/1000/docker.sock:/var/run/docker.sock"
or volumes: - type: bind source: /run/user/1000/docker.sock target: /var/run/docker.sock bind: create_host_path: true
To Reproduce Steps to reproduce the behavior: install Docker rootless spin up a portainer instance. the Primary environment is down if I edit the portainer.yml to
services:
portainer:
command: "-H unix:///var/run/docker.sock"
container_name: portainer
environment:
- TZ=${TZ}
logging:
driver: json-file
options:
max-file: ${DOCKERLOGGING_MAXFILE}
max-size: ${DOCKERLOGGING_MAXSIZE}
restart: ${PORTAINER_RESTART}
volumes:
- /etc/localtime:/etc/localtime:ro
- /run/user/1000/docker.sock:/var/run/docker.sock
- ${DOCKERCONFDIR}/portainer:/data
- ${DOCKERSTORAGEDIR}:/storage
then it works fine.
Expected behavior Docker Rootless would act like root
Screenshots
unmodified:
modified:
System (please complete the following information):
- OS: Armbian
- Version Linux 6.1.21-v8+
#1642SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
Additional context it's relatively easy to fix but I'm not sure how to properly override this, so I keep getting stepped on by re-running creation. This may require a new global variable to identify if the user is rootless and if so what their UID is.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Sorry for not responding sooner. I think the only way we could safely do this would be to make the host side of the docker socket volume a variable for the user to set. With that, if you know what to set, you could accomplish rootless, but I imagine many users might not know what to set the value to. The default value would be filled with the existing (root) docker socket.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Making the host side of the docker socket a variable for every container individually is being done in #1729 which is full of many other changes.
I don't know if it would be better to make it a global or individual (i'm assuming users probably wouldn't ever have some apps using root and some not, but i don't know) i may try to add some detection for the docker socket.
Can you post the output of docker context inspect ?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.