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

I can't use the docker machine with another user than root #2

Open
stephanerenou opened this issue Mar 30, 2017 · 2 comments
Open

I can't use the docker machine with another user than root #2

stephanerenou opened this issue Mar 30, 2017 · 2 comments

Comments

@stephanerenou
Copy link

Hello,
I would like to use the machine to build my code using a mounted volume.
The concern is that this generates the files as root on my host.
A workaround to this is to run the machine using the user option as -u $UID
Unfortunately in that case, haxe complains as below
docker run -u $UID -it --rm --name my-running-aa my-haxe-app haxe build.hxml
Error: Error: This is the first time you are runing haxelib. Please run haxelib setup first

getting the concern with release 3.4 and 3.4.2

@andyli
Copy link
Member

andyli commented Mar 31, 2017

As the error suggested, can you run haxelib setup path/to/somewhere before running haxe build?

This is related to how haxelib stores its local repository path setting in the user's home (in ~/.haxelib IIRC), so the config need to be done for each user... We probably should improve it in haxelib, but I have no concrete idea on how to do it yet.

@stephanerenou
Copy link
Author

Hello,
just in case someone gets interested, I applied the process described at this url: https://denibertovic.com/posts/handling-permissions-with-docker-volumes/ which allows to start with a specific userID.
Then I can run my docker build process as:
sudo docker run -e LOCAL_USER_ID=$UID --rm -v "$(pwd)":/tmp/hx -w /tmp/hx myHaxeMachine:1 /bin/bash -c "haxelib setup /usr/local/lib/haxe/lib; haxe build.hxml"
this works fine for me.

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