Alibuild in docker : a few questions

I have followed the instructions for docker on MacOSX.

I encounter the following issue when installing python modules :
Cannot uninstall 'pyparsing'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

Any idea ?

Next, how do I launch a bash as a specific user and not root ?

Finally, I am not able to map the directory between MacOS and docker. I did the -v but I don’t see this folder inside docker. If I use $HOME , is as root or as a user ?

Thank you

Hi, thanks for using Discourse :slight_smile:

I am assuming you are running a centos:7 container and the Python issue occurs there. This is just a warning that can be safely ignored for our purposes, and it’s harmless. Note that this is a CentOS 7 related problem, not a Docker on macOS one.

As for the -v, the important bit is using exactly the same path inside and outside the container. Note that when you launch Docker, your $HOME directory will be expanded by the shell on your Mac before the Docker command is actually run, so if on your Mac the value of $HOME is, say, /Users/myusername, then the command bit will expand to:

-v /Users/myusername:/Users/myusername

As soon as you log into your Docker container, you are a different user with a different home directory. This means that, inside the container, doing:

cd $HOME

will probably bring you to /root, which is wrong. You must explicitly do:

cd /Users/myusername

The root shell you have inside Docker is not really a root shell (you won’t have root permissions on your Mac, just within your container). Given that you need to be root in order to perform the various apt install or yum install, if you want to become a different user just useradd it and then su.

Is there something you think we should be clarifying/improving in the doc?

Thank you for your reply.

It was actually an error in python that prevented the installation of the modules. I had to add --ignore-installed to continue. Maybe this should be added to the instructions if it is a common problem.

For the path, I actually got confused because of the difference in the path of the home directories in mac and in linux. Now I found it inside docker.

Thanks !