How to get the $uid / $gid variables in custom docker compose services? #4733
Replies: 2 comments 3 replies
-
DDEV doesn't add extra layers to your custom services. You can add them in your docker-compose.*.yaml though, just (as you saw) by adding a build stage as you saw. And I know you'd rather have this done for you, because you can't put all of your team's info in there. I'm not sure how I know how to do what you need, because DDEV would likely break lots of services by inserting extra layers. At this point, DDEV doesn't know that your project's Dockerfile exists. It's not even in the scope of DDEV's world. So I guess you have a build stage for zap-bare... but DDEV doesn't know that, and couldn't know it without inspecting your docker-compose.zap.yaml. This sounds like a hard problem. |
Beta Was this translation helpful? Give feedback.
-
@rfay Are you sure you can't just export the username, uid & gid as environment variables before handing over to Is there a technical reason this information could not just be exported together with the other environment vars? Do you see any other solution to this problem? Ironically, I am just struck by this as I have tried to pull of a Playwright addon without stacking it into the web service like @deviantintegral (which I now understand might be the only way to get around the permissions issue). Another - more complex- solution could be to add that extra layer (I assume you are referring to the Go templating like here?) right into the API of DDEV addons' If there was support for |
Beta Was this translation helpful? Give feedback.
-
We've been extending a project with additional ddev services, most recently with ZAP. In this case, we want to bind-mount in a directory to save reports generated by the scan. By default, this image (and others I've worked with) have UIDs set to something like
1000
.I thought we could fix this with:
And then:
However, looking at
.ddev/.ddev-docker-compose-full.yaml
, only the web and database containers have uid / gid args passed in:Since these values are per-host, is there any way to get ddev to include these three values in all compose services?
Beta Was this translation helpful? Give feedback.
All reactions