compose-spec / compose-go

Reference library for parsing and loading Compose YAML files
https://compose-spec.io
Apache License 2.0
350 stars 109 forks source link

feat(options): Add WithUser to set current user id and group id #646

Closed idsulik closed 2 months ago

idsulik commented 2 months ago

Issue https://github.com/docker/compose/issues/7853

Added WithUserEnv to support COMPOSE_USER_ID and COMPOSE_GROUP_ID env values in compose.yaml

ndeloof commented 2 months ago

already discussed on https://github.com/compose-spec/compose-go/pull/572 no consensus here on the right way to address this issue

idsulik commented 2 months ago

@ndeloof , oh, haven't noticed it. https://github.com/compose-spec/compose-spec/pull/282#pullrequestreview-1382209783 (However, I think it's reasonable to support in docker/compose:) - what if I add it to compose repo?

like that: cmd/compose/compose.go:353 image

idsulik commented 2 months ago

it's obvious that users need it according to comments and reactions https://github.com/docker/compose/issues/7853

ndeloof commented 2 months ago

it's obvious there is an issue with bind mount ownership when it comes to local UID vs container's user, but this doesn't mean we all agree on the right way to manage this challenge. Adopting such UID/GID variables would makes compose configuration non-portable, which would break a major break in compose history after 10 years