We're moving our Jenkins setup to Azure.
Once I have an Azure node, I run the following:
az login -i
az acr login -n myregistry
From there, I can pull images from the registry.
My container has the docker
socket mapped inside and it interacts with docker
on the host to bring up more containers. But when I try to docker pull
from inside the container, I get
docker: Error response from daemon: Get https://myregistry.azurecr.io/v2/myimage/manifests/mytag:
unauthorized: authentication required, visit https://aka.ms/acr/authorization for more information.
See 'docker run --help'.
One way to solve the issue is to have az
installed in my container and invoke the same login on startup. I would like however not to modify the image.
Are there any other ways to use the fact that the host is already authorized for ACR?
Is there any folder in the host that I can map inside my container so that it would use the host's login information?
Thanks
question from:
https://stackoverflow.com/questions/65832330/logged-in-to-acr-on-the-host-can-i-use-that-inside-container 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…