Master container should honor DOCKER_HOST variable #6595
-
Master cointainer should honor DOCKER_HOST variable for connections to docker daemon through socket. There is race condition in environments where SELinux and docker's userns-remap features are enabled because of need for socket with right UID/GID and SELinux context. This can be easily done with systemd socat service. Mentioned race condition happens when containers are already started and docker creates directory in place where "userns" socket should be created by systemd socat service because host path is defined as volume. Thus socat service will fail immediately and master container after some time without being able to connect to docker daemon. Steps to reproduce
Expected behavior
Actual behaviorMaster container ignores defined path in DOCKER_HOST and refuses to start because there is no access to docker daemon as it probably uses hardcoded path to docker socket. Other informationSystemd socat service example
Path /run is tmpfs and it doesn't matter who or what will create directory for docker "userns" socket. If it is docker daemon when processing volumes definition or systemd socat service because whole dir content will be overlayed and socket will be created to this overlay in any case. Ofc it is important to keep permissions consistent with remap UID/GID ranges and to have SELinux context set properly. I tried to use WATCHTOWER_DOCKER_SOCK_PATH or DOCKER_SOCK_PATH env vars with no impact at all. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi, thanks for bringing this up! Unfortunately, this looks like a very edgy use case. So I will not work on this. However I will monitor the requests for this feature going forward and added it to #5251 in the meantime. |
Beta Was this translation helpful? Give feedback.
Hi, thanks for bringing this up!
Unfortunately, this looks like a very edgy use case.
So I will not work on this.
However I will monitor the requests for this feature going forward and added it to #5251 in the meantime.