In the advanced authentication methods documentation for google cloud container registry explains a method for login to the registry using a JSON Key file with the docker cli, this just works fine
$ docker login -u _json_key -p "$(cat keyfile.json)" https://gcr.io
However I'm trying to use that same keyfile.json file to login to the registry using the golang docker/engine-api
libraries, I have some working code that this seems to be authenticating fine into other registryies, but always providing a file with the following structure
{
"auths": {
"cr.whatever.com": {
"password": "PASSWORD",
"username": "registry"
}
}
}
By passing that Unmarshal
file into ImageBuildOptions
function here to then be consumed here
However is not working when using the keyfile.json
or a working config.json
...
The docker documentation states that a JSON base64 encoded object with username and password should be used as described here into the Header Parameters section.
I've tried multiple option to produce a file that can be successfully consumed into the docker X-Registry-Config
header without much luck...
Any help/hint would be much appreciated.
Thanks!