Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker dind : Cannot connect to the Docker daemon

While running docker:dind I can't use docker login command and any other docker command.

My use case is that I got a Nexus Docker Registry and I'm trying to connect to this registry through GitLab CI.

docker run --rm -it docker:stable-dind docker login -u user -p password https://registry.mine.io

Give:

Warning: failed to get default registry endpoint from daemon (Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?). Using system default: https://index.docker.io/v1/
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
like image 701
ricko zoe Avatar asked Oct 24 '25 12:10

ricko zoe


1 Answers

just add --privileged to command.

docker run --rm -it --privileged docker:stable-dind docker login -u user -p password https://registry.mine.io

like image 177
Bukharov Sergey Avatar answered Oct 27 '25 00:10

Bukharov Sergey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!