I installed docker-machine 0.1.0 and docker-compose 1.1.0 on Mac OS 10.8.5.
Docker-machine is running normally and able to connect by docker-machine ssh.
I know it's silly, but in my case I just tried with sudo
and it worked like a charm.
in your case, just try: $ sudo docker-compose up
My setup has got two cases for this error:
__pycache__
files created by root user after I run integration tests inside container are inaccessible for docker (tells you original problem) and docker-compose (tells you about docker host ambiguously);microk8s
blocked my port until I stopped it.If you started docker using sudo
, then you should run docker-compose up with sudo
Like: sudo docker-compose up
By default the docker daemon always runs as the root user, therefore you need to prepend sudo
to your Docker command(s).
If you don’t want to use sudo when you use the docker command, create a Unix group called docker and add users to it. When the docker daemon starts, it makes the ownership of the Unix socket read/writable by the docker group.
Create the docker group.
$ sudo groupadd docker
Add your user to the docker group.
$ sudo usermod -aG docker $USER
Log out and log back in so that your group membership is re-evaluated.
Verify that you can docker commands without sudo.
$ docker run hello-world
This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits.
The steps outlined above comes from the official Docker documentation.
I solved the issue in Ubuntu 20.0.4 by
sudo chmod 666 /var/run/docker.sock
and then
sudo service docker start && docker-compose up -d
Ref.
try this:
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose