-
Notifications
You must be signed in to change notification settings - Fork 237
Docker socket permissions for health checks? #50
Comments
Have you tried giving your consul container access to the socket via group membership? E.g.
Notice the |
It doesn't actually help; and the reason that it doesn't is that
|
Ah, shoot. I had forgotten about the drop-down via |
I feel like the easiest change would look like if [ -S /var/run/docker.sock ]; then
GID=$(stat -c %g /var/run/docker.sock)
if ! getent group $GID >/dev/null; then
addgroup -g $GID docker
fi
adduser consul $(getent group $GID | sed 's/:.*//')
fi immediately before the |
Any update on that? |
I've also run across this and was wondering about the status? |
I have this problem too.
After that it worked. What I've tried to set for consul/healthcheck container startup:
This didn't help. With or without "--group-add 999" on consul/healthcheck |
Any update on this one? We're experiencing the same issue, and running:
feels extremely dirty. |
I think there are 3 options in total:
Personally, I would choose the third option. It does also mean that you will have to ensure that any volume mounted to the data directory is writable by that user and the volume mounted to the config directory is readable by that user. |
Is there still interest in pushing this forward? If not, given that it doesn't have exactly a clear consensus on the path forward and considering it's been over a year since we've had any update, I'm considering just closing it out and revisiting when/if the time comes. I'll let this simmer for a bit. |
I'm currently using a locally-built Consul image, that runs as root, and that includes a couple of Docker health checks. I'm trying to migrate to using the official image, and running into permission issues.
Say I run Consul as
where the health checks, recursor settings, etc. are in the
$PWD/etc/consul
directory.If the Docker socket on the host (
/var/run/docker.sock
) is world-writeable, this works fine. If I'm on an Ubuntu 16.04 host, where the socket is mode 0660 owned by user 0 group 16, the Docker health checks silently fail, since this container (viagosu
) runs its process as user 1000 group 1000.Are there best practices for giving Consul permission to
docker exec
? I'm not comfortable with the broader implications of making the Docker socket world-writeable or opening a TCP version of it, I only want to give permission to Consul.The text was updated successfully, but these errors were encountered: