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

Unable to use docker credentials for ACR #1224

Open
ikstewa opened this issue Oct 29, 2024 · 0 comments
Open

Unable to use docker credentials for ACR #1224

ikstewa opened this issue Oct 29, 2024 · 0 comments

Comments

@ikstewa
Copy link

ikstewa commented Oct 29, 2024

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"
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant