How to run docker-compose up without root privilages?
Mia Lopez
I want to run docker-compose up as non-root user. When I execute:
sudo docker-compose upit works great, but when I execute:
docker-compose upan error is shown:
TITLE>Network Error</TITLE>
</HEAD>
<BODY>
<FONT face="Helvetica">
<big><strong></strong></big><BR>
</FONT>
<blockquote>
<TABLE border=0 cellPadding=1 width="80%">
<TR><TD>
<FONT face="Helvetica">
<big>Network Error (tcp_error)</big>
<BR>
<BR>
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
A communication error occurred: ""
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica" SIZE=2>
<BR>
For assistance, contact your network support team.
</FONT>
</TD></TR>
</TABLE>
</blockquote>
</FONT>
</BODY></HTML>I have added user to docker group and docker commands work without sudo, however docker-compose is causing trouble.
2 Answers
One of the reasons is that the current user has not been added to the docker group. To check if the current user is in the docker group, we can use:
cat /etc/group | grep dockerIf we do not see the current user in the output of the previous command, we will add it by using this command:
sudo gpasswd -a $USER dockerAnd lastly, we need to restart the docker service by using the command:
sudo service docker restart I've found solution. The invalid proxy was set for non-root user. I've edited /etc/profile and now it works ok.
1