-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for group_add in docker-compose #1318
Comments
Any workarounds available? |
As mentioned here, one thing you can do is just to build the container, and add a |
This is just absolutely awful. Docker and docker-compose developers randomly remove features without a word of explanation. WHY did you remove this feature? Oh, OF COURSE you will evade this by saying that the feature isn't technically removed, and you will be technically right. It is not removed, it is just limited to being used as part of a narrow and ancient feature set that is mutually exclusive with all the new features. |
The documentation says:
However, the linked upgrading guide simply says that the group_add feature has been removed (at least in so far as it being unavailable as a stack), without providing an alternative. Is there an alternative that doesn't require modifying the image's Dockerfile? |
This would be incredibly useful for media server containers. |
Is this currently being worked on? |
what is the status now? |
The workaround provided by @moble doesn't seems to work, at least for the current version. After adding those commands inside Dockerfile, |
@Toilal Same issue. Namely with MacOS. # Group ID of Docker Group on the Host
$(cat /etc/group | grep docker: | cut -d: -f3) The result is the GID of docker group on the host which can be forwarded by env vars, which should be handled by the entrypoint. |
Alternatives using modification of the docker file or the entrypoint are not appropriate when using a pre-build image (nextcloud in my case) as it might break some functionality in an uncontrolled way. |
Adding |
Is this still an issue? $ docker-compose version
docker-compose version 1.27.4, build 40524192
docker-py version: 4.3.1
CPython version: 3.7.7
OpenSSL version: OpenSSL 1.1.0l 10 Sep 2019
$ echo "$CONFIG" | docker-compose -f - config
services:
foo:
group_add:
- 1000
- 1001
- 1002
image: ubuntu
version: '3.8'
$ echo "$CONFIG" | docker-compose -p group_add -f - run --rm foo /bin/bash -c id
Creating group_add_foo_run ... done
uid=0(root) gid=0(root) groups=0(root),1000,1001,1002 Is this another documentation error, but in reverse? |
Since 1.27.0, version 2.x and version 3.x schema are merged. So group_add is supported with 1.27.0+ docker-compose for all v2, v3 versions. |
Closing as implemented by compose-go |
As described here, support for the
group_add
option was removed for version 3.x files of docker-compose based on the fact that Swarm services did not support that option at the time. But that's no longer the case, so it would be very helpful if it could be added back in now. As seen here there is evidently some desire for this feature.related:
--group
indocker service create
moby/moby#25317 Support--group
indocker service create
The text was updated successfully, but these errors were encountered: