1

I'm running 5 docker containers on Ubuntu 22.04. I have created a user and added to the group and logged in by

sudo su 'user'

I have installed virtualenv and running inside of it. All my commands are without sudo.

When i run docker-compose.yml , i see 2 warnings which are as follows:

1.The directory '/root/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag

2.Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

When i run the commands, there is clearly

(myEnv)user@instance-2:~/okuna-api$ 

which means the venv is activated.

I have already done the following :

sudo addgroup mygroup

sudo adduser user mygroup

sudo chown -R user:mygroup /home/user

sudo chmod -R g+rwX /home/user

sudo chmod 777 /var/run/docker.sock

This is a continuation to my question which isn't answered yet :

Django rest API : Python command-line .py execution: Stuck at a certain place

The core issue seems the permissions to the /root folder. I'm unable to find the right command to enable the user with read and write permissions to the root folder. Also,the docker group is created and I have already tried the following after adding user to the docker group:

sudo chown -R user:mygroup /root/.cache/pip/

But the warning still persists. I can't figure what else to do.kindky help.

Earthling
  • 83
  • 3
  • 13

0 Answers0