Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure CLI cannot conect to the Docker Daemon

I'm new with Kubernetes and Azure. I want to Deply my application and I am floowing the microsoft tutorial about kubernetes. At first I have created the resouce group and ACR instance. When I try to login in ACR console show this error: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

I'm using azure cli localy and I have docker running.

like image 626
Adrian Gago Avatar asked Jul 27 '26 07:07

Adrian Gago


1 Answers

You can try below options to connect ACR :

run az acr login first with the --expose-token parameter. This option exposes an access token instead of logging in through the Docker CLI.

az acr login --name <acrName> --expose-token

Output displays the access token, abbreviated here:

{
  "accessToken": "eyJhbGciOiJSUzI1NiIs[...]24V7wA",
  "loginServer": "myregistry.azurecr.io"
}

For registry authentication, we recommend that you store the token credential in a safe location and follow recommended practices to manage docker login credentials. For example, store the token value in an environment variable:

TOKEN=$(az acr login --name <acrName> --expose-token --output tsv --query accessToken)

Then, run docker login, passing 00000000-0000-0000-0000-000000000000 as the username and using the access token as password:

docker login myregistry.azurecr.io --username 00000000-0000-0000-0000-000000000000 --password $TOKEN

you will get the below promt if you follow the above method :

WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Login Succeeded
like image 53
Ghansham Mahajan Avatar answered Jul 28 '26 20:07

Ghansham Mahajan



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!