techknowlogick / xgo

Go CGO cross compiler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

running docker as current user conflicts with `/deps` and `/deps-build`

steabert opened this issue · comments

I'm running xgo with the option:

-dockerargs "-u,$(id -u):$(id -g)"

so that the docker image is run as the current user. This prevents xgo from creating any root-owned files in some of the mounted volumes (since it automatically mounts ~/go and ~/.xgo-cache`).

This works great for me, but I noticed that the build script complains about not being able to create /deps and/or /deps-build (as you would need to be root in the container). I don't use that feature, but I wondered if it would be possible to also couple these to user-owned directories somehow? That would allow xgo to maybe by default run as the current user, which is IMHO a much better solution than trying to chown after the fact.