Expected Behavior
When attempting to pull a base image from a private ACR we should be able to leverage the credentials from docker desktop.
Current Behavior
Pulling the base image fails with error:
> Could not build image: failed to resolve reference "myacr.azurecr.io/myimage:mytag": failed to authorize: failed to fetch oauth token: unexpected status from GET request to https://myacr.azurecr.io/oauth2/token?scope=repository%3Amyimage%3Apull&service=myacr.azurecr.io: 401 Unauthorized
Steps to Reproduce (for bugs)
az acr login -n myacr
./gradlew buildImage
val buildImage = tasks.register<DockerBuildImage>("buildImage") {
dependsOn(dockerSyncBuildContext)
images.addAll(
"myacr.azurecr.io/mynewimage:" + project.version,
"myacr.azurecr.io/mynewimage:latest")
}
Docker config file ~/.docker/config.json:
{
"auths": {
"ghcr.io": {},
"myacr.azurecr.io": {}
},
"credsStore": "desktop",
"currentContext": "default",
"plugins": {
"-x-cli-hints": {
"enabled": "true"
},
"debug": {
"hooks": "exec"
},
"scout": {
"hooks": "pull,buildx build"
}
},
"features": {
"hooks": "true"
}
}
Expected Behavior
When attempting to pull a base image from a private ACR we should be able to leverage the credentials from docker desktop.
Current Behavior
Pulling the base image fails with error:
Steps to Reproduce (for bugs)
az acr login -n myacr./gradlew buildImageDocker config file
~/.docker/config.json:{ "auths": { "ghcr.io": {}, "myacr.azurecr.io": {} }, "credsStore": "desktop", "currentContext": "default", "plugins": { "-x-cli-hints": { "enabled": "true" }, "debug": { "hooks": "exec" }, "scout": { "hooks": "pull,buildx build" } }, "features": { "hooks": "true" } }