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

Add --user flag support for wp-env #42866

Open
Luc45 opened this issue Aug 1, 2022 · 1 comment · May be fixed by #42867
Open

Add --user flag support for wp-env #42866

Luc45 opened this issue Aug 1, 2022 · 1 comment · May be fixed by #42867
Assignees
Labels
[Status] In Progress Tracking issues with work in progress [Tool] Env /packages/env [Type] Enhancement A suggestion for improvement.

Comments

@Luc45
Copy link

Luc45 commented Aug 1, 2022

What problem does this address?

Running wp-env in Linux is annoying because it creates files with user 0:0 (root).

What is your proposed solution?

One possible solution is to add:

const os = require("os");

const composeCommand = [
	'-u',
	os.userInfo().uid,
];

Here: https://github.com/WordPress/gutenberg/blob/trunk/packages/env/lib/commands/run.js#L52-L59 (right before or after the --rm array value, as -u is a flag of run)

Effectively running the docker command as the user running wp-env.

Another possibility is making this an optional behavior, since it affects mostly Linux users, as the VM for Docker Desktop for Mac and Windows takes care of UID mapping.

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Aug 1, 2022
@kopepasah
Copy link
Member

I too would like this feature, as we are developing a CI/CD pipeline with @wordpress/env, and using a wp-env command is more intuitive that running docker-compose directly.

@jordesign jordesign added [Type] Enhancement A suggestion for improvement. [Tool] Env /packages/env labels Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] In Progress Tracking issues with work in progress [Tool] Env /packages/env [Type] Enhancement A suggestion for improvement.
Projects
None yet
3 participants