Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

permission denied in docker-compose on linux [closed]

(base) a@a-ThinkPad-T440:~$ docker-compose version
bash: /usr/local/bin/docker-compose: Permission denied

I have big problem with docker-compose, I tried to upgrade docker-compose to 1.25 with curl but now I have no permission for docker-compose (I have linux ubuntu)

like image 782
Z.Dubeau Avatar asked Dec 10 '19 10:12

Z.Dubeau


People also ask

How do I fix permission denied Docker?

If running elevated Docker commands does not fix the permission denied error, verify that your Docker Engine is running. Similar to running a docker command without the sudo command, a stopped Docker Engine triggers the permission denied error. How do you fix the error? By restarting your Docker engine.

What is Docker compose in Linux?

Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application's services. Then, with a single command, you create and start all the services from your configuration.


1 Answers

As far as I can understand you are using docker's source to install docker-compose and you forgot the second step. Source for complete installation.

As second step states. Apply executable permissions to the binary:

sudo chmod +x /usr/local/bin/docker-compose;

In addition to the comments provided in the question

sudo usermod -aG docker $USER                  # to add myself to docker group
sudo chgrp docker /usr/local/bin/docker-compose     # to give docker-compose to docker group,
sudo chmod 750 /usr/local/bin/docker-compose   # to allow docker group users to execute it

You might want to try running newgrp docker

like image 151
adamkgray Avatar answered Sep 30 '22 14:09

adamkgray