Skip to content

Crashing in docker container because of "username" package #123

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

Open
raido opened this issue Jan 25, 2019 · 5 comments
Open

Crashing in docker container because of "username" package #123

raido opened this issue Jan 25, 2019 · 5 comments

Comments

@raido
Copy link

raido commented Jan 25, 2019

https://github.com/rwjblue/ember-cli-cjs-transform/blob/master/src/cjs-transform.js#L19

Line above assumes username exists, but if for example "ember test" is run with

docker run --user $(id -u):$(id -g) --env XDG_CONFIG_HOME=/myapp/build/.config --env CI=true -i --rm -v $(pwd):/myapp danlynn/ember-cli:latest ember test

Then the docker container is without $HOME and username.

See related issue: sindresorhus/username#21

@raido
Copy link
Author

raido commented Jan 25, 2019

As this is issue to me in Jenkins context as I run tests in container, which creates bunch of root user files, I resorted to different way:

// Jenkinsfile
env.CURRENT_USER = sh(
              script: 'echo $(id -u):$(id -g)',
              returnStdout: true
            ).trim();
// package.json
docker run --env CI=true -i --rm -v $(pwd):/myapp danlynn/ember-cli:latest /bin/sh -c \"ember test && chown -R $CURRENT_USER .\"

I simply change owner of the files as a last step.

@raido
Copy link
Author

raido commented Jan 25, 2019

Issue on Node.js - nodejs/node#25714

@rwjblue
Copy link
Owner

rwjblue commented Jan 26, 2019

I'm happy to work around via catching and using some default/fallback while things get figured out...

@raido
Copy link
Author

raido commented Jun 12, 2019

username v5.1.0 - https://github.com/sindresorhus/username/releases/tag/v5.1.0

Is available with a fix.

@rwjblue
Copy link
Owner

rwjblue commented Jun 12, 2019

OK, so we'd need to land #187 and do a major bump first, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants