How to run docker-compose up without root privilages?

8,836

Solution 1

I've found solution. The invalid proxy was set for non-root user. I've edited /etc/profile and now it works ok.

Solution 2

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 docker

If 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 docker

And lastly, we need to restart the docker service by using the command:

sudo service docker restart
Share:
8,836

Related videos on Youtube

Hash Doe
Author by

Hash Doe

Updated on September 18, 2022

Comments

  • Hash Doe
    Hash Doe over 1 year

    I want to run docker-compose up as non-root user. When I execute:

    sudo docker-compose up
    

    it works great, but when I execute:

    docker-compose up
    

    an 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.

  • Garry Cairns
    Garry Cairns over 6 years
    Please edit your answer to show what changes you made to get it working. As things are the answer is of limited use to people with the same problem.