Closed willtcarey closed 8 months ago
Hi William,
We discussed this feature in that issue #153. If you are ready, we would appreciate it if you could implement it for us.
@bibendi Ah thank you. I missed that issue when I first searched for things. I'll submit a PR soon
I'm doing some work with Docker bind mounts where our Rails app creates files through generators that are then not owned by our user outside of the docker container.
I'm working on getting around this by injecting the current user's UID into the Docker build but unfortunately the
UID
env var is not exported by default in most shells so it is not forwarded to thedip
process. So to make this work for my team I need to get everyone to do addexport UID=$UID
orexport UID=$(id -u)
to their shell environment.What I would like to do is have
dip
expose a special variable of the current host user's UID that I could set in the environment that gets forwarded on to docker compose, similar to theWORK_DIR
andOS
variables that get set currently. Alternatively, if a feature could be added to dynamically compute env vars in the dip config that would work as well (we could set the value ofid -u
to an ENV var).There has been desire to do this in docker compose itself, but it's mostly gone nowhere because the Docker team wants to keep the docker compose file portable between systems, which makes sense. But I feel like dip can work a level above that and we can inject the platform independent values from the config or from Ruby.
I'm happy to do a PR to implement this, but I wanted to get some buy-in from the dip team or hear any concerns or objections you might have.