Repository navigation
Conversation
Makes `gid=1000` (the non-root user `node`'s group id) the owning group of `/usr/local/bin`. This enables the non-root user to perform operations like `corepack {enable,prepare,...}` without permission errors.
Closes 1732.
|
I would advocate against this change. While it may solve the problem, it compromises security by allowing a non-root user access to a directory that should be reserved for root. |
@meyfa If you know of a better way, happy to resubmit |
|
After symlinking into && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
+ && NODE_HOME="$(getent passwd node | cut -d: -f6)" \
+ && mkdir -p $NODE_HOME/bin && ln -s "$(which corepack)" $NODE_HOME/bin/corepack \
+ && echo 'export PATH="$HOME/bin:$PATH"' >>$NODE_HOME/.bashrc && chown -R node:node $NODE_HOME/bin \
# smoke test
&& yarn --versionachieves desired outcome. (The PATH precedence stuff is already in Thoughts? |
|
<chmod|chown|chgrp>'ing dir(s) in the /usr/local tree is a hacky workaround. It'd be better/cleaner/better/*nix-FSH-compliant to solve another way. Other alternative impls I tried (which i also didn't like)
For my use cases of docker.io/_/node (base for ephemeral build environments only) I'm ok w/ adding this hack downstream, but don't think it should be used here. If |
Description
Makes
gid=1000(the non-root usernode's group id) the owning group of/usr/local/bin. This enables the non-root user to perform operations likecorepack {enable,prepare,...}without permission errors.Closes 1732.
Testing Details
manual: (see Q about testing in checklist section)
Example Output(if appropriate)
Types of changes
Checklist
tests? I don't see how to run a suite