gradle-docker-plugin: Invalid Auth config file

the gradle build: import com.bmuschko.gradle.docker.tasks.image.Dockerfile import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage

docker { url = 'tcp://127.0.0.1:2375' registryCredentials { url = 'https://registry.cn-beijing.aliyuncs.com' username = '*********' password = '***********' } }

task createDockerfile(type: Dockerfile) { destFile = project.file('build/mydockerfile/Dockerfile') from 'ubuntu:12.04' }

task buildImage(type: DockerBuildImage) { dependsOn createDockerfile inputDir = createDockerfile.destFile.parentFile tag = 'bmuschko/myimage' }

the error: Failed to parse dockerCfgFile: C:\Users\wzm\.docker\config.json

the config.json: { "auths": { "https://index.docker.io/v1/": {}, "registry.cn-beijing.aliyuncs.com": {} }, "credsStore": "wincred" }

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 21

Most upvoted comments

I would suggest to reopen this issue as this may break lot of builds. The problem is that Docker for Java is no longer able to read the latest config.json format used by Docker - see https://github.com/docker-java/docker-java/issues/806

Closing as this appears to be a config issue more than anything else.

The issue happens because you are not connected to your docker. Connect you, before running the command.

Could someone please summarize how to get the plugin working again? I’ve got the same error (“Failed to parse ~/.docker/config.json”) and clearing out that file, relogging in to the repos, and running gradle again isn’t changing anything at all. Last week I was able to build images; this week I can’t. I want to say Docker updated and broke things, but I don’t have a good reason to say that yet.

@EndOfMaster the source of the problem is in docker-java see this issue.

@jottinger I had the same issue and once I massaged my ~/.docker/config.json file all was Ok. Can you post the content of your file here as I’m curious why it’s popping.

I’m also trying to get a new release out so hopefully this will just go away.

Hi,

Above issue solved if I specify, dockerRegistryCredentials.url as ‘https://fastregistry.net/v2/_catalog

Thanks