#I seem to be having some issues using
1 messages · Page 1 of 1 (latest)
I've experienced this struggle as well. fwiw, it is not exclusive to Dagger.
Kubernetes behaves the same in this regard. If you mount a directory with fsGroup set, all of the parent directories that didn't exist in the image get created as root, and only the actually mounted directory gets the permissions that you want
I've wondered why this is so ubiquitous
My workaround has naturally been chown -R, but I do wish that I didn't need to do that
I tried chown -R, but that doesn't seem to work because it is executed as a non-root user, so I can't actually reclaim the ownership. If a containers default user is not root, I'm not sure how to get around this.
This doesn't work?
container.WithUser("root").WithExec([]string{"chown", "-R", "nonroot:nonroot", "/some/path"}).WithUser("nonroot")
Lemme try that. My previous attempts using WithUser didn't produce different results.