-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
yarn install
fails inside a Docker Container with --userns-remap
enabled
#1750
Comments
Same issue here, happens with builds in CircleCI. |
Based on the giant UIDs/GIDs in the I dug around for a bit and I found that
This is my progress so far and I will update if I find out more |
Let us consider the tarball from https://registry.yarnpkg.com/react-select-plus/-/react-select-plus-1.0.0-rc.1.patch1.tgz If we list the tar contents:
You can see that the UID for The cause of this whole problem is this line of code. We are running as root in the container, but not really root because of the user namespace. There have been many issues related to this (e.g. isaacs/node-tar#39 and npm/fstream#52 to list a few). The workaround should do. NPM seems to get around this by re-setting the UID/GID to the current user unless |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Running
yarn install
in a Docker container with the daemon having--userns-remap
enabled fails with the following:If the current behavior is a bug, please provide the steps to reproduce.
Start the Docker daemon with
--userns-remap
enabled.Then try to run or build a Docker image with
yarn install
:I am running
--userns-remap=teamcity:teamcity
with the following information:What is the expected behavior?
Successful installation
I believe this is the same issue encountered in #1485, #918 and #869. If I do
npm install
, it installs successfully.If I run the container with
--userns=host
, it runs successfully. So I can only conclude this issue is due to the Linux user namespace.Please mention your node.js, yarn and operating system version.
strace:
package.json
The text was updated successfully, but these errors were encountered: