For container to access host docker daemon, I use to bind mount /var/run/docker.sock
and docker
executable. But then I also need to add docker
group to the container user so it can access the socket. For this purpose I use docker run --group-add
option, but can't find how to do the same with docker-compose.
Any schedule to add "--group-add" to docker-compose?
I needed this too, and took a crack at it with PR #3709.
Thanks, @Knetic !
I'll follow #3709
It was merged and is available in 1.9.0-rc4 https://github.com/docker/compose/releases :-]
I think this issue can be closed.
I couldn't get this to work. The documentation seems wrong : it displays a snippet like this :
version: '3'
services:
image: alpine
group_add:
- mail
Running docker-compose with this returns Unsupported config option for services: 'group_add'
I tried this too :
version: '3'
services:
myservice:
image: alpine
group_add:
- mail
Running docker-compose with this returns Unsupported config option for services.myservice: 'group_add'
Is the option available somehow and the bug is just in the documentation ?
I fixed my examples to reflect what I actually tested, which was version: '3', not version: '2'
@psoares group_add
feature has been removed in version 3. See: https://docs.docker.com/compose/compose-file/compose-versioning/#version-3
Is there any reason why they removed group_add support?
Yeah I mean the migration doco doesn't exactly spell out the alternative...
"group_add: This option has been removed for version: "3.x" Compose files."
Similar to others, I'm hoping to expose the underlying docker socket in a Jenkins container
How to do now ??
Agree with the others here, why was this removed without any explanation?
This comment suggests that this is not the appropriate repo for this request. (I don't understand any of this.) Anyway, as suggested, I've created an issue requesting this over here.
Issue grooming: dada36f732ed7f7fc05c0f9841a432c490c7ff9c added this for v2 it seems. The issue with v3 support is different and according to the preceding comments are already reported in the appropriate places.
Most helpful comment
How to do now ??