Error when running the command minikube start - docker

The following error when I run the command minikube start :
👎 Unable to pick a default driver. Here is what was considered, in preference order:
▪ docker: Not healthy: "docker version --format {{.Server.Os}}-{{.Server.Version}}" exit status 1: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/version": dial unix /var/run/docker.sock: connect: permission denied
▪ docker: Suggestion: Add your user to the 'docker' group: 'sudo usermod -aG docker $USER && newgrp docker' https://docs.docker.com/engine/install/linux-postinstall/
💡 Alternatively you could install one of these drivers:
▪ kvm2: Not installed: exec: "virsh": executable file not found in $PATH
▪ vmware: Not installed: exec: "docker-machine-driver-vmware": executable file not found in $PATH
▪ podman: Not installed: exec: "podman": executable file not found in $PATH
▪ virtualbox: Not installed: unable to find VBoxManage in $PATH
❌ Exiting due to DRV_NOT_HEALTHY: Found driver(s) but none were healthy. See above for suggestions how to fix installed drivers.

Maybe you need root access to run the command, try adding your user to the docker group with this command:
sudo usermod -aG docker $USER && newgrp docker
after that restart the terminal and run the command again to check if it works

Related

Installing portainner on ubunto server permission denied

So I just installed docker and installed home assistant on docker everything is working but now I want to install PORTAINER starting with this command
docker volume create portainer_data
**And when I press enter it gives me this message get permission denied while trying to connect to the docker daemon socket at unt x:///ver/run/docker and at last it says connect: permission denied
**
What should I do ? Iam new to ubunto and have no experience
I don't know what to do
Try this
sudo groupadd docker
and
sudo usermod -aG docker ${USER}
Also check all docker group users
grep /etc/group -e "docker"

Docker Rancher - Permission Denied when using docker from WSL

I have installed Docker Rancher on Windows 10 with dockerd option and WSL on true for my current WSL distribution (Ubuntu).
When i try to use docker in WSL2, I had the following error:
fpapi#xxx:~$ docker ps
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json": dial unix /var/run/docker.sock: connect: permission denied
The command works fine in the cmd shell.
Which kind of permission I'm missing?
The issue is that Docker Rancher installer do not create the docker group.
Use the following commands:
sudo addgroup --system docker
sudo adduser $USER docker
newgrp docker
# And something needs to be done so $USER always runs in group `docker` on the `Ubuntu` WSL
sudo chown root:docker /var/run/docker.sock
sudo chmod g+w /var/run/docker.sock
thanks to https://github.com/rancher-sandbox/rancher-desktop/issues/1156#issuecomment-1017042882

ERROR: .PermissionError: [Errno 13] Permission denied: './docker-compose.yml'

When I run the docker-compose command I found an error on my ubuntu system.
My docker-compose file
Tell me how to solve this error and if any suggestions give.
This permission issue is because by default docker daemon runs as root, and you are running as non-root user.
To fix the permission error, use following commands:
sudo groupadd docker
sudo usermod -aG docker $USER
Then logout and login again or you can simply run the following command to make the changes instantly
newgrp docker
Learn more about it on Post-installation steps for Linux
Thanks
chmod 777 /var/run/docker.sock
this worked for me
credit: https://feitam.es/how-to-fix-in-docker-and-docker-compose-the-error-permissionerror-errno-13-permission-denied-in-the-fastest-way-and-possibly-unorthodox/

docker: Got permission denied while trying to connect to the Docker daemon socket

on the Ubuntu 18.04 system I have cloned a project and to run it needs gradle but at running the gradle command gradle swiplRun I get the following error
Task :dockerRun FAILED
docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.39/containers/create?name=swiprolog: dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.
Task :dockerRunStatus FAILED
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.39/containers/swiprolog/json: dial unix /var/run/docker.sock: connect: permission denied
FAILURE: Build completed with 2 failures.
to solve I tried
$ sudo groupadd docker
$ sudo usermod -a -G docker myname
"and once with"
$ sudo gpasswd -a myname docker
so I can run docker commands without sudo, but the same error
also ./gradlew --stop and logout/login and reboot did not work too.
is it because of Docker or Gradle?
Try restarting docker once
sudo systemctl restart docker
Then this one to finally solve the problem .
sudo chmod 666 /var/run/docker.sock
Now try running
docker run hello-world
it will pull the image from docker hub repository and that means your docker is now running properly.

Inside tmux, docker commands won't work without sudo

I am trying to run docker without sudo on ubuntu 16.04.
I followed the Linux post-installation instructions on the docker website:
sudo groupadd docker
sudo usermod -aG docker $USER
I rebooted and then ran
docker ps
this error still appears:
Got permission denied while trying to connect to the Docker daemon
socket at unix:///var/run/docker.sock: Get
http://%2Fvar%2Frun%2Fdocker.sock/v1.37/containers/json: dial unix
/var/run/docker.sock: connect: permission denied
the weird thing is if i ssh from my machine to itself the command is executed correctly.
when i run the command from tty it also works correctly.
edit:
output of ls -lah /var/run/docker.sock:
srw-rw---- 1 root docker 0 Aug 9 11:22 /var/run/docker.sock
output of id:
uid=1000(uname) gid=1000(uname) groups=1000(uname),4(adm),24(cdrom),27(sudo),29(audio),30(dip),46(plugdev),113(lpadmin),128(sambashare),999(docker)
what could have gone wrong?
thanks for the help!
So apparently the problem was the tmux shell.
The problem occurs when an account is added to the docker group, while still having at least one tmux session open. closing all tmux sessions solves the problem [the group accounts will now be updated in the next session].
solution:
kill tmux:
pkill -f tmux
open tmux and test docker:
docker run hello-world
now it works fine
If you initially ran Docker CLI commands using sudo before adding your user to the docker group you may get this error the you need to remove the ~/.docker/ directory (it is recreated automatically, but any custom settings are lost), or change its ownership and permissions using the following commands:
$ sudo chown "$USER":"$USER" /home/"$USER"/.docker -R
$ sudo chmod g+rwx "/home/$USER/.docker" -R

Resources