Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker toolchain build artifacts are created under the root user on Linux #175

Open
flaki opened this issue Jan 20, 2022 · 3 comments · May be fixed by #342
Open

Docker toolchain build artifacts are created under the root user on Linux #175

flaki opened this issue Jan 20, 2022 · 3 comments · May be fixed by #342
Assignees
Labels
devex Developer experience-related issues os-linux Platform-specific issues for Linux subo-cli Issues related to the subo CLI tool itself

Comments

@flaki
Copy link
Contributor

flaki commented Jan 20, 2022

I'm seeing a weird issue on Linux (Ubuntu 20.04, running as my own user flaki) where subo build . would use the docker build method to build the Rust runnables, and while the runnables.wasm.zip bundle comes out perfectly fine (flaki:flaki user/group), the build artifacts end up in folders that are root:root-owned and cannot be deleted without using sudo.

image

As a result, subo clean fails also without a sudo:
image

@flaki
Copy link
Contributor Author

flaki commented Jul 27, 2022

Okay so this is because we are invoking the toolchain that, by default, runs as root and the mounted volume ends up written by root. It looks like we are missing something to the tune of docker run -u=$UID:$GID from the dockerBuildForLang invocation.

@jagger27 not sure what would be the Go-ism for pulling the currently executing UID/GID from the environment here (or maybe we want to sample the owner/group of the project directory and use those?), but otherwise would be happy to give this PR a Go (hehe).

@flaki flaki self-assigned this Jul 27, 2022
@flaki
Copy link
Contributor Author

flaki commented Aug 3, 2022

Discussed this in chat. The error is Linux-specific, as Docker on Mac OS uses NFS mounts which just "happened to work correctly here". There were previous attempts on fixing this, but we should explore if the docker run -u method is viable.

Me (and @jagger27) will do some testing, if going rootless doesn't break the toolchains than we will try to find a way to get this fixed.

flaki added a commit that referenced this issue Aug 4, 2022
@flaki flaki linked a pull request Aug 4, 2022 that will close this issue
flaki added a commit that referenced this issue Aug 4, 2022
@flaki
Copy link
Contributor Author

flaki commented Aug 4, 2022

Current draft PR (see above) fixes the issue and the breakage introduced in the Rust builder image, will need to make sure the rest of the images are working.

@flaki flaki added subo-cli Issues related to the subo CLI tool itself os-linux Platform-specific issues for Linux devex Developer experience-related issues labels Aug 4, 2022
@flaki flaki linked a pull request Aug 4, 2022 that will close this issue
flaki added a commit that referenced this issue Sep 13, 2022
flaki added a commit that referenced this issue Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devex Developer experience-related issues os-linux Platform-specific issues for Linux subo-cli Issues related to the subo CLI tool itself
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant