Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dial unix /var/run/docker.sock: connect: permission denied #7566

Closed
aslambaba opened this issue Apr 10, 2020 · 3 comments
Closed

dial unix /var/run/docker.sock: connect: permission denied #7566

aslambaba opened this issue Apr 10, 2020 · 3 comments
Labels
co/docker-driver Issues related to kubernetes in container kind/support Categorizes issue or PR as a support question. needs-solution-message Issues where where offering a solution for an error would be helpful os/linux

Comments

@aslambaba
Copy link

aslambaba commented Apr 10, 2020

Unable to Install Minikube:

$minikube start --driver=docker
minikube v1.9.2 on Ubuntu 19.10
✨ Using the docker driver based on existing profile

❗ 'docker' driver reported an issue: exit status 1
💡 Suggestion: Docker is not running or is responding too slow. Try: restarting docker desktop.

👍 Starting control plane node m01 in cluster minikube
🚜 Pulling base image ...
E0409 20:39:08.601665 24638 cache.go:114] Error downloading kic artifacts: error loading image: 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.24/images/load?quiet=0: dial unix /var/run/docker.sock: connect: permission denied
🤷 docker "minikube" container is missing, will recreate.
🔥 Creating Kubernetes in docker container with (CPUs=2) (0 available), Memory=2200MB (0MB available) ...
🤦 StartHost failed, but will try again: recreate: creating host: create: creating: create kic node: creating volume for minikube container: output 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.40/volumes/create: dial unix /var/run/docker.sock: connect: permission denied
: exit status 1
🤷 docker "minikube" container is missing, will recreate.
🔥 Creating Kubernetes in docker container with (CPUs=2) (0 available), Memory=2200MB (0MB available) ...

💣 Failed to start docker container. "minikube start" may fix it.: recreate: creating host: create: creating: create kic node: creating volume for minikube container: output 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.40/volumes/create: dial unix /var/run/docker.sock: connect: permission denied
: exit status 1

But when i use sudo it says:

minikube v1.9.2 on Ubuntu 19.10
✨ Using the docker driver based on user configuration
🛑 The "docker" driver should not be used with root privileges.
💡 If you are running minikube within a VM, consider using --driver=none:
📘 https://minikube.sigs.k8s.io/docs/reference/drivers/none/

Need Help to install minikube for Kubenetes

@tstromberg tstromberg changed the title Minikube not start !! dial unix /var/run/docker.sock: connect: permission denied Apr 10, 2020
@tstromberg tstromberg added co/docker-driver Issues related to kubernetes in container needs-solution-message Issues where where offering a solution for an error would be helpful labels Apr 10, 2020
@tstromberg
Copy link
Contributor

Hi @aslambaba

I believe you need to be in the docker group in order for the docker command-line to work. Can you confirm that docker is broken if you type:

docker ps

If so, try this to join the docker group:

newgrp docker

Otherwise, please check these instructions: https://docs.docker.com/engine/install/linux-postinstall/

Please let me know what works for you, so that we can update this error message with clearer instructions. Thank you!

@tstromberg tstromberg added triage/needs-information Indicates an issue needs more information in order to work on it. kind/support Categorizes issue or PR as a support question. labels Apr 10, 2020
@afbjorklund
Copy link
Collaborator

Minikube requires to be able to run docker without sudo, but that is not the default installation.

We noticed this with the generic driver, and there a step was added to give the user root-access.

commit 3117473

Note that this is a security risk, when doing it on the host - as opposed to in a dedicated VM.

As in: https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface

But the error could be improved. (Also seen in #7534)

@afbjorklund
Copy link
Collaborator

Now it looks like:

❗  'docker' driver reported an issue: "docker version --format {{.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.40/version: dial unix /var/run/docker.sock: connect: permission denied
💡  Suggestion: 
📘  Documentation: https://minikube.sigs.k8s.io/docs/drivers/docker/

💣  Failed to validate 'docker' driver

@afbjorklund afbjorklund removed the triage/needs-information Indicates an issue needs more information in order to work on it. label Apr 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/docker-driver Issues related to kubernetes in container kind/support Categorizes issue or PR as a support question. needs-solution-message Issues where where offering a solution for an error would be helpful os/linux
Projects
None yet
Development

No branches or pull requests

3 participants