im struggling with docker auth using GCP & art...
# general
g
im struggling with docker auth using GCP & artifact registry. i’m getting a 403 error running
Copy code
return docker.getRegistryImage({
    name: "us-east1-docker.pkg.dev/MYPROJECT/REPONAME/IMAGENAME"
  });
but when I run
docker pull <http://us-east1-docker.pkg.dev/MYPROJECT/REPONAME/IMAGENAME|us-east1-docker.pkg.dev/MYPROJECT/REPONAME/IMAGENAME>
in the same shell I’m able to pull the image successfully. I figure this is something simple but I can’t figure it out
I have run configure-docker which is why docker pull works…wondering if there’s an issue with how the Docker SDK interacts with the credHelper?
fixed it - had to explicitly configure the docker provider to use gcloud’s credHelper:
Copy code
const provider = new docker.Provider("docker-provider", {
  registryAuth: [
    {
      configFileContent: `      
      {
        "credHelpers": {
          "us-east1-docker.pkg.dev": "gcloud"
        }
      }
      `,
      address: "us-east1-docker.pkg.dev",
    },
  ],
});
...
return docker.getRegistryImage({
  name: "us-east1-docker.pkg.dev/MYPROJECT/REPONAME/IMAGENAME"
}, { provider });